How to Calculate Days Between Two Dates (With Examples)
Table of Contents ▼
To calculate the days between two dates, count the whole days from the first date to the second, without counting the first date. For dates in the same month, subtract the day numbers. For dates in different months, count the days left in the first month, add the full months in between, then add the day number of the final month. This guide walks through both methods with worked examples, explains inclusive and exclusive counting, and shows how leap years change the answer.
If the first date is a birthday, you can skip the arithmetic: our age in days calculator gives the exact number of days someone has been alive. For the difference between two people’s ages, use the age difference calculator.
The quick method for dates in the same month
When both dates are in the same month and year, subtract the smaller day number from the larger.
- From 3 November to 19 November: 19 − 3 = 16 days.
- From 1 October to 31 October: 31 − 1 = 30 days.
This is exclusive counting: it tells you how many days pass, or how many nights you sleep, between the two dates.
The method for dates in different months
When the dates are in different months, break the span into three parts.
- Days left in the first month: days in that month minus the start day.
- Full months in between: add the number of days in each.
- Days into the final month: the end day number.
Worked example: 20 October 2026 to 25 December 2026
- October has 31 days. 31 − 20 = 11.
- November is the only full month in between: 30.
- The end date is the 25th: 25.
Total: 11 + 30 + 25 = 66 days.
We keep a dated Christmas countdown that uses this exact method.
Worked example: 15 August 2026 to 3 March 2027
- August has 31 days: 31 − 15 = 16.
- Full months: September 30, October 31, November 30, December 31, January 31, February 28 (2027 is not a leap year). That makes 181.
- End day: 3.
Total: 16 + 181 + 3 = 200 days.
Days in each month
You need these numbers for the method above.
| Month | Days |
|---|---|
| January | 31 |
| February | 28 (29 in a leap year) |
| March | 31 |
| April | 30 |
| May | 31 |
| June | 30 |
| July | 31 |
| August | 31 |
| September | 30 |
| October | 31 |
| November | 30 |
| December | 31 |
The knuckle trick helps: make two fists and count months across your knuckles and the gaps between them. Knuckles are 31-day months; gaps are the shorter ones.
Inclusive vs exclusive counting
This is the most common source of off-by-one errors.
- Exclusive counting does not count the start date. From Monday to Friday of the same week is 4 days. Most date calculators and spreadsheets work this way.
- Inclusive counting counts both the start and the end date. Monday to Friday is 5 days. Use it for things like the number of days an event runs, or how many days of a holiday you are booked for.
The rule is simple: inclusive = exclusive + 1. Always say which one you mean when you share a number, especially in contracts, school forms or travel bookings.
How leap years change the count
A leap year adds 29 February. In the Gregorian calendar, a year is a leap year if it is divisible by 4, except century years, which must also be divisible by 400. So 2024 and 2028 are leap years, 2026 and 2027 are not, 1900 was not, and 2000 was.
That changes any span that crosses the end of February:
- From 1 February 2026 to 1 March 2026: 28 days.
- From 1 February 2024 to 1 March 2024: 29 days.
A full calendar year has 365 days, or 366 in a leap year. If you are counting across several years, add one day for each 29 February in the span. Our post on leap year age calculation covers how this affects birthdays on 29 February.
Days between dates in a spreadsheet
Spreadsheets store dates as numbers, so subtraction works directly.
- In Excel or Google Sheets, if A1 holds the start date and B1 the end date, =B1-A1 gives the exclusive count.
- =B1-A1+1 gives the inclusive count.
- =NETWORKDAYS(A1,B1) counts weekdays, Monday to Friday, and includes both the start and end dates.
For age in years, months and days rather than total days, see our guide to calculating age precisely in months, days and weeks.
Counting weekdays only
Sometimes you need working days, not calendar days. A quick method:
- Count the full weeks in the span and multiply by 5.
- Count the weekdays in the leftover days by hand.
- Subtract any public holidays that fall on weekdays.
Example: from Tuesday 20 October 2026 up to Thursday 26 November 2026 there are 37 days, which is 5 full weeks (25 weekdays) plus 2 leftover days, a Tuesday and a Wednesday, both weekdays. That gives 27 weekdays. If a school closes for Veterans Day on Wednesday 11 November, it has 26 school days in that span.
Converting days to weeks, months and years
Once you have a total, you may want it in bigger units.
- Weeks: divide by 7. 200 days = 28 weeks and 4 days.
- Months: there is no exact conversion because months vary. Count calendar months instead, then the leftover days.
- Years: divide by 365 for a rough figure, or count calendar years and then the leftover days for an exact one.
Our months to years guide covers converting longer spans.
Worked examples you can check
We use the same method in our Thanksgiving countdown.
For a worked holiday example, see how many days until New Year 2027.
Try these yourself, then compare with the answers.
| From | To | Days (exclusive) |
|---|---|---|
| 1 January 2026 | 1 January 2027 | 365 |
| 15 June 2026 | 1 September 2026 | 78 |
| 20 October 2026 | 31 December 2026 | 72 |
| 24 August 2026 | 28 May 2027 | 277 |
| 1 February 2024 | 1 March 2024 | 29 |
The 24 August to 28 May row is roughly a US school year. It is a good check of the full method because it crosses a year boundary and a February. 2027 is not a leap year, so February adds 28 days.
Finding a date a number of days away
The method also works in reverse, when you know the number of days and need the date.
- Use up the current month. From 20 October, there are 11 days left in October.
- Subtract whole months. Take off 30 for November, 31 for December, and so on, until what is left is smaller than the next month.
- The remainder is the day of the month.
Example: what is 100 days after 20 October 2026?
- 100 − 11 (rest of October) = 89.
- 89 − 30 (November) = 59.
- 59 − 31 (December) = 28.
- 28 is less than 31, so the answer is 28 January 2027.
Going backwards works the same way. Thirty days before 20 October 2026 is 20 September 2026, because September has 30 days.
Hours, minutes and seconds between dates
For a span of whole days, multiply:
- Hours: days × 24.
- Minutes: hours × 60.
- Seconds: minutes × 60.
So 66 days is 1,584 hours, 95,040 minutes, or 5,702,400 seconds. If your start and end times are not both midnight, work out the whole days first, then add or subtract the extra hours. Clock changes for daylight saving can add or remove an hour on the changeover dates, which matters for timing but not for counting calendar days.
Everyday uses for a day count
Counting days between dates comes up more often than people expect:
- Notice periods: a 30-day notice given on 20 October ends on 19 November if you count exclusively.
- Return windows: a 14-day return policy that starts on the delivery date usually counts from the next day.
- Medication or habit streaks: inclusive counting gives the number of days you actually took part.
- Pregnancy and baby milestones: weeks matter more than days here, so divide by 7.
- School and work deadlines: use weekdays, then subtract holidays.
When a deadline really matters, check whether the rules count the first day, and read the exact wording of the policy.
Common mistakes and how to avoid them
- Counting the start date by accident. Decide exclusive or inclusive first.
- Treating every month as 30 days. This drifts by several days over a year.
- Forgetting 29 February. Check whether the span crosses the end of February in a leap year.
- Mixing up date formats. 03/04 is 3 April in the UK but 4 March in the US. Write the month as a word when it matters.
Frequently Asked Questions
How do you calculate the days between two dates?
Count the days left in the first month, add the days in each full month in between, then add the day number of the final month. For dates in the same month, just subtract the day numbers.
Do you include the start date when counting days?
Most calculators do not. That is exclusive counting. If you want to include both the start and end dates, add one to the result.
How many days are there between 20 October and 25 December 2026?
There are 66 days. That is 11 days left in October, 30 in November and 25 in December.
How do leap years affect the number of days?
A leap year adds 29 February, so any span that crosses the end of February in a leap year is one day longer. 2028 is the next leap year.
What is the Excel formula for days between two dates?
Subtract the earlier date from the later one, for example =B1-A1. Add 1 for an inclusive count, or use NETWORKDAYS to count weekdays only.
How many days are in a year?
A common year has 365 days and a leap year has 366. In the Gregorian calendar, a year divisible by 4 is a leap year, except century years not divisible by 400.