dash–calculator

04 Numbers and Counting

Days in a Year: 365 or 366 Explained

Readout 04-0381 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

There are 365 days in a common year and 366 days in a leap year. The extra day, February 29, is added every four years to keep our calendar aligned with Earth’s orbit around the Sun.

Formula

The number of days in a year depends on whether the year is a leap year. The rule is:

  • If the year is divisible by 4, it is a leap year (366 days).
  • Except if the year is divisible by 100, it is not a leap year (365 days).
  • Unless the year is also divisible by 400, then it is a leap year (366 days).

In symbols: Leap year = (year % 4 == 0 AND year % 100 != 0) OR (year % 400 == 0). If true, days = 366; otherwise days = 365. The calculator above uses this exact rule. The % symbol means “remainder after division.”

Worked Example

Let’s check the default year 2025.

  1. 2025 % 4 = 1 (not divisible by 4), so the first condition fails.
  2. 2025 % 100 = 25 (not divisible by 100), but that doesn’t matter because step 1 already failed.
  3. 2025 % 400 = 25 (not divisible by 400), so the second condition also fails.
  4. Therefore, 2025 is not a leap year. Days = 365.

The calculator shows “Leap year? = 0” and “Days in year = 365.” Correct.

Why We Have Leap Years

Earth takes about 365.2422 days (365 days, 5 hours, 48 minutes, 45 seconds) to orbit the Sun. That’s called a tropical year. If we ignored the fractional part, our calendar would drift: after 100 years, the seasons would shift by about 24 days. To fix this, the Julian calendar (introduced in 45 BC) added a leap day every 4 years. That gave an average year of 365.25 days, which was still slightly too long. By 1582, the calendar had drifted by about 10 days, prompting Pope Gregory XIII to introduce the Gregorian calendar, which we still use today. The Gregorian rule (divisible by 4, except centuries not divisible by 400) makes the average year 365.2425 days, very close to the true value.

How to Determine Leap Years

You can check any year with these steps:

  • If the year is divisible by 4, go to step 2. If not, it’s a common year (365 days).
  • If the year is divisible by 100, go to step 3. If not, it’s a leap year (366 days).
  • If the year is divisible by 400, it’s a leap year. Otherwise, it’s a common year.

Examples: 2024 is divisible by 4, not by 100, so leap year. 1900 is divisible by 4 and 100, but not by 400, so common year. 2000 is divisible by 400, so leap year.

Common Misconceptions

Many people think every year divisible by 4 is a leap year, but that’s only true for the Julian calendar. In the Gregorian calendar, century years (like 1700, 1800, 1900) are not leap years unless divisible by 400. That’s why 2000 was a leap year, but 2100 will not be. Another misconception is that a leap year adds a day to February every four years exactly. Actually, the rule skips three leap years every 400 years. Also, the extra day is not “added” to the calendar; it’s a correction for the fractional day in Earth’s orbit.

Why Not 365.25 Days?

If we used exactly 365.25 days, we’d have a leap year every 4 years without exception. That would be simpler, but it would add too much time. Over 400 years, the Gregorian calendar has 97 leap years (since 3 century years are skipped), giving 400 * 365 + 97 = 146,097 days. Dividing by 400 gives 365.2425 days per year. The actual tropical year is about 365.2422 days, so the Gregorian calendar drifts by only about 0.0003 days per year, or roughly one day every 3,300 years. Some proposals (like the Revised Julian calendar) refine this further, but the Gregorian is the global standard.

Other Calendars and Year Lengths

Not all calendars use 365 or 366 days. The Islamic (Hijri) calendar is lunar, with 354 or 355 days in a year. The Hebrew calendar is lunisolar, with 353 to 355 days in a common year and 383 to 385 days in a leap year (adding a 13th month). The Chinese calendar is also lunisolar, with 12 or 13 months. In astronomy, a sidereal year (time for Earth to orbit relative to fixed stars) is about 365.256 days, slightly longer than the tropical year. But for civil purposes, the Gregorian calendar’s 365/366-day cycle is what we use.

Frequently Asked Questions

How many days are in a leap year?

A leap year has 366 days. The extra day is added to February, making it 29 days instead of 28. Leap years occur in years divisible by 4, except century years not divisible by 400.

Is 2024 a leap year?

Yes, 2024 is divisible by 4 and not by 100, so it has 366 days. The next leap years are 2028, 2032, and 2036.

Why is February 29 added every four years?

It’s to compensate for the fact that Earth’s orbit takes about 365.2422 days, not exactly 365. Without adding a day, the calendar would drift out of sync with the seasons over time.

What happens if we don’t have leap years?

Without leap years, the calendar would lose about 6 hours each year. After 100 years, the seasons would shift by about 24 days. After 700 years, summer in the Northern Hemisphere would start in December.

Are there any exceptions to the divisible by 4 rule?

Yes, century years (like 1900, 2100) are not leap years unless they are divisible by 400. For example, 2000 was a leap year, but 2100 will not be.

How many days are in a year on other planets?

On Mercury, a year is about 88 Earth days. On Venus, about 225 Earth days. On Mars, about 687 Earth days. Jupiter’s year is about 4,333 Earth days. These are orbital periods, not calendar years.

Related

Formula used
in y | Year | - | 2025 | 1 | 9999
out leap | Leap year? | - | (y % 4 == 0 && y % 100 != 0) || y % 400 == 0 ? 1 : 0 | 0
out days | Days in year | - | ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) ? 366 : 365 | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More on this panel

The whole Numbers and Counting panel →