Date Difference Calculator

Get the precise difference between two dates as years/months/days plus total days and weeks.

How it is calculated

The two dates are put in order (the earlier one is always the start, so entering them backwards still works) and compared part by part: years = Ty − Fy, months = Tm − Fm, days = Td − Fd. A negative day difference borrows one month and counts the days from the same day of the month before; if that month is too short to have that day, it counts from its last day, so 31 January to 1 March is one month and one day; a negative month difference borrows one year. Besides this calendar breakdown the tool reports total days (real elapsed time, rounded down), total weeks (total days ÷ 7, rounded down) and total months (years × 12 + months). The start day counts as day zero, so the end date itself is not added in.

Worked example

From 2024-02-20 to 2025-04-05. Years: 2025 − 2024 = 1. Months: 4 − 2 = 2. Days: 5 − 20 = −15, so borrow a month: months = 1 and days = −15 + 31 (March has 31 days) = 16. The calendar difference is 1 year, 1 month and 16 days, which is 13 months in total. In days: 366 days to 2025-02-20 (the span contains 29 February 2024) plus 44 more gives 410 days, or 58 full weeks.

Try this example →

Common mistakes

  • Expecting the end date to be counted too. The result is the number of nights between the dates, so Monday to Tuesday is 1 day, not 2.
  • Adding the years/months/days figures to get the total number of days. Use the separate total days value, because months have different lengths.
  • Reading total months as an exact figure. It is whole months only; the remaining days are shown separately.
  • Worrying about the order of the dates. They are sorted automatically, so the result is never negative and cannot tell you which date is earlier.

About this calculator

This calculator measures the span between two chosen dates, expressing the result in days, weeks, months, or years as needed, and correctly accounts for varying month lengths and leap years along the way. Unlike a simple subtraction of numbers, calendar math has enough irregularities that a dedicated calculator avoids common counting mistakes.

It's used for project planning and deadline tracking, working out how many days remain until an event, checking a contract or notice period length, or figuring out how long ago something happened. It's also a common building block behind other date-based calculators, like age or pregnancy timelines.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    The result counts the gap between two dates and does not count the end day. From 1 January to 10 January it shows 9 days. For rental nights that is right, but for leave days, project days or an inclusive deadline you usually add 1. The years, months and days breakdown borrows days from the month before the later date, so for contracts, rely on the total days line. Which counting rule does your case need, inclusive or exclusive?

Popular calculators

All Calculators