Loading calculator...
- Enter a start date and an end date to see the gap in years, months and days.
- You also get the total in days, weeks, months and hours, plus the number of weekdays and weekend days in between.
- Turn on Count the end date too if you want both the first and the last day included.
- If the end date comes first, the calculator swaps the two dates for you.
How to use the date difference calculator
Enter the start date
Pick the earlier date. The calculator opens with 1 January of this year as the start.
Enter the end date
Pick the later date. It opens with today as the end date.
Choose whether to count the end date
Leave it off to get the plain gap between the dates. Turn it on to include the last day as well, which adds one day.
Read the result
See the difference in years, months and days, the total days, weeks and hours, and the weekdays and weekend days in the range.
How the difference between two dates is calculated
There are two ways to describe the gap between dates: as a plain count of days, or as years, months and days. The calculator gives you both.
Total days and weeks
Total days = end date − start date, counting every calendar day and every leap day
Weeks and days = total days ÷ 7, with the remainder shown as days
Hours = total days × 24
Turning on Count the end date too adds one day to the total.
Years, months and days
Add whole months to the start date until adding one more would pass the end date.
The days left over make up the day part of the answer.
If the start day does not exist in a month, the last day of that month is used. For example, 31 January plus one month lands on 28 February (29 in a leap year).
Because months have different lengths, the leftover days depend on which months fall in between.
A year is a leap year when it divides by 4, except century years, which must divide by 400. So 2024 and 2000 are leap years, while 1900 and 2100 are not. The calculator handles this automatically.
Worked examples
31 January to 1 March 2026
This is a case where the months do not line up neatly.
The total of 29 days is the same either way. Only the month-and-day wording depends on month lengths.
A project from 15 March to 30 June 2026
You want to know how long a project runs.
The weekday count does not remove public holidays. For that, use the Working Days Calculator.
Counting the end date
Take 5 October to 9 October 2026.
Use the counted version when both the first and the last day are part of the period, such as a five-day event running Monday to Friday.
Days in each month
Month lengths
Month lengths explain why the day part of a result changes from one pair of dates to another.
Four years in a row that include one leap year add up to 1,461 days.
Days between dates in Excel
You can find the days between two dates in Excel or Google Sheets with a simple formula. Put the earlier date in A1 and the later date in B1. Format the answer cell as a number, not a date.
Excel formulas for days between dates
Subtract: =B1-A1
DAYS: =DAYS(B1,A1)
DATEDIF days: =DATEDIF(A1,B1,”d”)
Full months: =DATEDIF(A1,B1,”m”)
Full years: =DATEDIF(A1,B1,”y”)
DATEDIF works even though Excel does not list it in the function menu. Its “md” option can give wrong results in some cases, so avoid it.
Excel example
A1 is 31 January 2026 and B1 is 1 March 2026.
The same answer as the calculator above, 29 days. For working days only, use NETWORKDAYS or the working days calculator.
Where a date difference calculator helps
Deadlines and planning
Count how long a project, sprint or campaign runs and how many weeks you have left.
Contracts and notice periods
Check the days between a start date and an end date for a lease, a warranty or a notice period.
Trips and events
Work out how long a holiday lasts or how many days remain until a trip.
Milestones and anniversaries
See how long it has been since a start date, in years, months and days.
Courts, contracts and visa rules sometimes count days in their own way, for example by leaving out the first day or by counting only business days. Check the rule that applies to you. For business days, try the Working Days Calculator.
Date difference calculator FAQ
How many days are there between two dates?
Enter the start date and the end date. The total days appear in the results. By default the end date is not counted, so 5 October to 9 October is 4 days.
Does the calculator count the end date?
Not by default. Turn on Count the end date too to include both the first and the last day, which adds one day to the total.
How are months counted when the days do not match?
The calculator adds whole months to the start date and uses the last day of a short month when needed. From 31 January to 1 March it shows 1 month and 1 day, because 31 January plus one month is 28 February.
Does it handle leap years?
Yes. Leap days are counted automatically for any years between 1000 and 9999.
Can I enter the later date first?
Yes. If the end date is before the start date, the calculator swaps them and tells you it did.
How do I count only weekdays or skip holidays?
The results show the weekdays (Monday to Friday) and weekend days in the range. To also skip public holidays, use the Working Days Calculator.