One gallon covers 350 to 400 square feet in one coat — on a sealed, smooth, previously painted wall. On the wall you actually have, expect 250 to 350. That gap is not a rounding difference; on a 12 × 12 ft bedroom it is the difference between two tins and three.
Where the manufacturer’s number comes from
Coverage on a tin is measured on a test surface: primed, non-porous, coated at a uniform film thickness. Everything that makes a real wall real works against it. Fresh drywall and new plaster absorb the first coat. Texture adds surface area that the flat measurement does not see. A roller with a longer nap holds more paint and puts more of it on.
So treat the printed figure as the ceiling, not the estimate. On new board, take the bottom of the range. On a repaint in a similar colour, the top of it is realistic.
The arithmetic, once
Paintable area is the four walls minus the openings:
2 × (length + width) × height − doors − windows
Multiply by the number of coats, divide by the coverage figure, and round the tins up. That last step matters more than it looks: paint that runs out two-thirds of the way along a wall leaves a visible lap mark where the new tin starts, even with an identical colour code, because the two tins dry at slightly different rates.
The mistake worth avoiding
Do not skip subtracting the door and windows “for safety”. In a small room the openings are easily a tenth of the wall area, and padding an estimate that is already padded by a conservative coverage figure is how one room ends up with a spare gallon nobody will ever use — tinted to a colour that will not match the next batch anyway.
The paint calculator does the subtraction, takes the coverage figure from your own tin if you want to override it, and returns the tin count rather than a decimal of a gallon.