← Developer tools

Tithi, karana and yoga from Sun and Moon longitudes

Three of the five panchang limbs are pure arithmetic on two numbers. Give the Sun's and Moon's longitudes - from any endpoint or ephemeris - and the tool returns what POST /v1/panchang would report for that moment, with how far into each limb the moment falls.

Free · runs in your browser · no API key needed · updated

Sun longitude
Moon longitude
Tithi
25 · Krishna Dashami
Moon - Sun
295.1020°
Tithi elapsed / left
7.1020° / 4.8980°
Karana
50 · Vishti
Yoga
27 · Vaidhriti
Sun + Moon (sidereal)
349.2315°

Three rules

How the engine computes each limb
LimbAngleRule
Tithi 1-30Moon - Sun (0-360°)floor(angle / 12) + 1; 1-15 Shukla, 16-30 Krishna; 15 is Purnima, 30 Amavasya
Karana 1-60Moon - Sunfloor(angle / 6) + 1; 1 Kimstughna, 2-57 cycle Bava, Balava, Kaulava, Taitila, Garaja, Vanija, Vishti; 58-60 Shakuni, Chatushpada, Naga
Yoga 1-27Sun + Moon (0-360°)floor(angle / 13°20′) + 1, Vishkambha to Vaidhriti

Names are the engine's own tables; the full lists, with nakshatra and vara, are in the panchang elements reference.

Which zodiac? Only the yoga cares

Converting tropical to sidereal subtracts the same ayanamsa from the Sun and the Moon, so Moon - Sun is identical in both zodiacs: tithi and karana come out the same whatever you feed in. Sun + Moon loses the ayanamsa twice - about 48.5° in 2026, three and a half yogas - so the yoga depends on the zodiac. The engine uses the sidereal (Lahiri) sum, from Swiss Ephemeris' sidereal mode. Choose "Tropical" in the tool and give the moment, and it subtracts twice the mean Lahiri ayanamsa first; because the engine's sidereal mode also removes nutation, that sum can differ from the engine's by up to about 37″, which matters only right at a yoga boundary.

Worked example from a recorded panchang

The playground's panchang request (12 May 2026, 31.7473 N 77.7754 E, IST) is evaluated at sunrise, 2026-05-11T23:54:28Z. The sidereal Sun is then 27.0647° and the Moon 322.1667°:

  • Moon - Sun = 295.1020° → 295.1020 / 12 = 24.59 → tithi 25, Krishna Dashami, 7.10° in, 4.90° to go.
  • 295.1020 / 6 = 49.18 → karana 50: (50 - 2) mod 7 = 6 → Vishti.
  • Sun + Moon = 349.2315° → 349.2315 / 13.3333 = 26.19 → yoga 27, Vaidhriti.

The recorded response has exactly those three. Fed the tropical longitudes of the same instant (51.2917° and 346.3937°), the tithi and karana stay the same but the raw sum gives yoga 3, Ayushman - the wrong answer for a Vedic panchang. At 200 sunrises across 1950-2100 and ten cities, the tool and the engine agree on all three limbs every time.

Common mistakes

  • Reading the tithi at the wrong moment. The API evaluates at local sunrise; a tithi lasts roughly 20 to 26 hours, so the one at noon may differ. The response's tithi.start and tithi.end give the actual span - see panchang sunrise conventions.
  • Expecting tithi names to be unique. Pratipada to Chaturdashi occur in both pakshas; use the index or the paksha.
  • Confusing the panchang yoga with chart yogas. This is the Sun + Moon limb, not a planetary combination from POST /v1/yogas.
  • Feeding tropical sums into the yoga. See above.

FAQ

Why are there only 11 karana names for 60 karanas?
Seven movable karanas repeat eight times through slots 2-57; four fixed ones take slot 1 and slots 58-60, around the new moon.
Can I get the moment a tithi ends from this tool?
No - that needs the Sun's and Moon's motion. The API solves for it and returns tithi.start and tithi.end as UTC instants.
Does the ayanamsa choice change the tithi?
No: Lahiri, KP or tropical, the difference Moon - Sun is the same. Only the yoga moves.