Date Difference Calculator

The span between two dates is the difference in whole calendar days: 15 January 2026 to 20 March 2026 is 16 + 28 + 20 = 64 days, or 64 / 7 = 9.14 weeks, or 2 months and 5 days. Leap years add a 29th day to February, and the span excludes the end date, so add one day for inclusive counts.

Pick two calendar dates to see the exact span between them: total days, the same span in weeks, and a calendar breakdown into years, months and remaining days. The calculation runs in your browser and uses UTC-normalised dates, so daylight saving changes never add or subtract a phantom day.

Days between two dates

How the calculation works

The total-days figure divides the difference between the two dates, measured in milliseconds, by 86,400,000 — the number of milliseconds in one day. Both dates are first converted to midnight UTC, which removes any daylight saving offset and makes the answer stable regardless of the time zone set on your device. Weeks are simply total days / 7, shown to one decimal place.

The calendar breakdown is a separate calculation. It subtracts the year, month and day fields of the earlier date from the later one, then borrows when a field goes negative: a negative day count borrows the number of days in the preceding month, and a negative month count borrows twelve months from the year. This is why "2 months and 5 days" can correspond to a different number of total days depending on which months are crossed.

Worked example

Take 15 January 2026 to 20 March 2026. The remaining 16 days of January, all 28 days of February 2026 (not a leap year), and the first 20 days of March add up to 64 days. Dividing gives 64 / 7 = 9.14 weeks. The calendar breakdown is 2 months and 5 days, because 15 January to 15 March is two calendar months and five days remain until 20 March. A leap-year version, such as 15 January 2024 to 20 March 2024, would contain 29 days in February and therefore produce 65 days instead — the kind of detail that makes counting by hand unreliable.

Edge cases and conventions

If the end date is earlier than the start date, the tool swaps them and shows a positive span. Identical dates give 0 days, 0.0 weeks and a zero breakdown. The span excludes the end date: 1 January to 2 January is 1 day, so add one day yourself for inclusive counts such as hotel nights or notice periods. Only whole calendar days are used; entering a time of day is not supported by the date input. Results are not rounded except the weeks figure, which is shown to one decimal place.

Common uses

People use this to count down to a wedding or trip, measure employment tenure, check how many days remain before a visa or contract expires, work out interest periods on a loan, and track project timelines. For grade percentages and weighted course averages, use the grade percentage calculator instead.

Frequently asked questions

Does the result include the end date?

No. The result measures the span between two calendar dates, so the same start and end date gives 0 days and 1 January to 2 January gives 1 day. If you need an inclusive count for a hotel stay or a contract, add one day to the total.

What happens if I put the later date first?

The calculator swaps the two dates and reports the positive span, so the order of the inputs does not matter. The years, months and days breakdown is always computed from the earlier date forwards.

How are leap years and different month lengths handled?

The total-days figure comes from calendar dates normalised to UTC, so February has 29 days in a leap year and 28 otherwise, and daylight saving shifts cannot add or remove a day. The years/months/days breakdown borrows from the previous month when needed.

Are my dates uploaded anywhere?

No. Both dates are read in your browser and the calculation runs locally with JavaScript. Nothing is sent to a server or stored, and reloading the page clears the inputs.

Last updated: 2026-11-10