What Is the Gallon Calculator?
This gallon calculator converts the dimensions of a rectangular tank or container into its capacity in US liquid gallons. Enter the inside length, width and height in inches and it returns the volume in gallons, along with the total cubic inches and the equivalent in liters. It is ideal for sizing aquariums, water tanks, fuel cells, troughs and storage bins.
How to Use It
Measure the inside of your container in inches: the length, the width and the depth (height) of the liquid. Type each value into the matching field and the calculator instantly shows the capacity. For partially filled tanks, use the height of the liquid rather than the full tank height.
The Formula Explained
A US liquid gallon is defined as exactly 231 cubic inches. So once you know the volume of a box-shaped container in cubic inches, you simply divide by 231:
$$\text{Gallons} = \frac{\text{Length (in)} \times \text{Width (in)} \times \text{Height (in)}}{231}$$
The length \(\times\) width \(\times\) height product gives the volume in cubic inches; dividing by 231 converts it to gallons. To get liters, gallons are multiplied by 3.785411784.
Worked Example
Suppose an aquarium measures 24 in long, 12 in wide and 12 in tall. The volume is $$24 \times 12 \times 12 = 3{,}456 \text{ cubic inches}.$$ Dividing by 231 gives $$\frac{3{,}456}{231} \approx 14.96 \text{ US gallons}$$ — close to the common "15-gallon" aquarium size. That equals about 56.64 liters.
FAQ
Does this use US or Imperial gallons? It uses US liquid gallons (231 cubic inches). An Imperial (UK) gallon is larger, about 277.42 cubic inches.
Can I use it for a cylinder? No — this formula is for rectangular (box-shaped) containers. A cylinder needs \(\pi \times \text{radius}^2 \times \text{height}\).
Should I measure inside or outside dimensions? Measure the inside dimensions to get true liquid capacity; wall thickness reduces usable volume.