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.
Gallon Conversion Table
This calculator uses the US liquid gallon, defined as exactly 231 cubic inches. The Imperial gallon (used in the UK and some other countries) is a different, larger unit.
| Unit | Equivalent |
|---|---|
| 1 US gallon | 231 in³ = 3.785411784 L = 0.13368 ft³ = 0.832674 Imperial gal |
| 1 Imperial gallon | 277.42 in³ = 4.54609 L |
| 1 liter | 61.0237 in³ = 0.264172 US gal |
| 1 cubic foot | 7.48052 US gal |
| US gallons | Cubic inches | Liters |
|---|---|---|
| 1 | 231 | 3.785 |
| 5 | 1,155 | 18.927 |
| 10 | 2,310 | 37.854 |
| 20 | 4,620 | 75.708 |
| 50 | 11,550 | 189.271 |
| 100 | 23,100 | 378.541 |
Common Tank Sizes Compared
Each row uses \(\text{Gallons} = \frac{L \times W \times H}{231}\) with inside dimensions in inches. Liters = gallons × 3.785411784. Labeled (“nominal”) sizes are rounded marketing figures, so the calculated capacity can differ from the label.
| L × W × H (in) | Volume (in³) | US gallons | Liters | Nominal vs. calculated |
|---|---|---|---|---|
| 20 × 10 × 12 | 2,400 | 10.39 | 39.33 | Sold as 10 gal; calculated is about 0.39 gal more |
| 30 × 12 × 16 | 5,760 | 24.94 | 94.39 | Roughly a 25 gal class; calculated is about 0.06 gal less |
| 36 × 18 × 16.5 | 10,692 | 46.29 | 175.21 | Roughly a mid-40s gal class; no single standard label |
| 48 × 13 × 21 | 13,104 | 56.73 | 214.74 | Sold as 55 gal; calculated is about 1.73 gal more |
| 48 × 18 × 21 | 18,144 | 78.55 | 297.33 | Sold as 75 gal; calculated is about 3.55 gal more |
Calculated figures are the full volume of the rectangular box. Real usable volume is lower because of glass thickness, rims, substrate, decor, and the water line sitting below the top edge.
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.