One gallon covers about 350 square feet
That is the industry planning number for one coat on primed drywall; rough or heavily textured walls drink more, and dark colors going over light need a tinted primer. The calculator counts the wall perimeter × height, subtracts about 21 sq ft per door or window, and multiplies by your coat count.
Two coats is the real answer
Almost every repaint wants two topcoats — the second coat is what evens out sheen and hides lap marks. Buying 'just enough' for one thick coat is how you get streaks; two thinner coats beat one heavy one every time.
Buy smart, not just accurate
Paint is sold in quarts and 1- or 5-gallon pails. If the math says 5.2 gallons, a 5-gallon pail plus one quart is cheaper than six singles. And keep a labeled quart of each color for touch-ups years later — colors are never quite the same on a re-tint.