Date difference calculator

Calculate the difference between two dates in years, months and days, plus the total days and weeks.

Required fields are marked with an asterisk (*).

The first date of the span.
The last date of the span; it must be on or after the start date.

The date difference calculator works out the span between two dates two ways: a calendar breakdown into years, months and days, and an exact total of days and weeks. The calculation is Gregorian throughout.

Formula

Span = the calendar difference (years, months, days), and total days = the actual day difference between the dates.

When is this useful?

Use it to count a contract period, a product’s validity, the time between occasions, or how many days remain to an important date.

Worked example

Example using the calculator’s values: 2020-01-01 to 2024-01-01.
The span is 4 years.
Total days 1,461 (2020 is a leap year), i.e. 208 weeks.

Assumptions

  • The calculation is Gregorian only.
  • The end date is inclusive: the last day counts within the span.
  • The years/months/days breakdown is calendar-based, not a fixed day count.
  • The days row is the residue after full months, not the total days.

Common mistakes

  • Reversing the two dates — the calculator blocks it with an error.
  • Expecting the days row to equal total days; the days row is the residue after full months.
  • Mixing Hijri and Gregorian dates.

Frequently asked questions

Is the end date included?

Yes. The difference is computed so that the end date’s day counts within the span (differences between local midnights).

How are differing month lengths handled?

The calculation is calendar-based: it adjusts automatically for months of different lengths and for leap years.

Methodology and review

The calculator computes the full day difference across local midnights, then breaks the span into years, months and days respecting month lengths and leap years.

Results are in the Gregorian calendar; some legal systems count day differences slightly differently.