The formula
Gallons = surface area × average depth × 7.48. The surface is length × width for a rectangle, π ÷ 4 × diameter² for a round pool, π ÷ 4 × length × width for an oval, and length × the average width for a kidney. The average depth is (shallow end + deep end) ÷ 2, in feet. 7.48 is the gallons in a cubic foot: a gallon is 231 cubic inches and a cubic foot is 1,728, and 1,728 ÷ 231 = 7.48.