How to Count the Days Between Two Dates (and Avoid Off-by-One)

How many days until a deadline, since a start date, or between two bookings? The sums are easy, but the answers often come out one day apart because people disagree about whether the first and last day should be counted. Settle that question first, then pick a counting method that suits the dates you have.

Below are the difference-versus-inclusive rule, the day-of-year method, how to handle year ends and leap days, and a month-by-month walk that works well in your head.

Difference or inclusive count?

The difference between two dates is how many midnights lie between them: how far you move from the first date to reach the second. The inclusive count also counts the starting day, so it is one larger.

inclusive days = difference + 1A fence with 10 gaps between posts needs 11 posts.

Worked example: from 1 January to 31 December 2026 the difference is 364 days, but the inclusive count is 365, because every day of the year is counted once.

SituationUsual count
Days until an eventDifference
Hotel nights between check-in and check-outDifference
Elapsed time or age in daysDifference
Days of leave booked, both ends includedInclusive
A project that runs on both its first and last dayInclusive

If a contract or form states how to count, follow it. When it does not, say which convention you used.

The day-of-year method

For two dates in the same year, convert each to a day-of-year number and subtract. To do that, add the day of the month to the number of days that have passed before the month starts:

Common year. In a leap year, add 1 from March onward.
MonthDays before it startsMonthDays before it starts
January0July181
February31August212
March59September243
April90October273
May120November304
June151December334

Worked example: 12 March 2026 to 19 October 2026. March 12 is 59 + 12 = day 71. October 19 is 273 + 19 = day 292. The difference is 292 − 71 = 221 days, or 222 inclusive.

Spanning year ends and leap days

When the dates are in different years, add three parts: the days left in the first year, the days in any full years between, and the day-of-year number of the second date.

A span of exactly one calendar year is not always 365 days. From 15 January 2024 to 15 January 2025 is 366 days, because 29 February 2024 sits inside it. From 15 March 2024 to 15 March 2025 is 365 days, because the leap day was already behind you.

  • A leap year has 366 days, so its last day is day 366.
  • For a span of whole years, multiply the number of years by 365, then add one day for each 29 February that falls inside the span.
  • Only years divisible by 4 can be leap years, and century years such as 1900 and 2100 are not leap years.

A month-by-month walk

For a quick mental count, move to the end of the start month, then add whole months, then add the days of the last month. You only need the month lengths: January, March, May, July, August, October and December have 31 days; April, June, September and November have 30; February has 28, or 29 in a leap year.

Worked example: 19 October to 25 December 2026. October has 31 − 19 = 12 days left. November has 30. December adds 25. The total is 12 + 30 + 25 = 67 days. As weeks, that is 9 weeks and 4 days (67 ÷ 7 = 9 remainder 4).

Dividing by 7 is also the fastest way to find the weekday of the second date: 4 days after a Monday (19 October 2026) is a Friday, which is 25 December 2026.

When times of day are involved

Date-only counts ignore the clock, which keeps them clean. If you include times, divide the total hours by 24 and keep the remainder. Be aware that in places that use daylight saving time, a local day can be 23 or 25 hours long, so a span between two local times may not be an exact multiple of 24 hours.

A days between dates calculator or a day counter gives the answer straight away, and the date and time duration calculator breaks a span into days, hours and minutes.

Try the tools
  • Days Calculator: Use the days calculator to find how many days lie between two dates, or to add days to a date and see the result with its day of the week. Weekdays, weeks and months are reported too.
  • Day Counter: Pick a start date and an end date to count the calendar days between them. Choose whether the last day is included, and the workdays in the range are shown alongside.
  • Date & Time Duration Calculator: Choose the date duration tool to measure the span between two dates and times, or the time duration tool to compare two clock times. The answer is shown in every unit from years down to seconds.

This article is general information, not professional advice. See our Disclaimer and Editorial Policy.

More articles