Years Between Two Dates Calculator

Years Between Two Dates Calculator

Leading AI Skill PRO

Enter Calculation

Formula

Years=End date−Start date365.25\text{Years} = \frac{\text{End date} - \text{Start date}}{365.25}
Usage stats

Advertisement

Results

Years, months and days
20 yr 0 mo 0 d
Whole years 20
Decimal years 20
Total days 7,305

January 2000

Sun Mon Tue Wed Thu Fri Sat
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

January 2020

Sun Mon Tue Wed Thu Fri Sat
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

Report an error on this page

What This Calculator Does

The Years Between Two Dates Calculator tells you how many years separate any two calendar dates. Enter a start date and an end date, and it returns the elapsed time as a decimal number of years, along with the total number of days. This is handy for working out ages, anniversaries, service lengths, project durations, or any span where a precise year count matters.

How to Use It

Pick your earlier date in the "Start date" field and your later date in the "End date" field. The tool computes the difference and divides by 365.25 — the average length of a year that accounts for leap years occurring roughly every four years. If the end date is earlier than the start date, the result will be negative.

The Formula Explained

The calculation is straightforward: $$\text{years} = \frac{\text{date2} - \text{date1}}{365.25}$$ First the two dates are converted to a number of days apart, then those days are divided by 365.25. Using 365.25 rather than 365 keeps long spans accurate because it averages in the extra leap day, so a 4-year gap returns very close to 4.00 instead of drifting.

Advertisement
Timeline showing two dates with the span between them divided by 365.25 to get years
The number of days between the two dates is divided by 365.25 to convert to years.

Worked Example

Suppose the start date is January 1, 2000 and the end date is January 1, 2020. That span includes 7,305 days (20 years with 5 leap days). Dividing 7,305 by 365.25 gives exactly 20 years, as expected.

$$\text{years} = \frac{7305}{365.25} = 20$$
Two calendar icons connected by an arrow with a result badge for years elapsed
A worked example: pick a start and end date to find the years elapsed.

Year Spans Across Common Scenarios

Every row below is computed the same way the calculator computes it: the elapsed days are the end date minus the start date (endpoints subtracted, not inclusive), and the decimal year value is those days divided by the Julian year of 365.25 days, \( \text{Years} = \dfrac{\text{elapsed days}}{365.25} \). The last two columns show how that decimal compares with counting whole calendar anniversaries, which is how ages and service dates are normally expressed.

Start date End date Total days Years (days ÷ 365.25) Exact calendar years Difference
2000-01-01 2020-01-01 7305 20.0000 20 y 0 days — the span contains 5 leap days (2000, 2004, 2008, 2012, 2016), so 20 × 365 + 5 = 7305 = 20 × 365.25 exactly
1990-06-15 2026-06-15 13149 36.0000 36 y 0 days — 36 × 365 + 9 leap days = 13149 = 36 × 365.25
2001-09-11 2026-09-11 9131 24.9993 25 y −0.25 day — 25 × 365 + 6 leap days = 9131, while 25 × 365.25 = 9131.25
2020-02-29 2021-02-28 365 0.9993 1 y (a 29 February anniversary is usually taken as 28 February in a common year) −0.25 day; a one-calendar-year span is 365 or 366 days, i.e. 0.9993 or 1.0021 decimal years
2024-01-01 2024-12-31 365 0.9993 0 y 0 y + 365 d — the 2025-01-01 anniversary has not been reached, so no full calendar year has elapsed
2023-03-01 2026-08-15 1263 3.4579 3 y 3 y 5 mo 14 d — the 0.4579 fraction is \( 0.4579 \times 365.25 \approx 167 \) days

Note the pattern in the first two rows: because 365.25 is exactly the average length of a four-year leap cycle, spans that are a whole multiple of four years (and contain the matching number of 29 February dates) come out as exact whole numbers. Spans such as 25 years, which contain six leap days rather than 6.25, land a fraction of a day short.

Interpreting Your Result

The whole part and the decimal part. The integer part of the answer is the number of full 365.25-day years contained in the span; the decimal part is the leftover fraction of such a year. To convert that fraction back into days, multiply it by 365.25:

$$ \text{Remaining days} = \text{decimal part} \times 365.25 $$

So 0.5 years corresponds to \( 0.5 \times 365.25 = 182.625 \) days, 0.25 years to about 91.3 days, and a result of 3.4579 years means 3 years plus \( 0.4579 \times 365.25 \approx 167 \) days.

Elapsed time, not a calendar-year difference. The calculator subtracts one date from the other; it does not subtract one year number from another. From 2023-12-31 to 2024-01-01 the difference is 1 day, or \( 1 \div 365.25 \approx 0.0027 \) years — not 1 year, even though the year label changes. Likewise, 2024-01-01 to 2024-12-31 is 365 days (0.9993 years), not a full year.

Drift against exact calendar counting. The divisor 365.25 days is the mean length of a four-year Gregorian leap cycle, so within any such cycle the decimal result differs from exact calendar-date counting by less than about one day: a span of exactly one calendar year is 365 or 366 real days, giving 0.9993 or 1.0021 decimal years. Over much longer spans a second, smaller drift appears, because the Gregorian mean year is 365.2425 days rather than 365.25 — a gap of 0.0075 day per year, or roughly three quarters of a day per century, showing up only around skipped leap years such as 1700, 1800, 1900 and 2100.

Why 17.998 can still be 18 full years. Age, length of service, insurance terms and legal anniversaries are normally counted by exact calendar date — a person turns 18 on the date the eighteenth birthday is reached, regardless of how many days that took. A decimal result of 17.998 or 24.9993 therefore commonly corresponds to a completed 18th or 25th anniversary. Read the decimal figure as a measure of elapsed duration and the anniversary count as the legal or administrative one; the exact rules for anniversaries (including how a 29 February date is treated in a common year) are set by national law and differ between countries.

Sign convention. If the end date is earlier than the start date, the difference is negative and the result carries a minus sign — that simply indicates the two dates were entered in reverse order. The magnitude is unchanged: 2026-08-15 to 2023-03-01 gives −1263 days and −3.4579 years.

What is not included. Because the two endpoints are subtracted, the count is exclusive: 1 June to 5 June is 4 days, not 5. If you need inclusive day counting (counting both the first and last day, as some rental, hospital-stay or notice-period rules require), add 1 to the day total yourself. The calculator also works with whole calendar dates only, so times of day, time zones, daylight-saving transitions and leap seconds have no effect on the result. Dates are handled on the Gregorian calendar; for dates before its adoption (1582 in some countries, as late as 1752 in Britain and its colonies, 1918 in Russia) the historical local calendar may differ from the Gregorian dates used here.

Advertisement

Definitions & Glossary

Term Definition
Start date The earlier endpoint of the span, entered in the date1 field. It is the date subtracted from the end date, and it is not itself counted as an elapsed day.
End date The later endpoint of the span, entered in the date2 field. Entering a date earlier than the start date is allowed and produces a negative result.
Elapsed days The plain difference \( \text{date2} - \text{date1} \) measured in whole days. This is the raw quantity the calculator reports alongside the year figure, and every other output is derived from it.
Decimal year The elapsed days expressed as a fraction of a year, \( \text{days} \div 365.25 \). The fractional part can be turned back into days by multiplying by 365.25.
Julian year (365.25 days) A fixed year length of exactly 365.25 days, the mean year of the old Julian calendar and the constant this calculator divides by. It is also the standard year unit in astronomy, where the light-year is defined using it.
Leap year In the Gregorian calendar, a year divisible by 4 is a leap year of 366 days, except centurial years, which must also be divisible by 400 — so 2000 was a leap year while 1900 and 2100 are not. Leap days are what make real spans 365 or 366 days long rather than a constant.
Mean tropical year (~365.2422 days) The average interval between successive equinoxes, about 365.2422 days — the astronomical quantity that calendars try to approximate. It is roughly 11 minutes shorter than the 365.25-day divisor used here.
Gregorian mean year (365.2425 days) The average civil year length produced by the Gregorian leap rule (146 097 days per 400 years). It is 0.0075 day shorter than the Julian year, which is the source of the small long-term drift between this calculator's decimal result and exact calendar counting.
Calendar-year (anniversary) counting Counting complete years by whether the same month-and-day has been reached again, rather than by dividing days. It is the method normally used for age, length of service, tenancy terms and legal deadlines, and it can differ from the decimal result by a fraction of a year.
Inclusive vs exclusive day counting Exclusive counting reports the gap between two dates (1 June to 5 June = 4 days) and is what this calculator does; inclusive counting counts both endpoints (= 5 days) and is used for things like billed nights, notice periods or event durations. Convert between them by adding or subtracting 1.
Negative result Output shown with a minus sign because the end date precedes the start date. The magnitude is still the correct elapsed span; swapping the two entries removes the sign.

Conventions and edge cases

Each case below was run through this calculator; the result column is what it actually returns.

CaseInputResultNote
1 to 31 January2025-01-01 → 2025-01-3130 daysThe start date is not counted.
29 February to 28 February of a common year2000-02-29 → 2025-02-2824 years, 11 months, 30 days
Across 29 February 20242024-02-28 → 2024-03-012 days
End date before start date2025-03-31 → 2025-01-01−89 daysShown as a negative number of days.
Same start and end date2025-03-10 → 2025-03-100 days

Checked on 2026-11-08

FAQ

Why divide by 365.25 instead of 365? Because leap years add an extra day about once every four years. 365.25 is the average year length and gives more accurate results over multi-year spans.

Can I get a negative answer? Yes. If the end date comes before the start date, the result is negative, indicating the dates are reversed.

Is this exact calendar-year counting? It is an average-based estimate. For legal age calculations that count exact calendar years, results may differ by a fraction of a year, but for most purposes this is precise enough.

Last updated:

Most popular in Time and Date

View all Time and Date calculators