Counting the days between two dates sounds like the easiest arithmetic on the calendar, and it is where more small errors are made than almost anywhere else. Two people count the same pair of dates and get answers one apart, both are convinced they are right, and a deadline, a rental charge or an interest calculation quietly moves by a day. The problem is not the arithmetic. It is that nobody says whether the endpoints are included.
This article covers how to count the days between two dates reliably: the inclusive and exclusive conventions, what happens when a span crosses a month or year boundary, how leap days interfere, and where the classic off-by-one error comes from. For anything longer than a few weeks the date calculator will do it exactly, but the reasoning below is what lets you check the result.
How Do You Count The Days Between Two Dates?
Within a single year, subtract the earlier date's day of year from the later one's. From 10 March, day 69 in a common year, to 25 March, day 84, the difference is 15 days. That is the exclusive count, which is what "between" normally means.
The ordinal method works because it strips out the uneven month lengths that make manual counting awkward. Both dates become plain numbers between 1 and 366, so the days between two dates in the same year reduce to a single subtraction. The day of year page gives today's value, and the way the ordinal count is built up is set out in day of year and Julian day. Astronomers take the same idea further with the Julian day number, a continuous count from a fixed epoch that makes any two dates in recorded history a single subtraction apart, no matter how many calendar reforms separate them.
Inclusive Or Exclusive: Which Do You Need?
Exclusive counting measures the gap between the two dates and excludes at least one endpoint. Inclusive counting counts both endpoints as days, so it is always one higher. From 10 March to 25 March there are 15 days between them but 16 days in the range.
Neither is more correct; they answer different questions about the days between two dates. Choose by what the number is for:
- Exclusive: "How long until the deadline?" You want the days remaining, not counting today.
- Inclusive: "How many days am I away?" A holiday from the 10th to the 25th consumes both of those days.
- Hotel and rental nights: always exclusive, because you pay for the nights between arrival and departure, not for both dates.
- Contractual notice periods: usually defined explicitly, and the wording, whether "clear days" or "days from", decides which endpoint drops out.
- Interest and daily accruals: generally exclusive at one end, following whatever day-count convention the agreement names.
When you quote a figure, say which convention you used. "Fifteen days, not counting today" ends the argument before it starts.
Days Between Two Dates Across Month And Year Boundaries
Month boundaries are where hand counting fails, because the months are 28, 29, 30 or 31 days long in no memorable pattern. Adding up part-months is fine for a short span and unreliable beyond a couple of them.
Year boundaries need a different approach again. Take the days remaining in the first year, which is the year's length minus the start date's day of year, add the second date's day of year, and add 365 or 366 for each complete year in between. From 20 December to 10 January in a common year: 11 days remain in December, plus 10 in January, giving 21 days. The method generalises to any span, but the bookkeeping grows quickly, and each intervening year has to be tested against the leap year rule individually. Counting the days between two dates several years apart by hand is rarely worth the risk of an arithmetic slip.
Leap Days And The February Trap
Any span that crosses 29 February gains a day. A period from 1 February to 1 March is 28 days in a common year and 29 in a leap year, and a full year measured from a date in January to the same date the next January is 366 days if 29 February falls inside it.
This is where counting the days between two dates from memory tends to break down. The rule for which years qualify is not simply every fourth year: centuries are excluded unless they divide by 400, so 1900 was a common year and 2000 was not, as explained in leap years explained. A long span may contain several leap days, and each one must be counted. Anniversary dates raise a related question with no arithmetic answer at all: what is one year after 29 February? Different contracts settle it differently, some choosing 28 February and others 1 March, which is why the wording matters more than the calculation.
Where The Off-By-One Error Comes From
It comes from confusing the days in a range with the gaps between them, the fence-post problem in another guise, and it is the reason two people counting the days between two dates so often differ by exactly one. A fence with ten posts has nine gaps, and a range covering ten days has nine intervals between its endpoints. Choose the wrong one and every result is one out.
Three habits keep it under control. Write both endpoints down in the ISO 8601 form, 2024-03-10 and 2024-03-25, so there is no ambiguity about which date you mean. Decide before calculating whether you are counting days or gaps, and say so in the result. Finally, test the method on a case small enough to verify by hand: from Monday to Tuesday is one day exclusive and two days inclusive, and any formula that disagrees with that is wrong. The same test catches errors in spreadsheet formulas, which subtract dates exclusively by default and therefore need an explicit plus one when a range is meant.
Days Between Two Dates Versus Working Days
The calendar days between two dates and the working days between them are different measurements, and a deadline quoted in one will not match the other. A 21-day calendar span contains roughly 15 weekdays, and fewer once bank holidays are removed.
Which one applies depends on the wording. Legal and administrative deadlines are frequently expressed in business days precisely so that weekends do not consume them, while interest, rent and subscription periods run on calendar days without exception. The rules for excluding weekends and holidays, and why "10 business days" means different things in different countries, are set out in counting business days. Start from the correct calendar figure first: the today's date page gives the starting point, and the date calculator handles the span.
Conclusion
The days between two dates is a subtraction of day-of-year numbers, extended with the year's length whenever the span crosses a year end. Decide first whether you are counting inclusively or exclusively, state which you chose, check whether a leap day falls inside the range, and verify your method on a one-day example to catch the fence-post error. For spans that cross months, years or 29 February, use the date calculator rather than counting by hand, and see the other calendar tools at datetoday.now.