How a tithi is calculated
A tithi is a lunar day: one thirtieth of the cycle from one new moon to the next. Unlike a civil day, it is not tied to midnight or to a fixed number of hours. It is defined purely by the angle between the Moon and the Sun, which is why it can start at any moment of the day or night.
The definition: 12 degrees of elongation
Take the Moon's ecliptic longitude and subtract the Sun's. The result, wrapped to 0–360°, is the elongation. At new moon it is 0°; at full moon it is 180°. Divide the full circle into 30 equal parts of 12° each, and each part is one tithi:
elongation = (moon_longitude - sun_longitude) mod 360
tithi_number = floor(elongation / 12) + 1 # 1 to 30Because the formula uses the difference of two longitudes, any constant offset added to both cancels out. That means the tithi does not depend on the ayanamsa, unlike nakshatras and solar months. It does depend on accurate positions of the Moon, which moves fast, so the ephemeris matters.
Names and fortnights
Tithis 1–15 form the shukla paksha, the bright fortnight in which the Moon waxes, ending at Purnima. Tithis 16–30 form the krishna paksha, the dark fortnight, ending at Amavasya. Names repeat across the two fortnights, so a tithi is identified by its paksha plus its name, for example “krishna Ekadashi”.
| No. | Shukla paksha | No. | Krishna paksha |
|---|---|---|---|
| 1 | Pratipada | 16 | Pratipada |
| 2 | Dvitiya | 17 | Dvitiya |
| 3 | Tritiya | 18 | Tritiya |
| 4 | Chaturthi | 19 | Chaturthi |
| 5 | Panchami | 20 | Panchami |
| 6 | Shashthi | 21 | Shashthi |
| 7 | Saptami | 22 | Saptami |
| 8 | Ashtami | 23 | Ashtami |
| 9 | Navami | 24 | Navami |
| 10 | Dashami | 25 | Dashami |
| 11 | Ekadashi | 26 | Ekadashi |
| 12 | Dvadashi | 27 | Dvadashi |
| 13 | Trayodashi | 28 | Trayodashi |
| 14 | Chaturdashi | 29 | Chaturdashi |
| 15 | Purnima (full moon) | 30 | Amavasya (new moon) |
Why tithis have different lengths
The average tithi lasts about 23.6 hours (a synodic month of about 29.53 days divided by 30). Real tithis are often several hours shorter or longer, because the Moon's speed along its elliptical orbit changes through the month, and the Sun's apparent speed changes slightly through the year. A fast Moon covers 12° of elongation sooner; a slow Moon takes longer. Code that assumes a fixed length drifts quickly.
The sunrise rule
A tithi ends at one instant everywhere on Earth. To label a civil day, a panchang uses the tithi in effect at local sunrise. This is why the same instant can belong to different dates in different cities, and why the sunrise definition matters (see which sunrise?).
A hypothetical example, for illustration only: suppose a tithi ends at 05:30 UTC. In Delhi that is 11:00, after sunrise, so that day is labeled with the ending tithi. In New York during daylight time it is 01:30, before sunrise, so New York's day starts with the next tithi already in effect.
Skipped and repeated tithis
Because tithis and solar days have different lengths, they slip against each other:
- Kshaya (skipped) tithi: a short tithi starts after one sunrise and ends before the next. It is never in effect at sunrise, so no civil day carries its name at that location.
- Vriddhi (repeated) tithi: a long tithi is in effect at two consecutive sunrises, so two civil days carry the same name.
Both depend on sunrise, so a tithi can be skipped in one city and not in another. Displaying these days clearly is its own design problem; see skipped and repeated tithis in your UI.
Sunrise is not the only moment that counts
The sunrise rule names the day. Some festivals are fixed by the tithi at a different local moment, such as a window after sunset or around midnight. Those rules are festival-specific and are covered in why festival dates differ outside India.
What you need to compute it well
- Accurate Sun and Moon longitudes (a high-precision ephemeris, with ΔT handled).
- A root-finder to locate the exact instant elongation crosses each multiple of 12°.
- Local sunrise under a stated definition, for the user's coordinates.
- Timezone conversion through the IANA database, not fixed offsets.
If you want to build this yourself, our post on computing a panchang in Python walks through the code and the hard parts. The methodology page lists the conventions TithiKit will use.