wid9et
Sign In
Calculators

How to Calculate the Difference Between Two Dates

Updated August 2026

Find out how date differences work, including elapsed days, inclusive counting, leap years and why calendar calculations can be surprisingly easy to get wrong.

What are you actually counting?

Before calculating the difference between two dates, decide whether you want elapsed time or an inclusive count of calendar dates. These can differ by one day.

For example, the elapsed time from 1 June to 2 June is one day, while counting both 1 June and 2 June as included dates gives two calendar dates.

Want to try the idea yourself? Use the Date Difference Calculator.

Why manual date counting gets tricky

Months do not all have the same length, February changes in leap years and a date range may cross a year boundary. A simple subtraction of day numbers only works when both dates are in the same month.

This becomes especially noticeable with long ranges such as contract periods, project timelines or countdowns.

If you want to explore this topic further, see How to Calculate Your Exact Age.

Years, months and days vs total days

A difference can be expressed as a total number of days or as calendar years, months and days. Those are different ways of describing the same span.

A total of 400 days, for example, does not translate into one fixed combination of years and months because the actual months crossed matter.

Useful Wid9et tools related to this guide

Leap years

A leap year adds 29 February, so ranges crossing that date contain an extra day. In the Gregorian calendar, years divisible by 4 are usually leap years, except century years unless they are also divisible by 400.

A date calculator can account for this automatically.

Use the Date Difference Calculator

Enter the start and end dates in the Date Difference Calculator to get the elapsed difference without manually counting month lengths.

For legal deadlines or contractual dates, check the specific counting rules that apply, because some rules include or exclude the starting or ending day.

Try it yourself

Ready to put this into practice? Open the relevant Wid9et tools directly in your browser.

Related guides