In short
For a 12 ft by 10 ft room with 8 ft walls, the four walls total 352 ft². Subtract 45 ft² of doors and windows to get 307 ft² of wall.
Two coats create 614 ft² of coverage work. At a stated 350 ft² per gallon, that is 1.75 gallons before packaging. When the store sells 1 gallon cans, round the purchase count up to 2 cans.
This is a planning estimate. The product label, surface, application method, waste, repairs, and available package sizes still control the real purchase.
Start with the completed fictional room rather than an empty form. Its result shows every intermediate number, so a reader can spot whether a mistaken dimension, opening, coat count, or coverage figure caused an implausible answer.

Measure the wall perimeter before thinking about gallons
A rectangular room has two walls matching its length and two matching its width. Add those four wall lengths, then multiply by wall height: 2 × (12 ft + 10 ft) × 8 ft = 352 ft². This method intentionally excludes the ceiling and floor.
Rooms with offsets, alcoves, sloped ceilings, or several wall heights need to be split into rectangles. Calculate each rectangle separately and add the areas. Do not force an irregular room into one length, width, and height if that hides a large section.

Subtract doors and windows once
Measure each opening as width × height, then add the opening areas. The example uses 45 ft² in total: one 3 ft by 7 ft door contributes 21 ft² and two 4 ft by 3 ft windows contribute 24 ft². Subtract 45 from 352 to reach 307 ft².
Do this subtraction before multiplying by coats. If an opening will actually be painted with the wall product, do not subtract it. Trim, doors, cabinets, and accent walls may use different products and should have their own estimate.
Apply coats, then use the exact product coverage
Multiply the 307 ft² net wall area by 2 coats to get 614 ft² of coverage work. Next, divide by the coverage printed for the chosen product and surface. With 350 ft² per gallon entered, 614 ÷ 350 = 1.754 gallons, displayed as 1.75 gallons before packaging.
The calculator does not hard-code one brand's coverage as a promise. Sherwin-Williams notes that product requirements vary with application and surface. Benjamin Moore describes its calculator as a rough estimate and asks for doors, windows, and coat count. Those limits are why the coverage field remains visible and editable.

Why the purchase number must round up
Stores sell containers, not fractional cans. Divide 1.754 gallons by the selected 1 gallon unit and round upward: ceiling(1.754 ÷ 1) = 2 units. If a 5 gallon bucket were selected for this small room, the same rule would return one bucket, but that does not mean the larger package is the best value or that all of it will be used.
Rounding up prevents the display from recommending less packaged paint than the arithmetic estimate. It does not add a hidden waste allowance. If the job needs a contingency for porous drywall, texture, color change, spraying, touch-ups, or future repairs, state that allowance separately.
Reject an impossible opening total
Positive room dimensions, coat count, coverage, and purchase size are required. Opening area may be zero, but it cannot be negative or equal to or greater than the gross wall area. An impossible opening total shows an error and removes the former answer instead of leaving a believable stale purchase count.

Share the assumptions with the estimate
Before sending the result, review the room dimensions, opening total, coats, product coverage, purchase unit, and whether the ceiling is excluded. A bare “buy two cans” message loses the assumptions that make the number auditable.

The public reader was opened independently in its normal state. It showed the same 352 ft² gross area, 307 ft² net area, 614 ft² coat area, 1.75 gallon estimate, and two-unit purchase result. The error test used that same page, which was then restored to the normal source.

Download the complete fictional paint coverage calculator. Replace its sample coverage with the label for the product and surface you plan to use.
When not to do this
Do not use this rectangle-based estimate as a substitute for measuring irregular surfaces, exterior elevations, ceilings, trim, cabinets, or coatings with different coverage rules. Do not treat the rounded count as a guarantee of finished quality, complete hiding, or the exact quantity a store will sell.
Where NOS fits
NOS holds the self-contained calculator, lets the owner inspect it in Code and Edit, presents the finished calculation in View, and supplies the reader address used for normal and failure checks. To confirm square-unit arithmetic before entering wall area, see the area converter calculator. To keep gallon and other volume units explicit when comparing package sizes, see the volume conversion calculator.