Date Difference Calculator

Enter two dates and instantly get the exact number of days, weeks, months and years between them, calculated calendar-accurately. Useful for counting down to an event, tracking elapsed time, or measuring a project duration.

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.

Rather than dividing the total day count by 30, the tool subtracts year, month and day fields on the calendar in order, borrowing the last day of the previous month whenever the day subtraction goes negative. This produces an accurate breakdown that respects each month's actual length.
ツールくん

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 includes both endpoints (e.g. "10 days" from January 1 to January 10), and a plain difference that only counts the gap ("9 days"). This tool uses the latter — a plain day difference — so if you want to count the start date as day one, simply add 1 to the displayed total.

→ Browse all trivia