Volume Calculator — 8 Shapes With Unit Conversion
Cube, box, sphere, cylinder, cone, pyramid, capsule, or tube. Pick a shape, enter dimensions, read the volume in any unit.
- in³
- —
- ft³
- —
- yd³
- —
- cm³
- —
- m³
- —
- liters
- —
- US gallons
- —
What is volume calculator?
Volume is the amount of 3D space inside a closed shape, and the formulas vary by shape — but they share a common shape: a coefficient times the cubed characteristic length. A cube of side s has volume s³. A sphere of radius r has (4/3)π·r³. A cylinder takes the area of its circular base (π·r²) times its height. A cone or pyramid is one-third of the corresponding prism: a cone is one-third of the equivalent cylinder, a square pyramid is one-third of the box on the same base.
This calculator covers eight shapes that come up most often in homework, fabrication, and DIY: cube, rectangular prism (box), sphere, cylinder, cone, square pyramid, capsule, and annular tube. The capsule is a cylinder with hemispherical caps — like a medicine capsule — and the tube is the volume between two coaxial cylinders, which is what you want for pipe walls, drinking-glass walls, and similar hollow shapes.
The linear unit (in / ft / yd / cm / m) determines how the calculator interprets your dimension inputs. The result is reported in the cubed input unit as the headline, plus six cross-conversions in the stats list: in³, ft³, yd³, cm³, m³, liters, and US gallons. The liters and gallons lines are most useful for fluid-capacity questions (tank volumes, aquariums, drink containers).
Privacy is simple: every calculation runs in your browser. The values you type never leave your device. The only saved state is your shape and unit preference in localStorage.
When to use a volume calculator
- Geometry homework — sphere, cone, or cylinder volume — Pick the shape from the dropdown, enter the dimensions, and read the volume in the same unit you typed (e.g., enter cm and get cm³). The stats list shows the same volume in six other units — in³, ft³, yd³, cm³, m³, liters, US gallons — so you can match whichever unit the assignment asks for.
- Fabrication — tank or pipe capacity — For a cylindrical water tank: select Cylinder, enter the radius and the height, choose the unit (typically ft). The volume appears in ft³ with cross-conversions to liters and gallons — the two units most often used for tank capacity.
- Aquarium or fish-tank volume — Rectangular prism volume is the same math as length × width × height. Enter the three dimensions in inches, read the volume in US gallons in the stats list. (Most US aquarium sites list capacity in gallons.)
How to use the Volume Calculator — 8 Shapes With Unit Conversion
- Pick a shape from the dropdown — Eight options: cube, rectangular prism (box), sphere, cylinder, cone, pyramid (square base), capsule, and tube. The input fields swap to match the shape. Your last choice persists across visits.
- Type the dimensions — All dimensions must be positive numbers. For the tube, the inner radius must be strictly less than the outer radius. The calculator validates as you type and shows a hint if any field is missing or invalid.
- Pick the linear unit — Inches, feet, yards, centimeters, or meters. The unit determines how all your dimension inputs are interpreted; switching it does not convert numbers you already typed.
- Read the volume in 7 units at once — The headline shows the volume in the cubed input unit (e.g., ft³). The stats list shows the same volume converted to in³, ft³, yd³, cm³, m³, liters, and US gallons — useful when the next step in your project uses a different unit system.
Worked examples
Cube, side 2 ft
Input: Shape Cube, side 2, unit ft
Output: Volume = 8 ft³ (≈ 226.5348 liters, ≈ 59.8442 US gallons) Cylinder, r = 2 ft, h = 5 ft
Input: Shape Cylinder, r=2, h=5, unit ft
Output: Volume ≈ 62.8319 ft³ (≈ 1779.293 liters, ≈ 470.0876 US gal) 20π ≈ 62.8319.
Sphere, radius 3 cm
Input: Shape Sphere, r=3, unit cm
Output: Volume ≈ 113.0973 cm³ (= 113.0973 mL, ≈ 0.1131 liters) 36π ≈ 113.0973. 1 cm³ = 1 mL.
Frequently asked questions
How do I calculate the volume of a cylinder?
V = π·r²·h, where r is the radius and h is the height. A cylinder of radius 2 ft and height 5 ft has volume π·4·5 = 20π ≈ 62.8319 ft³. Pick Cylinder from the shape dropdown and enter the two dimensions.How do I calculate the volume of a sphere?
V = (4/3)·π·r³. A sphere of radius 3 has volume (4/3)·π·27 = 36π ≈ 113.0973 in whatever cubed unit you supplied the radius in.What's the difference between a capsule and a cylinder?
V = π·r²·h + (4/3)·π·r³. The 'cylindrical height' input is the length of just the straight section (not the total length of the capsule).Why does the tube calculator reject inner ≥ outer?
V = π·(R² - r²)·h where R is the outer radius and r is the inner radius. If r ≥ R, the result would be zero or negative — physically meaningless. The calculator hints you to make outer strictly greater than inner.How do cm³, mL, and liters relate?
Are these formulas exact or approximate?
Math.PI precision (about 15 significant digits), so chained conversions don't accumulate visible rounding error.Imperial or US gallon?
Are my numbers stored or sent anywhere?
localStorage so the toggles remember your last choice.