How it works
Pick two dates and the calculator counts the calendar days from one to the other. The start date counts and the end date doesn’t, the same way you’d say Monday to Friday is 4 days later. If you want both dates counted, for a hotel booking, a holiday, or an event that runs through its last day, choose “Yes (count both dates)” and 1 day is added.
It also gives the same span in years, months, and days, in whole weeks, and split into weekdays (Monday to Friday) and weekend days. You can enter the dates in either order. Only calendar dates are used, never times, so time zones and daylight saving changes can’t shift the answer by a day.
The formula
Days between two dates = later date − earlier date, counting the earlier date but not the later one.
To work it out by hand, use the day of the year, where January 1 is day 1 and December 31 is day 365 (or 366 in a leap year):
days = day of the year of the later date + days in the years between − day of the year of the earlier date
- Day of the year: add up the days in the months before the date’s month, then add the day of the month. March 15 is 31 + 28 + 15 = day 74 (day 75 in a leap year).
- Days in the years between: every whole year from the earlier date’s year up to, but not including, the later date’s year. Each has 365 days, plus 1 for each leap year. Leave this out when both dates are in the same year.
- Counting both dates: add 1.
A leap year is a year divisible by 4, except years divisible by 100, unless they’re also divisible by 400. So 2000 was a leap year and 2100 won’t be.
Weekdays are counted in blocks of 7 days, since every 7 days in a row hold exactly 5 weekdays and 2 weekend days. The few days left over are checked one by one. Public holidays aren’t taken out, because they differ from country to country.
Worked example
Want this with your own numbers? See Show the work above.
How many days are there from March 15, 2026 to October 2, 2027?
- First date: January and February have 31 + 28 = 59 days, so March 15, 2026 is day 59 + 15 = 74 of 2026.
- Second date: January to September 2027 have 273 days, so October 2, 2027 is day 273 + 2 = 275 of 2027.
- Years between: just 2026, which has 365 days.
- Days between: 275 + 365 − 74 = 566 days.
That’s 80 weeks and 6 days, or 1 year, 6 months, and 17 days. March 15, 2026 is a Sunday, so the 80 whole weeks hold 400 weekdays, and the 6 days left over (Sunday to Friday) add 5 more: 405 weekdays and 161 weekend days.
Counting both dates gives 567 days, exactly 81 weeks.
FAQ
Does the count include the start and end dates?
By default it counts the start date but not the end date, so from today to tomorrow is 1 day. That’s how most date math works, including spreadsheet subtraction. If you need both dates counted, say for the days of a trip including the day you leave and the day you come back, choose “Yes (count both dates)” and the answer goes up by 1.
How do I count the days between two dates in Excel or Google Sheets?
Subtract the earlier date from the later one, for example =B1-A1, or use =DAYS(B1, A1), with the later date in B1. Either gives the same answer as this calculator with “No” chosen (if the answer shows as a date, format the cell as a number). Add 1 if you want both dates counted. In Excel this works for dates from March 1, 1900 on: Excel’s dates start on January 1, 1900, and it treats 1900 as a leap year, though it wasn’t one.
How many days are there in a year?
365, or 366 in a leap year. Leap years come almost every 4 years: 2024 and 2028 are leap years, but 2100 won’t be, because years ending in 00 are leap years only when they divide by 400.
Does it count business days?
It counts weekdays, Monday to Friday, which is the same as business days when there are no public holidays in the range. Holidays differ by country, region, and year, so take out any that apply to you. The weekday count assumes a Saturday and Sunday weekend, so it doesn’t fit places where the weekend falls on other days, such as Friday and Saturday.
Why is the answer in months different from what I expected?
Months have different lengths, so the years, months, and days are counted like an age: whole months first, each ending on the same day of the month as the start date, then the days left over. If the start date is the 31st and a month is shorter, the month ends on its last day instead. So January 31 to March 1, 2027 is 1 month and 1 day.
Can I enter the dates in either order?
Yes. If the end date comes first, the calculator counts from it to the start date, and the answer is the same as with the dates swapped.
Sources
- Days between two dates: Microsoft Support, DAYS function
- Weekdays between two dates, counting both: Microsoft Support, NETWORKDAYS function
- Complete years and days between two dates: Microsoft Support, DATEDIF function
- Excel’s first date, January 1, 1900: Microsoft Support, DATE function
- Excel treating 1900 as a leap year: Microsoft Learn, “Excel incorrectly assumes that the year 1900 is a leap year”
- Years, months, and days, and the month-end rule: dateutil documentation, relativedelta examples
- Counting days between dates: Python documentation, datetime module
- Day counts and weekdays from the Julian Day: Jean Meeus, Astronomical Algorithms, 2nd edition, chapter 7
Cite this page
APA (7th edition)
Mathlark. (2026, October 2). Days between dates calculator. https://mathlark.com/everyday/days-between-dates-calculator/
MLA (9th edition)
"Days Between Dates Calculator." Mathlark, 2 Oct. 2026, mathlark.com/everyday/days-between-dates-calculator/.