Date Difference Calculator

Finding the number of days, weeks, months, or years between two calendar dates is a surprisingly common need: calculating contract durations, determining how long until a deadline, figuring out how many days an event lasted, or checking whether a warranty or subscription period has expired. Simple subtraction fails because months and years have different lengths, and leap years create irregular day counts. The correct approach is to work from the Gregorian calendar definition directly, counting day by day from the start date to the end date (exclusive or inclusive of endpoints depending on context) to get the total calendar days, then deriving other units from that count. This calculator accepts a start date and an end date and returns the difference expressed in total calendar days, total weeks plus any remaining days, an approximate number of months based on the standard average month length of 30.4375 days, an approximate number of years, and an exact breakdown as years, months, and days calculated month by month. The exact breakdown uses the same convention as age calculations: months increment when the day-of-month in the later date reaches or passes the day-of-month in the earlier date. The default reference date is today, making it straightforward to answer the question "how many days until" or "how many days since" a given date.

-- days between -- and --.

That is -- weeks, -- months, or -- years (approximate).

Earlier date
Later date
Total days--
Total weeks and days--
Total weeks--
Total months (approx.)--
Total years (approx.)--
Exact breakdown--

How date differences are calculated

The calculator computes the difference in milliseconds between two dates, then converts to days, weeks, months, and years. Month and year calculations use average values (30.4375 days per month, 365.25 days per year) to account for varying month lengths and leap years.

Total days = (end date - start date) / milliseconds per day
Total weeks = Total days / 7
Total months = Total days / 30.4375
Total years = Total days / 365.25

Worked example

From 1 January 2026 to 30 June 2026:

  1. Total milliseconds = 181 days * 86,400,000 ms/day
  2. Total days = 181
  3. Total weeks = 181 / 7 = 25.86 weeks
  4. Total months = 181 / 30.4375 = 5.94 months
  5. Total years = 181 / 365.25 = 0.495 years

Using date differences for planning

Calculating the time between dates is useful for project timelines, event planning, milestone tracking, and deadline management. For example, if a project starts on 1 January and must finish by 30 September, the calculator shows 273 days to plan and execute.

Date difference calculator: frequently asked questions

How is the difference between dates calculated?

The calculator subtracts the start date from the end date. It counts all calendar days between them, including the start and end dates. For example, from 1 January to 3 January is 3 days (1st, 2nd, 3rd).

What is the difference between calendar days and business days?

Calendar days count every day, including weekends and holidays. Business days typically count only Monday through Friday, excluding weekends and public holidays. This calculator shows calendar days; use the working days calculator to exclude weekends.

How accurate is the month and year calculation?

The calculator approximates months using 30.4375 days per month (365.25 / 12). This average accounts for varying month lengths and leap years. For exact month-level differences, use the age calculator instead, which accounts for actual calendar months.

Can I calculate how many days from now until a future date?

Yes. Set the start date to today and the end date to your target date. The calculator shows how many days remain.

Does the calculator account for leap years?

Yes. The JavaScript Date object handles leap years automatically. A year divisible by 4 is a leap year, except century years (divisible by 100) unless also divisible by 400.

What if I want to count only weekdays?

Use the working days calculator instead. It lets you exclude weekends and add custom holiday dates.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 13 June 2026. See our methodology.