Date Difference Calculator

Enter two dates and instantly get the exact number of days, weeks, months and years between them, calculated calendar-accurately. Alongside the plain day count, it also shows the inclusive count used for things like hospital stays or rental periods — where both the start and end date count as a full day — so you never have to wonder which convention applies.

Tips for date difference calculation

  • Put an upcoming event's date in "End date" to see exactly how many days remain until it. Use the "Use today" button to instantly fill the end date with today's date.
  • The "years, months, days" breakdown is calendar-accurate, not a rough estimate — for example, January 15 to March 20 is correctly shown as "2 months, 5 days" rather than a raw day count divided by 30.
  • When calculating a contract or project timeline, set the start date to the signing date and the end date to the deadline to see both the remaining period and the total duration at a glance.
  • Periods spanning a leap year (including February 29) are handled automatically, so you never need to double-check leap-year day counts by hand.
  • If you accidentally set the end date earlier than the start date, the tool automatically swaps them and shows a note so you don't need to fix it manually.

Frequently asked questions

The Age Calculator is specifically built to compute a person's current age from their birthdate. This tool is a general-purpose date-interval calculator where you can freely choose any start and end date, letting you measure any span of time — a countdown to an event, a project duration, and more — not just age.

The Time Calculator adds or subtracts hours, minutes and seconds within a single day (for example, adding 2 hours 15 minutes to 9:30). This tool instead measures the calendar interval between two dates in years, months, weeks and days. Use the Time Calculator if you need sub-day precision.

It won't produce an error. The tool automatically swaps the two dates internally, calculates the interval as an absolute value, and displays a note explaining that the dates were swapped, so you can use it confidently even if you're unsure which date comes first.

Yes. Periods that include February 29 are calculated correctly for days, months and years thanks to JavaScript's native date arithmetic. There's no need to manually check whether a leap year is involved.

"Total days" is the plain difference between the start and end date (the start date counts as day zero). "Inclusive days" adds 1 to that, counting both the start and end date as a full day — the convention used for hospital stays, rental periods, and tenure calculations. Neither is more "correct" than the other; use whichever matches your purpose.
Tool-kun

Side Note — the surprising pitfalls of counting days by hand

When people estimate the gap between two dates by hand, they often round a month to a flat 30 days. But real months range from 28 to 31 days, so estimating January 15 to March 20 as "64 days ÷ 30 ≈ 2.1 months" can drift from the calendar-accurate answer of "2 months and 5 days" — a difference that matters when it determines a contract deadline or an invoice due date. This tool instead compares year, month and day fields directly on Date objects, so it always returns a calendar-accurate breakdown.

Leap years aren't simply "every four years." Under the Gregorian calendar's leap year rule, a year divisible by 4 is a leap year, except that years divisible by 100 are not, unless they're also divisible by 400. The year 2000 was a leap year, but 1900 and 2100 are not. This exception is built into standard JavaScript date handling, and this tool relies on that same behavior.

There are two common conventions for counting elapsed days: an inclusive count that treats the start date as day one (so January 1 to January 10 is "10 days"), and a plain difference that only counts the gap ("9 days"). Which one you need depends on the purpose — hospital stays and rental periods typically use the inclusive count, while a simple elapsed-time estimate uses the plain difference. This tool shows both at once, so you don't have to convert between them yourself.