It comes from a calendar that tracks two clocks at once, the moon and the sun...

Diwali moves because it is set by the moon, not by the Gregorian calendar on your wall. Last year the main night fell on October 20, 2025. This year it lands on Sunday, November 8, 2026, almost three weeks later. Next year it swings back to 29 October 2027.
That zigzag is not random. It comes from a calendar that tracks two clocks at once, the moon and the sun, and has a clever trick for keeping them in step.
Diwali is fixed to a point in the moon's cycle: the new moon (Amavasya) of the month of Kartik, the darkest night of that lunar month. The whole idea of the festival, lamps lit against the darkest sky, depends on that timing. Shubh Panchang places Diwali 2026 on the night of Kartik Amavasya.
Hindu months are lunar. Each runs from one moon phase to the same phase again, roughly 29.5 days. So the question "When is Diwali?" really means "When is that particular new moon?" and the answer drifts against a solar calendar like the Gregorian one.
One naming quirk: some regional calendars end months at the full moon, others at the new moon. That's why the same night is called Kartik Amavasya in some almanacs and Ashwin Amavasya in others (Dekho Panchang). Different label, same moon.
Twelve lunar months add up to about 354 days. A solar year is about 365 days. Left alone, every festival would slide roughly 11 days earlier each year and eventually lap the seasons, Diwali would end up in summer.
The Hindu calendar is lunisolar, so it doesn't let that happen. About once every three years it inserts a whole extra month, called Adhik Maas, to pull the lunar year back in line with the sun. That's the same job a leap day does for the Gregorian calendar, just in a bigger chunk.
2026 was one of those years. An extra Jyeshtha month ran from 17 May to 15 June 2026, making this a 13-month year. Everything after it got pushed back by a month's worth of moon. That is why Diwali jumped from 20 October last year to November 8 this year.
The pattern is easy to see once you know it:
Ordinary years: Diwali comes about 11 days earlier than the year before.
After a leap month: it jumps about 19 days later.
The next three years follow the script. Diwali falls 10 days earlier in 2027 and another 12 days earlier in 2028. Then a leap month in 2029, sends it 19 days later again.
Even with the month settled, the exact day can be disputed. Hindu calendars count days in tithis, lunar days defined by the angle between the sun and moon. A tithi doesn't start at midnight. It can begin mid-afternoon and end the next evening, so the new-moon tithi often straddles two calendar days.
The main Diwali rituals happen in the early evening, just after sunset. So almanacs pick the date on which the new-moon tithi is in effect during that evening window. When it covers the evening on both days, or barely touches either, scholars and regions can disagree.
2024: The new moon began on the afternoon of October 31 and ended on the evening of 1 November. Most of India marked October 31, while some regions chose November 1.
2025: The tithi ran from 3:44 PM on October 20 to 5:54 PM on October 21, India time. As it began before sunset on the 20th, that became the main day.
2026: The same evening rule puts Diwali on November 8, even though new moon is still in effect at sunrise on November 9.