Date Difference Calculator

Free date difference calculator: find the exact number of days, weeks, hours, and approximate months and years between any two dates.

AI-ready Use this tool with AI

This tool has a free JSON API. Copy a prompt or skill below to use it with ChatGPT, Claude, or any AI agent — no API key needed.

API docs
Select both dates above.

How date difference calculator works

This calculator finds the exact difference between two dates. It parses both dates at midnight (00:00:00) and computes the difference in milliseconds, then converts to days by dividing by 86,400,000 (the number of milliseconds in a day). Weeks are the whole weeks within that span, with the remainder shown as extra days.

The total hours and minutes are also computed, useful for time-sensitive calculations like project deadlines or elapsed time. For longer spans, approximate years and months are derived from the day count using the average year length (365.25 days, accounting for leap years) and average month length (30.44 days).

The result works for dates in either order. If the end date is before the start date, the days value will be negative. This can be useful for counting down to a deadline (negative) or counting up from a past event (positive).

Frequently asked questions

How do I calculate days between two dates?
Enter both dates in the fields above and click Calculate. The result shows the exact number of days between them, plus weeks, hours, and approximate months and years.
Does this account for leap years?
Yes. The calculator uses actual calendar dates, so February 29 in a leap year is counted correctly. The day count is exact. It is the real number of midnights between the two dates.
What if the end date is before the start date?
The days value will be negative, showing the difference in reverse. This is useful for countdowns; a negative number means the date has already passed.
How are weeks calculated?
Weeks are the number of complete 7-day periods within the span. The remaining days are shown separately. For example, 23 days equals 3 weeks and 2 remaining days.