dash–calculator

04 Numbers and Counting

Days in a Year: Exact Count and Why It Varies

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

Total days 365 days
Leap years in that span
0
Result, rounded to a whole number
Years to check
1 years
Input
You enter
Years to check (years)
You get
Total days (days), Leap years in that span
Rounding
0 dp

A common year has exactly 365 days, and a leap year has exactly 366 days. The average length of a year over a full 400-year cycle is 365.2425 days, which is why we add an extra day every four years (with a few exceptions).

Formula

The calculator above counts the number of days in a whole number of years, applying the Gregorian calendar rules. The formula is:

Total days = Y × 365 + ⌊Y/4⌋ − ⌊Y/100⌋ + ⌊Y/400⌋

  • Y = number of years (whole years, starting from year 1)
  • ⌊ ⌋ = floor function, meaning round down to the nearest whole number
  • Y × 365 = base days if every year had 365 days
  • ⌊Y/4⌋ = add one day for every leap year (divisible by 4)
  • − ⌊Y/100⌋ = remove the leap day from century years (divisible by 100)
  • + ⌊Y/400⌋ = add back the leap day for years divisible by 400

This is the exact rule used by the Gregorian calendar, which most of the world uses for civil purposes. The floor function is necessary because you cannot have a fraction of a day when counting whole years.

Worked Example

Using the default value of 1 year from the calculator:

  1. Start with the base: 1 × 365 = 365 days
  2. Add leap years: ⌊1/4⌋ = 0 (no leap year in a single year unless it is divisible by 4)
  3. Subtract century years: ⌊1/100⌋ = 0
  4. Add 400-year years: ⌊1/400⌋ = 0
  5. Total: 365 + 0 − 0 + 0 = 365 days

If you enter 4 years, the calculation becomes: 4 × 365 = 1460, plus ⌊4/4⌋ = 1, minus 0, plus 0, giving 1461 days. That matches the fact that a 4-year span containing one leap year has 1461 days.

Why 365 Days and Not 360 or 400?

The number 365 comes from the time Earth takes to orbit the Sun once, called a tropical year. That period is about 365.2422 mean solar days. Ancient calendars, like the Egyptian civil calendar, used exactly 365 days, which drifted against the seasons by about one day every four years. The Julian calendar, introduced in 45 BCE, added a leap day every four years, giving an average year of 365.25 days. That was closer but still about 11 minutes too long, causing a drift of one day every 128 years.

The Gregorian calendar, introduced in 1582, refined the rule by dropping leap days from century years not divisible by 400. This reduced the average year to 365.2425 days, which is accurate to within about one day every 3,300 years. That is why the rule has three parts: divisible by 4, except centuries, except every 400th century.

Leap Year Rules in Detail

The exact rule for whether a specific year is a leap year is:

  • The year is divisible by 4 and not divisible by 100, or
  • The year is divisible by 400

So 2024 is a leap year (divisible by 4, not by 100). 1900 is not a leap year (divisible by 100 but not by 400). 2000 is a leap year (divisible by 400). This means the year 2000 had 366 days, while 1900 had 365. The next century year that is a leap year will be 2400.

If you are counting days across a long period, you cannot simply multiply the number of years by 365.25. You must apply the full rule. For example, from year 1 to year 100, there are 24 leap years (every 4th year up to 100), but the year 100 is not a leap year, so the count is 100 × 365 + 24 = 36,524 days. The formula in the calculator handles this automatically.

Common Mistakes When Counting Days

The most frequent error is assuming every fourth year is a leap year without checking the century rule. For example, the period from 1897 to 1903 includes the year 1900, which is not a leap year. A simple “add 1 for every 4 years” approach would overcount by one day.

Another mistake is mixing the Julian and Gregorian calendars. Historical dates before 1582 in many European countries used the Julian calendar, which has a different leap year rule (every year divisible by 4 is a leap year). If you are calculating days for a historical event before 1582, you need to specify which calendar you are using. The calculator above assumes the Gregorian calendar throughout.

A third error is forgetting that the count of days in a span of years depends on whether you count both endpoints. If you ask “how many days from January 1, 2020 to January 1, 2021,” that is 366 days because 2020 is a leap year. But if you ask “how many days in the year 2020,” that is also 366. The formula works for whole years starting at year 1, so entering 2020 gives the total days from year 1 through year 2020, not the days in just 2020.

Why the Average Year Is 365.2425 Days

The Gregorian calendar’s average year length comes from the pattern of leap years over a 400-year cycle. In 400 years, there are:

  • 100 years divisible by 4
  • Minus 4 century years (100, 200, 300, 400) – but 400 is divisible by 400, so it stays a leap year
  • So 97 leap years in 400 years

Total days = 400 × 365 + 97 = 146,097 days. Divide by 400 = 365.2425 days per year on average. This is the figure used in many financial calculations, such as bond interest, where a “year” is defined as 365.2425 days. However, for everyday purposes, you use either 365 or 366 depending on the specific year.

Some contexts use a simplified 360-day year (common in some financial formulas) or 365.25 days (the Julian average). Always check which convention a formula expects before using it.

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 every 4 years, except for century years not divisible by 400. So 2024, 2028, and 2032 are leap years, but 2100 will not be.

Why do we have leap years at all?

Because Earth’s orbit around the Sun takes about 365.2422 days, not exactly 365. If we never added a leap day, the calendar would drift: after 100 years, the seasons would shift by about 24 days. Leap days keep the calendar aligned with the equinoxes and solstices.

Is 2000 a leap year?

Yes. 2000 is divisible by 400, so it is a leap year despite being a century year. It had 366 days. The year 1900 was not a leap year, and 2100 will not be one either.

How many days are in a year on other planets?

A year is defined as one orbit around the Sun. Mercury has about 88 Earth days in its year, Venus about 225, Mars about 687, Jupiter about 4,333, and Saturn about 10,759. These are Earth days, not the planet’s own days.

What is the difference between a solar year and a calendar year?

A solar (tropical) year is the time between two successive spring equinoxes, about 365.2422 days. A calendar year is the civil year we use, which is 365 days in a common year or 366 in a leap year. The calendar is designed so its average matches the solar year closely.

How many days are in a year if you count weekends only?

In a common year of 365 days, there are 52 weeks plus 1 extra day, so there are 52 or 53 Saturdays and 52 or 53 Sundays, depending on the year’s start day. The total weekend days are either 104 or 105. In a leap year, the extra day can add one more weekend day, making it 105 or 106.

Related

Formula used
in y | Years to check | years | 1 | 1 | 4000
out days | Total days | days | y * 365 + floor(y / 4) - floor(y / 100) + floor(y / 400) | 0
out leap | Leap years in that span | - | floor(y / 4) - floor(y / 100) + floor(y / 400) | 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 →