Gun Milan Scoring Algorithm: How Kundli Matching Works
How the 36-point Gun Milan algorithm scores compatibility across 8 kootas. Covers Nadi dosha cancellation, Bhakoot exceptions, and API integration.
TL;DR
- Gun Milan is the 36-point Ashtakoot scoring system used in Vedic marriage matching, evaluating 8 categories from spiritual compatibility to health genetics
- Nadi (8 points) and Bhakoot (7 points) carry the most weight and have classical dosha cancellation rules that most implementations get wrong
- Scores below 18 are not recommended, 18 to 24 are acceptable, 24 to 32 are good, and 32 or above are excellent
- Build automated kundli matching with the Vedic Astrology API and get scored breakdowns in a single request
About the author: Brajesh Vashisht is a Vedic Astrologer and KP Systems Specialist with over 22 years of experience in Vedic astrology and Krishnamurti Paddhati. He holds a postgraduate degree in Jyotish Shastra from Banaras Hindu University and has authored two books on KP sub-lord theory and nakshatra analysis. His research focuses on precision event timing using dasha systems, ashtakavarga scoring, and Vedic divisional charts.
Every year, millions of families across India and the South Asian diaspora consult a pandit or jyotish software to run gun milan before agreeing to a marriage proposal. The process looks simple on the surface: two birth charts go in, a number out of 36 comes out, and the families decide whether to proceed. But beneath that single number is an eight-layer algorithm with weighted scoring, bidirectional cross-references, animal compatibility matrices, and classical dosha cancellation rules drawn from texts like Muhurta Martanda and Brihat Parashara Hora Shastra (BPHS). If you are building a matrimonial platform, a kundli matching feature, or simply want to understand why your score was 24.5 instead of 25, this post breaks down every layer of the Ashtakoot system as it is actually computed.
What is Ashtakoot Gun Milan and why does it use 36 points
Ashtakoot means "eight groups" in Sanskrit. Gun Milan (also written Guna Milan) is the process of matching these eight groups between two horoscopes to produce a compatibility score. The maximum score is 36 points, distributed unevenly across the eight kootas. Each koota evaluates a different dimension of married life, from spiritual outlook to physical compatibility to genetic health. The uneven weighting is intentional. Varna, which measures spiritual compatibility, carries only 1 point because the classical texts consider it the easiest mismatch to overcome. Nadi, which measures health and progeny compatibility, carries 8 points because mismatches here were historically considered the most consequential. The input to the entire algorithm is the Moon nakshatra (lunar mansion) of each person, derived from the sidereal longitude of the Moon at birth. Everything flows from that single data point: the 27 nakshatras map to zodiac signs, animal types, temperament groups, and Nadi categories through fixed lookup tables codified centuries ago.
The eight kootas: what each one measures and how it scores
Varna (1 point) classifies each Moon sign into one of four spiritual categories: Brahmin (Cancer, Scorpio, Pisces), Kshatriya (Aries, Leo, Sagittarius), Vaishya (Taurus, Virgo, Capricorn), and Shudra (Gemini, Libra, Aquarius). If the first person (groom) has equal or higher rank than the second person (bride), the point is awarded. This is a simple greater-than-or-equal check on a four-level hierarchy.
Vashya (2 points) evaluates mutual attraction and dominance. Each Moon sign maps to one of five creature types: Chatushpada (quadruped), Manava (human), Jalchar (aquatic), Vanacara (wild), and Keeta (insect). Sagittarius and Capricorn split between two types based on whether the Moon falls in the first or second half of the sign. Scores come from a 5x5 lookup matrix where same-type pairs score 2 and cross-type pairs range from 0 to 1.5.
Tara (3 points) uses a bidirectional nakshatra distance calculation. Count from person 1 to person 2 (modulo 27), take the result modulo 9 to get a Tara group (Janma, Sampat, Vipata, Kshema, Pratyari, Sadhaka, Naidhana, Mitra, Parama Mitra). Three of these nine groups are unfavorable: Vipata (3rd), Pratyari (5th), and Naidhana (7th). Repeat the count from person 2 to person 1. Average the two directional scores. This bidirectional averaging means Tara can produce fractional scores of 0, 1.5, or 3.
Yoni (4 points) maps each of the 27 nakshatras to one of 14 animal types: Horse, Elephant, Sheep, Serpent, Dog, Cat, Rat, Cow, Buffalo, Tiger, Hare, Monkey, Mongoose, and Lion. Same animal pairs score 4. All other pairs are looked up in a 14x14 compatibility matrix. Enemy animal pairs (Serpent and Mongoose, Cat and Rat) score 0. Friendly or neutral pairs fall between 1 and 3.
Ready to build this? RoxyAPI Vedic Astrology API gives you scored Ashtakoot breakdowns with dosha cancellation analysis in a single POST request. See pricing.
Graha Maitri (5 points) compares the planetary lords of each Moon sign. Each zodiac sign has a ruling planet (lord), and the relationship between two lords is classified as friend, neutral, or enemy using a fixed planetary friendship table from classical jyotish. The score comes from a 3x3 matrix: friend-friend scores 5, enemy-enemy scores 0, and mixed relationships fall between 0.5 and 4. This is bidirectional: Jupiter may consider Saturn neutral while Saturn considers Jupiter neutral, and the score uses the intersection of both relationships.
Gana (6 points) classifies each nakshatra as Deva (divine), Manushya (human), or Rakshasa (demon). Same-Gana pairs score 6. Deva-Manushya and Manushya-Deva pairs score 5. Manushya-Rakshasa pairs score 1. Deva-Rakshasa pairs score 0. The asymmetry between Deva-Manushya (5) and Manushya-Rakshasa (1) reflects the classical view that temperament distance matters more at the extremes.
Bhakoot (7 points) checks the angular distance between the two Moon signs. Three sign-distance pairs are considered inauspicious: 2/12 (distance of 1 or 11 signs), 5/9 (distance of 4 or 8 signs), and 6/8 (distance of 5 or 7 signs). If the distance falls into any of these pairs, the score is 0. Otherwise, full 7 points are awarded. This binary scoring makes Bhakoot one of the most impactful kootas.
Nadi (8 points) assigns each nakshatra to one of three Nadi types: Adi (wind), Madhya (bile), and Antya (phlegm). The mapping uses a palindromic pattern across the 27 nakshatras, not a simple repeating cycle. If both people share the same Nadi type, the score is 0 (Nadi Dosha). If the types differ, full 8 points. This is the highest-weighted koota and a score of 0 here triggers Nadi Dosha evaluation.
How Nadi Dosha cancellation prevents false negatives
Nadi Dosha (same Nadi type, 0 out of 8 points) is the most feared result in gun milan. Classical texts warn it can indicate health issues in offspring. But the same texts, particularly Muhurta Martanda, provide three cancellation conditions. If any one condition is met, the dosha is neutralized even though the koota score remains 0. The conditions are: (1) both people share the same Moon sign (rashi) but occupy different nakshatras, (2) both occupy the same nakshatra but in different padas (quarter divisions), and (3) both occupy the same nakshatra but it spans two different signs (junction nakshatras like Krittika, Mrigashira, Pushya, and others). Many implementations skip these cancellation checks entirely, flagging Nadi Dosha when classical rules would cancel it. A correct implementation must check all three conditions before marking the dosha as active.
How Bhakoot Dosha cancellation changes the recommendation
Bhakoot Dosha (0 out of 7 points from an inauspicious Moon sign distance) also has classical cancellation rules from Brihat Parashara Hora Shastra. Two conditions can cancel it: (1) the lords of both Moon signs are the same planet (for example, both Moon signs ruled by Venus), or (2) the lords are mutual natural friends (both must consider the other a friend in the planetary friendship table). When cancellation applies, the koota score stays at 0 but the dosha is not counted against the marriage recommendation. Without these checks, any 2/12, 5/9, or 6/8 Moon sign combination would be flagged as problematic, even when classical authorities explicitly permit it. The cancellation logic is what separates a naive lookup table from a production-grade compatibility engine. Both Nadi and Bhakoot cancellations are returned as structured data in the API response.
Score thresholds: what the numbers actually mean
The 36-point scale has well-established interpretation thresholds. Below 18 points (under 50%): the match is not recommended. Astrologers typically advise against proceeding unless there are strong planetary yogas in both charts that override the Ashtakoot score. 18 to 24 points (50% to 67%): acceptable match. Most marriages in practice fall in this range. 24 to 32 points (67% to 89%): good match with strong compatibility across most dimensions. Above 32 points (89% and above): excellent match, though some traditional practitioners note that extremely high scores can indicate the charts are too similar, reducing complementary energy. The recommendation also factors in active doshas. A score of 22 with an active Nadi Dosha will get a "not recommended" verdict, while a score of 22 with a cancelled Nadi Dosha will get "union is recommended."
How to calculate gun milan with the Vedic Astrology API
The compatibility endpoint accepts birth data for two people and returns the full Ashtakoot breakdown with dosha analysis. Here is a working example:
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/compatibility \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"person1": {
"date": "1990-07-04",
"time": "10:12:00",
"latitude": 28.6139,
"longitude": 77.2090,
"timezone": 5.5
},
"person2": {
"date": "1992-03-15",
"time": "14:30:00",
"latitude": 19.0760,
"longitude": 72.8777,
"timezone": 5.5
}
}'
The response includes the total score, percentage, compatibility verdict, active doshas, dosha cancellations with reasons, and a breakdown array with all 8 kootas:
{
"total": 24.5,
"maxScore": 36,
"percentage": 68.1,
"isCompatible": true,
"recommendation": "Union is recommended",
"doshas": [],
"doshaCancellations": [
{
"dosha": "Bhakoot Dosha",
"reason": "Moon sign lords are the same planet (Venus)"
}
],
"breakdown": [
{
"category": "Varna",
"score": 1,
"maxScore": 1,
"person1": "Vaishya",
"person2": "Shudra",
"description": "Spiritual compatibility and mutual respect"
},
{
"category": "Nadi",
"score": 8,
"maxScore": 8,
"person1": "Antya",
"person2": "Adi",
"description": "Health and genetic compatibility"
}
]
}
Each koota in the breakdown shows the score, maximum possible score, and the classification for both people. The doshaCancellations array explains exactly which classical rule neutralized the dosha, giving you audit-trail data that traditional software rarely exposes. Full endpoint documentation is available in the Vedic Astrology API reference.
Frequently Asked Questions
Q: What is the minimum gun milan score for marriage? A: The traditional threshold is 18 out of 36 (50%). Scores below 18 are generally not recommended by Vedic astrologers. However, scores between 18 and 24 are considered acceptable, and most successful marriages fall in this range. Active doshas (Nadi or Bhakoot) can override a passing score.
Q: What is Nadi Dosha and when does it get cancelled? A: Nadi Dosha occurs when both people share the same Nadi type (Adi, Madhya, or Antya), resulting in 0 out of 8 points. It gets cancelled under three conditions from Muhurta Martanda: same Moon sign with different nakshatras, same nakshatra with different padas, or same nakshatra spanning different zodiac signs. When cancelled, the score stays 0 but the dosha does not affect the recommendation.
Q: How is gun milan different from full kundli matching? A: Gun Milan (Ashtakoot matching) is the 36-point scoring component of kundli matching. Full kundli matching also includes Manglik Dosha analysis, planetary yoga evaluation, dasha compatibility, and other factors that astrologers assess beyond the 8 kootas. Gun Milan is the quantitative foundation that most families check first.
Q: Can the gun milan score be a fraction like 24.5? A: Yes. Several kootas produce fractional scores. Tara uses bidirectional averaging and can score 0, 1.5, or 3. Vashya has cross-type scores of 0.5 and 1.5. Graha Maitri produces 0.5 for certain mixed friendship combinations. These fractions are part of the classical system, not rounding artifacts.
Q: Why do different websites show different gun milan scores for the same birth data? A: Three common reasons: different ayanamsa values (Lahiri vs Raman vs KP) shift the Moon nakshatra boundary, different Nadi mapping patterns (simple repeating vs palindromic), and different dosha cancellation implementations. The RoxyAPI Vedic Astrology API uses Lahiri ayanamsa and palindromic Nadi mapping, both verified against DrikPanchang, with full classical cancellation rules from Muhurta Martanda and BPHS.
Building gun milan into your application
The Ashtakoot gun milan algorithm combines fixed lookup tables, weighted scoring, bidirectional calculations, and exception handling into a system that is deceptively complex to implement correctly. The dosha cancellation rules are where most implementations diverge from classical texts, and where wrong results cause real harm to families making marriage decisions. Whether you are building a matrimonial platform or adding compatibility features to a jyotish application, the Vedic Astrology API handles the full computation with structured, auditable output. See pricing to get started.