Skip to main content

Date difference calculator

Compare two dates and get the exact gap in years, months and days, the total number of days and the equivalent in weeks, with an option to include the end date.

  • Clipboard

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Was this tool useful?

How does this tool work?

This calculator measures the time between two dates: the gap in years, months and days, the total number of days and the equivalent in weeks and days. Use it for the length of a contract, a stay, a probation period or a project, for length of service, or for the time elapsed since an event. The order of the dates does not matter: if the end date comes first, the tool swaps them.

By default the tool counts like a stopwatch that starts on the first day and stops at the start of the last one: from Monday to Tuesday is 1 day. This is the convention of most date calculations (subtracting two dates in a spreadsheet, ISO 8601 durations).

Tick “Include the end date” when both dates count, as for a rental, a holiday or a school year “from 1 September to 30 June inclusive”: the tool then adds 1 day, which amounts to measuring up to the day after the end date.

The breakdown into years, months and days follows the calendar: the tool counts whole months from the start date, then the remaining days. If the start day does not exist in a month (the 31st in a 30-day month, 29 February in a common year), the whole month is reached on the last day of that month. The total number of days is exact and includes every 29 February crossed.

How to use this tool

  1. Enter the start date

    Type the date as month/day/year or pick it from the calendar.

  2. Enter the end date

    The order does not matter: the tool always returns a positive gap.

  3. Decide whether the end date counts

    Tick the option for an “inclusive” period, then read the duration, the total days and the weeks.

Working out the gap between two dates

The total in days and the calendar breakdown answer two different questions: “how many days?” and “how many years, months and days?”.

Total days

N = end date − start date (+ 1 if the end date is included)

Weeks and days

weeks = ⌊N ÷ 7⌋; remaining days = N − 7 × weeks

Whole months

M = largest integer such that start + M months ≤ end; years = ⌊M ÷ 12⌋

N
total number of days between the two dates
M
number of complete months within the period

Converting days into months by dividing by 30 or 30.44 is only an approximation; the calendar breakdown uses the real length of each month.

Use cases

Length of a contract or assignment

Find the exact length of a fixed-term contract, an internship or a probation period between its start and end dates.

Length of service or ownership

Measure service between a hiring date and a leaving date, or how long an asset was held between purchase and sale.

Stays and rentals

Count the days of a stay abroad, a rental or a custody period, end date included.

Time since an event

See how many days, weeks or months have passed since a past date: a wedding, a move or the founding of a company.

Examples

A school year, both dates included

Without the option the result is 9 months and 29 days, i.e. 302 days: the gap does not count 30 June itself.

Input

From 1 September 2026 to 30 June 2027
End date included

Result

10 months, 0 days
303 days · 43 weeks and 2 days

A simple gap

Five whole months lead to 15 June; from 15 June to 1 July there are 16 days left.

Input

From 15 January 2026 to 1 July 2026

Result

5 months, 16 days
167 days · 23 weeks and 6 days

Tips and best practices

  • For a legal or contractual deadline, check the counting rule that applies (first day excluded, business days only, roll-over to the next working day): this calculator counts calendar days.
  • To count weekdays only, use the business days calculator; to find the date reached after a duration, use the add or subtract time from a date tool.
  • For an age, the age calculator uses the same method and adds the date of the next birthday.
  • The calculation link keeps both dates and the option you chose, so the person you send it to sees exactly the same result.

Sources and references

Frequently asked questions

How many days are there between two dates?

Enter both dates and the total number of days appears straight away. By default it is the difference between the dates (from the 1st to the 2nd = 1 day). Tick “Include the end date” to count both ends (from the 1st to the 2nd = 2 days).

Should I include the first and last day?

It depends on what you are measuring. For elapsed time (age, length of service, an interval) the last day is not counted. For a period whose days are all used, such as a rental, leave or a stay, include it.

How are months of different lengths counted?

Months are counted date to date: from 15 January to 15 February is 1 month, whether February has 28 or 29 days. When the date does not exist (31 April), the month is reached on the last day of the month, then the remaining days are added.

Are leap years taken into account?

Yes. The total is calculated on the Gregorian calendar: from 1 January 2028 to 1 January 2029, for example, there are 366 days because 2028 is a leap year.

Can daylight saving time change the result?

No. The tool works with dates without times, so a day is always a day, even when the period crosses a clock change.

Can I calculate a duration in hours or minutes?

This calculator works to the day. For the gap between two times or two timestamps, use the time duration calculator.

Related tools

Tools similar or complementary to this one.

Similar tools

Count the business days between two dates and shift a date by a number of working days, for a Monday–Friday or other working week.

Dates & timeFeaturedUse this tool

Add or subtract days, weeks, months or years from a date and get the resulting date with its day of the week.

Dates & timeUse this tool

Calculate an exact age in years, months and days from a date of birth and any reference date.

Dates & timeFeaturedUse this tool