Date Difference

Calculate days, weeks, months, and more between any two dates.

What It Does

This calculator computes the exact difference between two calendar dates, breaking it down into days, weeks, months, and years. It handles leap years, varying month lengths, and cross-year spans automatically. Enter a start date and an end date, and get an instant breakdown of the duration in multiple units.

Common Use Cases

  • Project deadlines — How many days until a sprint ends or a launch date?
  • Age calculation — How many days, months, and years since a birthdate?
  • Contract duration — How long is a 6-month contract starting March 15?
  • Event countdowns — How many days until a wedding, flight, or exam?
  • Billing periods — Verify subscription lengths or invoice periods
  • Travel planning — How long is a visa-free stay in days?

How Date Arithmetic Works

The calculator converts both dates to Unix timestamps (milliseconds since January 1, 1970), subtracts them, and converts the result into meaningful units:

  • 1 day = 86,400,000 milliseconds
  • 1 week = 7 days
  • Months and years are calculated by walking the calendar, not by fixed multipliers, to handle varying month lengths correctly

Tips

  • For "how old am I?" calculations, use today as the end date and your birthdate as the start
  • For contract end dates, add the contract length to the start date rather than calculating a difference
  • Timezone differences can affect date calculations when crossing midnight — this tool uses local browser time

Frequently Asked Questions

Does the calculator include or exclude the start and end dates?
By default, the difference is calculated exclusive of both endpoints — it counts the number of full calendar days between the two dates. For example, from January 1 to January 3 gives 2 days. If you need to include the end date (e.g., for billing periods), add 1 to the result.
How are months counted when months have different lengths?
Month differences are calculated by counting calendar months, not 30-day blocks. From January 31 to March 31 is exactly 2 months. From January 31 to March 30 is 1 month and 28 or 29 days depending on whether it's a leap year.
Does the tool account for leap years?
Yes. The underlying date arithmetic uses the JavaScript Date object, which correctly handles leap years. A year with 366 days is automatically accounted for when calculating differences that span February 29.
Can I calculate how many business days (weekdays) are between two dates?
The calculator shows total calendar days. To count only business days, subtract the number of weekend days (Saturdays and Sundays) in the range. A rough estimate: total days × (5/7). For exact counts, a dedicated business-day calculator or a library like date-fns is recommended.
What is the difference between duration in days versus months and years?
Days give you a precise count — useful for deadlines and billing. Months and years give you a human-friendly approximation — useful for age, anniversaries, or contract terms. A difference of 365 days is approximately 12 months, but not exactly, since months vary in length.