◄ Wiki / Build
off-by-one
A bug where a count or index is wrong by exactly one — stopping one step too early or late.
Off-by-one errors come from miscounting boundaries: looping one iteration too many, reading one element past the end, or starting at 1 when you meant 0. They're famously common because the edges of ranges are easy to get subtly wrong. Small as they are, they cause crashes, corruption, and missed data.