Say it like this
- We have an off-by-one error in the loop
- That's a classic off-by-one error
- Watch out for off-by-one errors when you iterate
Use it at work
Debugging
- The last item is missing. Looks like an off-by-one error.
- It's an off-by-one in the loop: use < not <=.
Code review
- This could be off by one. Should it start at 0?
- Add a test for the edge case to catch off-by-one errors.
Explaining
- The page shows 11 results instead of 10. Classic off-by-one.
- Off-by-one errors are common with dates.
Don't say this
Off-by-one error is a noun, not a verb. Use 'fix' or another action verb with it.
Practice
Try it
4 quick exercises
1. The loop processes elements 0 to 10, but the array only has 10 elements. This is a _______ error.
2. Which sentence uses 'off-by-one error' incorrectly?
3. Your code processes one extra item by mistake. How do you describe it to your team?
4. Rewrite this in natural tech English: 'The code is wrong because it goes through one more item than it should because the counting is wrong.'
Say it out loud
Phrase 1 of 3
"We have an off-by-one error in the loop"
We don't save your recording. The word check uses your browser's speech recognition.
More about off-by-one error
Real examples(3)
- in a standup
"We found an off-by-one error in the batch processing script that was causing it to skip the last record."
- in a code review
"This loop starts at 1 instead of 0—are you sure this isn't an off-by-one error?"
- in a team meeting
"The reason the export only processed 999 items instead of 1000 was an off-by-one error in the iteration."
More mistakes(2)
Handle with care. Do not use as a verb (e.g., 'we off-by-one errored the code'). It is strictly a noun describing a specific type of bug, not an action.
- ✕The off-by-one error happened because the array started counting at 1.✓The off-by-one error happened because the loop started at 1 instead of 0.
Arrays in most languages are zero-indexed; mention the loop or index logic, not just the array.
- ✕I made an off-by-one error in my design.✓I made an off-by-one error in my loop logic.
Off-by-one errors are specific to loops, indices, and boundary calculations, not general design mistakes.
Other forms(2)
- off-by-one error noun (singular)
"We discovered an off-by-one error in the database query."
- off-by-one errors noun (plural)
"Off-by-one errors are a common source of bugs in loop iterations."
Often used with(4)
- fix an off-by-one error · Used when correcting the bug in code
- introduce an off-by-one error · Used when a developer accidentally creates this type of bug
- catch an off-by-one error · Used when identifying the bug during testing or review
- classic off-by-one error · Used to describe a textbook example of this common mistake
Similar words(3)
- boundary error · More general term; off-by-one is more specific
- fencepost error · Alternative technical name for the same problem; less commonly used
- index error · Broader category; off-by-one is a specific type
Questions(5)
- What does off-by-one error mean in software engineering?
- An off-by-one error is a bug where a loop or array index is incorrect by exactly one position. For example, a loop that should process items 0-9 might process 0-10 instead, trying to access an element that does not exist. These errors happen frequently in programming and are often caught during testing or code review.
- How do you use off-by-one error in a sentence at work?
- Use it as a noun to describe the bug: 'We found an off-by-one error in the payment processing loop.' You can also say 'Fix the off-by-one error' or 'This is a classic off-by-one error.' Never use it as a verb—say 'fix the error,' not 'off-by-one error the code.'
- Is off-by-one error formal or informal?
- It is neutral and professional. You can use it in formal code reviews, team meetings, technical documentation, and job interviews. It is a standard technical term in software engineering.
- Why are off-by-one errors so common?
- They occur because developers must decide whether loops and arrays start at 0 or 1, and whether boundary conditions are inclusive or exclusive. In many languages, arrays are zero-indexed, which makes it easy to accidentally count wrong.
- How do you prevent off-by-one errors?
- Test boundary conditions carefully, use clear loop logic, and write unit tests for loops that process collections. Code reviews and linters can also catch these errors before they reach production.



