Ayanamsa Explained for Developers: Lahiri vs Raman vs KP
Ayanamsa is the offset between tropical and sidereal zodiacs. Learn how Lahiri, Raman, and KP systems differ and how to implement them in code.
TL;DR
- Ayanamsa is the angular offset between the tropical and sidereal zodiacs, currently around 24 degrees and growing by ~50.3 arcseconds per year.
- A difference of just 6 arcminutes between ayanamsa systems can flip a planet into a different nakshatra pada or sub-lord.
- Lahiri (government standard), Raman (fixed epoch), and KP (fine-tuned Newcomb) each produce different sidereal longitudes for the same moment.
- Get real-time ayanamsa values and sidereal positions from the Vedic Astrology API with a single API call.
About the author: Brajesh Vashisht is a Vedic astrology consultant with over 22 years of experience in Jyotish 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.
If you are building a Vedic astrology application, the first architectural decision you face is which ayanamsa to use. Get it wrong and every planetary position, every nakshatra boundary, and every dasha period in your system will be slightly off. The ayanamsa value is the single number that converts a tropical (Western) longitude into a sidereal (Vedic) longitude. Two apps using different ayanamsa systems will produce different birth charts for the same person. For developers who have never studied precession, this guide explains what ayanamsa is, why the three major systems disagree, and how to implement the conversion correctly.
What is ayanamsa and why does it exist
The Earth wobbles on its axis like a spinning top. This wobble, called precession of the equinoxes, causes the vernal equinox point to drift westward along the ecliptic at roughly 50.3 arcseconds per year. Over centuries, this drift accumulates. Western (tropical) astrology anchors its zodiac to the vernal equinox, so tropical 0 degrees Aries always starts at the spring equinox regardless of where the stars actually are. Vedic (sidereal) astrology anchors its zodiac to fixed stars. The gap between these two reference frames is the ayanamsa. In 2026, the offset is approximately 24.2 degrees. That means a planet at tropical 10 degrees Taurus sits at roughly sidereal 15 to 16 degrees Aries in the Vedic system. Without applying the correct ayanamsa, your entire chart is in the wrong zodiac signs.
Why a small ayanamsa error breaks everything
A 1-degree error in ayanamsa shifts every planet by 1 degree. That sounds minor until you consider the precision required by Vedic systems. Each nakshatra spans 13 degrees 20 arcminutes. Each nakshatra pada spans just 3 degrees 20 arcminutes. In KP astrology, each sub-lord division can be as narrow as 40 arcminutes. A planet sitting at 26 degrees 38 arcminutes in a nakshatra is in pada 4. Shift it by just 6 arcminutes and it crosses into the next nakshatra entirely. That single boundary crossing changes the dasha lord sequence, alters compatibility scores, and produces different sub-lord assignments. For matrimonial matching and event timing applications, this level of precision is not optional. The ayanamsa you choose determines whether your users see Ashwini or Bharani, and those two nakshatras have completely different ruling deities, characteristics, and dasha implications.
Ready to build this? RoxyAPI Vedic Astrology API gives you real-time ayanamsa values and sidereal positions verified against NASA JPL Horizons. See pricing.
Lahiri (Chitrapaksha): the government standard
The Lahiri ayanamsa, also called Chitrapaksha, is the official standard adopted by the Indian Astronomical Ephemeris and the Government of India. Its reference point is the fixed star Spica (Chitra in Sanskrit), which is defined to sit at exactly 0 degrees Libra in the sidereal zodiac. The approximate formula is:
ayanamsa = 23.85 + 0.0139 * (year - 2000) degrees
For 2026, this gives roughly 24.21 degrees. Lahiri is the most widely used ayanamsa in India and is the default in most commercial Vedic astrology software. If you are building an app for the Indian market and your users expect their charts to match what they see on popular panchang sites, Lahiri is the safe default. The RoxyAPI Vedic Astrology endpoints use Lahiri for all standard birth chart, planetary position, and dasha calculations.
Raman (B.V. Raman): the traditional alternative
The Raman ayanamsa was defined by the legendary Indian astrologer B.V. Raman. It uses a fixed epoch calculation that places the zero point of the sidereal zodiac at a different historical date than Lahiri. The result is an ayanamsa value approximately 2 degrees less than Lahiri for any given year. For 2026, Raman ayanamsa is approximately 22.37 degrees compared to Lahiri at 24.21 degrees. This nearly 2-degree gap means a planet near a sign boundary in one system may be in a completely different rashi in the other. Raman is popular among traditional astrologers in South India and among practitioners who follow B.V. Raman publications. If your application targets this audience, you need to support Raman as a selectable option or your charts will not match what these practitioners expect from their reference texts.
KP (Krishnamurti Paddhati): precision for event timing
The KP system, developed by the late Prof. K.S. Krishnamurti, is built on the Lahiri framework but applies fine-tuned corrections derived from Newcomb precession theory. The KP-Newcomb formula accounts for the non-linear component of precession, producing values that differ from standard Lahiri by a few arcminutes. For event timing and horary (prashna) astrology, those arcminutes matter. The KP system divides each nakshatra into 9 unequal sub-divisions based on Vimshottari dasha proportions, creating 249 distinct sub-lord zones across the zodiac. A planet near a sub-lord boundary can flip into a different sub-lord with even a tiny ayanamsa change. KP practitioners consider the Newcomb-based ayanamsa essential for accurate sub-lord assignments, which drive all KP predictions.
Comparison table: ayanamsa values by year
| Year | Lahiri (approx.) | Raman (approx.) | KP-Newcomb (approx.) |
|---|---|---|---|
| 2000 | 23.85 deg | 21.99 deg | 23.85 deg |
| 2010 | 23.99 deg | 22.13 deg | 23.99 deg |
| 2020 | 24.13 deg | 22.27 deg | 24.13 deg |
| 2026 | 24.21 deg | 22.37 deg | 24.22 deg |
| 2030 | 24.27 deg | 22.42 deg | 24.27 deg |
Notice that Lahiri and KP-Newcomb track closely, typically within 0.01 to 0.02 degrees of each other. Raman sits roughly 1.8 to 1.9 degrees lower across all years. The difference between Lahiri and KP-Newcomb seems trivial in degrees, but when converted to arcminutes (multiply by 60), even a 0.01-degree gap equals 0.6 arcminutes. At sub-lord boundaries, that can be the difference between two completely different predictions.
How to convert tropical to sidereal in code
The conversion formula is straightforward:
sidereal_longitude = tropical_longitude - ayanamsa
If the result is negative, add 360. Here is the logic in pseudocode:
function toSidereal(tropicalDegrees, ayanamsa):
sidereal = tropicalDegrees - ayanamsa
if sidereal < 0:
sidereal = sidereal + 360
return sidereal
For example, a planet at tropical 54.21 degrees (in Taurus) with Lahiri ayanamsa of 24.21 degrees yields a sidereal longitude of 30.00 degrees, placing it at exactly 0 degrees Taurus in the sidereal zodiac. Shift the ayanamsa by just 0.01 degrees and that planet drops back into the final arcminute of sidereal Aries. Your code must handle these boundary conditions precisely. Floating point rounding in the conversion step is a common source of bugs in astrology software. Always carry at least 6 decimal places through the calculation chain before rounding for display.
How to get ayanamsa and sidereal positions from the API
Rather than implementing precession formulas yourself, you can call the Vedic Astrology API to get precise values. The KP ayanamsa endpoint returns the dynamically calculated KP-Newcomb value for any date:
curl "https://roxyapi.com/api/v2/vedic-astrology/kp/ayanamsa?date=2026-04-10" \
-H "X-API-Key: YOUR_API_KEY"
Response:
{
"date": "2026-04-10",
"ayanamsa": 24.22233926,
"type": "kp-newcomb",
"formula": "Newcomb precession theory",
"calculated": "2026-04-10T12:00:00Z"
}
To get full sidereal planetary positions with Lahiri ayanamsa applied, use the planetary positions endpoint:
curl -X POST "https://roxyapi.com/api/v2/vedic-astrology/planetary-positions" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "1990-07-04",
"time": "10:12:00",
"latitude": 28.6139,
"longitude": 77.209,
"timezone": 5.5
}'
The response returns each planet with its sidereal longitude, rashi, nakshatra, pada, house number, and retrograde status:
{
"Sun": {
"graha": "Sun",
"rashi": "Gemini",
"longitude": 78.45,
"house": 5,
"nakshatra": {
"name": "Punarvasu",
"pada": 1,
"key": 7
},
"isRetrograde": false
},
"Moon": {
"graha": "Moon",
"rashi": "Cancer",
"longitude": 98.32,
"house": 4,
"nakshatra": {
"name": "Pushya",
"pada": 2,
"key": 8
},
"isRetrograde": false
}
}
All standard endpoints use Lahiri ayanamsa by default. The KP-specific endpoints under /kp/ use the Newcomb-corrected value. Full endpoint documentation is available in the API reference.
Frequently Asked Questions
Q: What is the difference between Lahiri and KP ayanamsa? A: Lahiri uses the Chitrapaksha method, anchoring the sidereal zodiac to the star Spica at 0 degrees Libra. KP uses the same baseline but applies Newcomb precession corrections for finer accuracy. The difference is typically 0.01 to 0.02 degrees, which matters for sub-lord boundary calculations in Krishnamurti Paddhati.
Q: Which ayanamsa should I use for my astrology app? A: For general Vedic astrology apps targeting the Indian market, use Lahiri. It is the government standard and matches what users expect from popular panchang sites. For KP-specific applications focused on event timing and horary astrology, use KP-Newcomb. For users who follow B.V. Raman traditions, offer Raman as a selectable option.
Q: How much does ayanamsa change per year? A: Ayanamsa increases by approximately 50.3 arcseconds (about 0.014 degrees) per year due to the precession of the equinoxes. This means the tropical and sidereal zodiacs drift apart by roughly 1 degree every 72 years.
Q: Can a small ayanamsa difference change a birth chart? A: Yes. A difference of just 6 arcminutes (0.1 degrees) can move a planet across a nakshatra pada boundary or a KP sub-lord boundary. This changes dasha lord sequences, compatibility scores, and event timing predictions. Precision is not optional in Vedic calculations.
Q: Does the Vedic Astrology API support multiple ayanamsa systems?
A: Standard endpoints use Lahiri ayanamsa by default. KP-specific endpoints under the /kp/ path use KP-Newcomb ayanamsa with dynamic calculation for any date. You can retrieve the exact KP-Newcomb value using the dedicated ayanamsa endpoint and apply your own conversion if needed.
Conclusion
Ayanamsa is the foundational parameter in any sidereal astrology system. Choosing between Lahiri, Raman, and KP-Newcomb determines every planetary position, nakshatra assignment, and dasha period your application produces. Get it right once and your entire calculation chain stays accurate. The Vedic Astrology API handles these calculations server-side with values verified against NASA JPL Horizons, so you can focus on building features instead of debugging precession math. Check pricing to get started.