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
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.