Skip to main content

Date Difference Calculator

Calculate years, months, days, and totals between any two dates.

Written by Golam Rabbani, Founder & Lead Engineer

How to use this date difference calculator

  1. Pick a start date in the first field.
  2. Pick an end date in the second field.
  3. Press Calculate to see the difference in years, months, and days.
  4. Read the secondary breakdown for total days, weeks, and hours.
  5. Use Copy to put the headline on your clipboard, or Reset to start over.

About this date difference calculator

The date difference calculator finds the gap between any two calendar dates and presents it in human-friendly units: years, months, days, total days, total weeks, and total hours. Everything runs locally in your browser against the date values you type, so the result is identical no matter where you are or what time it is.

Behind the scenes the tool builds two local Date objects (using the year/month/day fields directly, not parsing the ISO string as UTC) and walks the calendar from the earlier date to the later one. It first counts whole years, then borrows a month when the end day-of-month is earlier than the start day-of-month, then borrows a year when the end month is earlier than the start month. That borrowing logic is the same one used by official forms and tenancy contracts, which is why the day component varies between 28 and 31 depending on the month it borrows from.

For example, 2020-02-29 to 2026-05-28 returns 6 years, 2 months, 30 days — a total of 2,280 days and 325 weeks. Use it for project timelines, contract durations, or working out exactly how long it has been since a memorable date. The tool ignores DST because it works in whole-day units, so a difference of "10 days" always means 10 calendar days.

FAQ

Does the start date have to be before the end date?
No. If you reverse them the calculator detects it and shows the absolute difference with a note that the dates were reversed.
Why does the day count change between months?
When the end day-of-month is earlier than the start day-of-month, the calculator borrows the number of days from the previous month — which is 28, 30, or 31 depending on the month. This matches how official age and tenure calculations work.
Does it count the start and end dates themselves?
The difference shown is exclusive of the start date and inclusive of the end date — i.e. it is the count of full calendar days between them. If you need to count both endpoints, add one to the total.
How does it handle leap years?
Native JavaScript dates handle leap years and leap days correctly, so 2020-02-29 to 2024-02-29 returns exactly four years, zero months, zero days.
Is the calculator free?
Yes. It runs entirely in your browser, with no signup, no rate limit, and no data sent to a server.