Off-by-one errors - the most common days between mistake
Open the Days Between Calculator
There is a particular frustration known to everyone who counts days: your answer and someone else's answer differ by exactly one, both of you counted carefully, and neither of you can find an arithmetic mistake - because there is not one. You have met the off-by-one error, the most common mistake in all of day counting, and it is a framing error, not a math error. This guide explains where the extra day hides, how to tell which side of it you are on, and how to make your counts immune to it.
The fence and its posts
Programmers named this error after a fence. Build a fence 100 feet long with a post every 10 feet and you need 11 posts, not 10 - one at the start, then one at the end of each 10-foot gap. Posts and gaps are both countable things, they sit in the same picture, and their counts always differ by exactly one. Dates work identically. The calendar dates in a span are the posts. The days between them are the gaps. From Monday to Wednesday there are 3 posts and 2 gaps. Every off-by-one error in day counting is a case of someone counting posts while someone else counts gaps.
The standard method for deadlines, ages and elapsed time counts gaps - the midnights between dates. The inclusive method, used for leave, rentals and stays, counts posts. Neither is an error in itself. The error is mixing them: starting a count in one frame and finishing it in the other, or comparing two numbers produced in different frames as if one must be wrong. Our guide on inclusive versus exclusive counting is devoted to the two frames; this guide is about catching yourself slipping between them.
The three usual hiding places
The start day. The single most common slip is counting the start date as a full day when the method says to exclude it. It happens because the start date is emotionally present - it is the day the thing happened - and quietly adding it feels harmless. In a 90-day period it moves the end date a full day early, as our 90-day guide shows. Courts exclude the start day by rule; streaks and ages exclude it by definition; if your count includes it, you are in the other frame.
The spreadsheet that counts both ends. Excel and Sheets NETWORKDAYS counts the start and end dates when they are weekdays, returning one more than the elapsed-time business count for the same span. Nothing is broken; the function answers "how many working days does this span touch" while a deadline asks "how many working days have passed." Our Excel guide shows the January example where the two answers, 10 and 9, are both correct.
The month that was shorter in your head. In hand counts, a one-day error also comes from a misremembered month length - treating a 31-day month as 30, or forgetting that February had a 29th day inside your span. This one really is an arithmetic-family error, and it hides in the same place: exactly one day. The defense is mechanical: write each month's length beside it as you add, using the table in our month lengths guide rather than memory.

The two test cases that catch everything
Before trusting any counting method - yours, a spreadsheet's, a colleague's - run it on two spans so small that the right answer is beyond argument. Test one: from Monday to Tuesday. The elapsed-time answer is 1. If your method says 2, it is counting posts. Test two: from a date to itself. The elapsed-time answer is 0. If your method says 1, it is counting posts. There is no third possibility and no room for opinion; the two tests take ten seconds and they classify any method instantly. When a big count disagrees by one, do not recount the big span first. Run the two tests on both methods, name the frames, and the disagreement usually dissolves on the spot - what remains is the real question, which frame your situation requires.
Which frame does your situation require?
Deadlines, filing periods, ages, interest and notice periods: gaps - the elapsed-time frame, start day excluded. Leave and absence: posts, but only the working-day posts. Hotel stays: gaps for the price (nights), posts for the experience (days present). Rentals: read the agreement, because this industry genuinely splits. Project durations: gaps. Streaks and days-since counts: gaps, with the event day as day zero. If a document, a policy or a person gives you a number, ask which frame produced it before you compare it with yours. And when you hand a number on, hand the frame with it - "30 days, start day excluded" - the way every guide on this site models. A number with its method attached cannot start an off-by-one argument, because the method is the part everyone was actually disagreeing about.
When the difference is not one
A closing word of diagnostic comfort: if two counts differ by more than one day, it is not this error. Look instead for a month length, a leap day, a swapped day and month in a date typed the other country's way, or a business-day count being compared with a calendar-day count - a difference of roughly two days per week of span. The days between calculator helps here too, because it displays the calendar count, both business day counts and the breakdown together: whichever pair of figures matches the two disputed answers tells you which two frames were being compared. One day apart is a framing problem. Anything else is a different bug - and now you know how to tell them apart.
Frequently asked questions
What is an off-by-one error in day counting?
A count that is wrong by exactly one day because an endpoint was included or excluded inconsistently. It is not an arithmetic slip - the adding was fine. It is a framing error: counting the fence posts when you needed the gaps between them, or the other way round.
Why is my count one more than the calculator?
Almost certainly because you counted both the first and the last day, while the calculator used the standard elapsed-time method that excludes the start day. Your count is the inclusive reading; the calculator shows the exclusive one. If your situation counts both ends, use the include end date option and the two will agree.
Why is my count one less than the calculator?
Usually because an endpoint was dropped twice, or a month length was misremembered in a hand count - a 31-day month treated as 30 loses exactly one day. Recount the span month by month, writing each month length down, and check any February inside the span for a leap day.
How do I test whether my counting method is right?
Use the smallest possible span. From Monday to Tuesday must be 1 day by the elapsed-time method. From a date to itself must be 0. Run your method on those two cases; if either answer surprises you, the method - not the arithmetic - is what needs adjusting.
Which is right, my count or the calculator?
Whichever matches the method your situation requires. Deadlines, ages and interest use the elapsed-time method the calculator defaults to. Leave, rentals and stays often count both ends. Decide the method first, then compare numbers - arguing about the number before agreeing the method never settles anything.
Related guides
Include the end date or not - inclusive vs exclusive counting
The one-day difference that causes most counting arguments, settled.
How to calculate days between two dates by hand
The midnight method and the day-of-year method, with worked examples.
How to count days in a notice period or contract
When the clock starts, clear days, and the wording that changes the answer.
How to calculate days between dates in Excel
NETWORKDAYS, DATEDIF and the simple subtraction method, compared.
