Guide
Counting Days Without an Off-by-One: Inclusive, Exclusive, Weekdays and Leap Years
From 1 January to 31 December 2026 is either 364 days or 365, and both answers are right. The difference is whether you count the last day, and almost every off-by-one error in contracts, deadlines and timesheets is that decision made silently by somebody else. Pick the convention deliberately and the arithmetic stops being ambiguous.
Two conventions, one decision
Exclusive counting measures the interval between two instants: start at midnight on day A, stop at midnight on day B, and the answer is how much time passed. A hotel night is exclusive — check in on the 1st, out on the 3rd, pay for two nights. Interest accrual works the same way: the start date is counted, the end date is not.
Inclusive counting measures the number of calendar days touched by the range, so both endpoints count. A 30-day notice period starting on the 1st ends on the 30th, not the 31st. Project plans, medication courses and "days until" counters are usually inclusive.
In formal terms, exclusive counting is the half-open interval [start, end) and inclusive counting is [start, end]. Writing it that way removes the argument: the brackets tell you whether the last day is inside the range.
Worked examples
| Range | Days, exclusive | Days, inclusive | Weekdays, exclusive |
|---|---|---|---|
| 2026-01-01 → 2026-12-31 | 364 | 365 | 260 |
| 2026-11-19 → 2026-12-25 | 36 | 37 | 26 |
| 2024-02-01 → 2024-03-01 | 29 | 30 | 21 |
| 2023-02-01 → 2023-03-01 | 28 | 29 | 20 |
The first row is the whole argument in one line: same year, same dates, two defensible answers. Rows three and four show the leap year at work — February 2024 has 29 days, February 2023 has 28, and the difference appears without anyone calculating it.
Leap years are a calendar rule, not a rounding
A tropical year is about 365.2422 days, so any calendar with a fixed 365-day year drifts by roughly a day every four years. The Julian fix added a leap day every four years; the Gregorian refinement removed three of them every 400 years. The rule in use today: a year is a leap year if it is divisible by 4, unless it is divisible by 100, unless it is also divisible by 400. So 2000 was a leap year, 1900 was not, and 2100 will not be.
This matters beyond trivia. Any hand-written date library that adds "365 days per year" will be wrong by one day for every leap day in the range, and a 30-year projection can be off by a week. It is also why date arithmetic should be done on calendar dates rather than on elapsed milliseconds divided by 86,400,000.
Weekdays, business days and holidays
"Weekdays" in the date calculator means Monday to Friday. That is not the same as "business days", which also exclude public holidays. The distinction matters for settlement dates, shipping promises and anything described as "three business days". Holidays are local: a bank holiday in one country is an ordinary working day in another, Easter moves every year, and some countries substitute a Monday when a holiday falls at the weekend. No general-purpose calculator can know which calendar you mean, so this site counts weekdays and tells you it has not subtracted holidays.
"Net 30" is the classic trap. It means thirty days from the invoice date, so an invoice dated 1 November is due 1 December — thirty days later, exclusive counting. Some contracts define it as thirty business days, which is six calendar weeks, and some as "end of the month following". Read the definition, not the shorthand.
Time zones and daylight saving
A calendar day is not always 24 hours long. On the day a country springs forward it is 23 hours; when it falls back it is 25. If you compute a date difference by subtracting timestamps in local time, those two days produce 0.958 or 1.042 days, and rounding goes the wrong way about half the time. The fix is to anchor both dates at midnight UTC, where every day is exactly 86,400 seconds, and subtract. That is what this site does, and it is why the result is stable regardless of your time zone or the time of day you open the page.
Where this bites in real life
- Rental periods. "From the 1st to the 31st" is 30 nights, not 31, and agencies that quote inclusive will charge an extra night.
- Notice periods. A 60-day notice served on 1 March expires on 29 April in a leap year and 30 April otherwise, exclusive.
- Interest. Most loan conventions count the start date and exclude the end date, which is why a one-day-late payment costs one day of interest, not two.
- Age. A person is not "one year older" every 365 days; birthdays are calendar events, and the leap-day case needs a rule of its own.
- Payroll. A pay period that starts and ends on the same day of the month has 28, 29, 30 or 31 days depending on the month, which is why daily-rate contracts specify a basis.
Counting by hand
For a quick check, convert both dates to day-of-year numbers and subtract. 1 January is day 1 and 31 December is day 365 in a common year, so the exclusive difference is 364 and the inclusive count is 365. Add one for every 29 February you cross. That method reproduces the table above and is fast enough to catch a wrong answer before you sign something.
The date difference calculator does the same thing with the inclusive switch, weekdays and a negative check if the dates are the wrong way round. For the money side of a deadline, the payoff calculator and the compound interest guide cover how day counts turn into interest.
FAQ
Is a week 7 days or 5 days?
A calendar week is 7 days; a working week is 5 in most countries, 6 in some, and fewer where a four-day week is standard. When someone says "two weeks" for a deadline, ask which one they mean — the difference can be four days.
How do I count days including the start date but not the end?
Count the interval normally and leave the end date out: that is exclusive counting, and it is what most day counters and interest calculations do. Add one to switch to inclusive.
Why does my spreadsheet disagree with this calculator by one day?
Almost always an inclusive/exclusive mismatch, or a time zone: if either cell contains a time as well as a date, the subtraction can land just either side of midnight. Format both cells as date-only values before subtracting.
Try it: days, weeks, weekdays and an inclusive switch, in the browser. count your own range
Keep reading
Written by the CalcNest team. Last updated November 19, 2026.