3D Geometry Calculator
Calculate volume and surface area for common 3D shapes, with an interactive rotatable view
Drag (or swipe) the shape above to rotate it manually, or use the ⟳ button to auto-rotate.
What Is a 3D Geometry Calculator?
A 3D geometry calculator computes the volume and surface area of common three-dimensional shapes directly from their measurements — no manual formula lookup or arithmetic required. This version also renders a live, rotatable wireframe of the shape so you can visually check that your dimensions match what you intended.
Volume vs. Surface Area
Volume measures the amount of space enclosed inside a shape, in cubic units (like cm³ or in³) — think of it as how much the shape could hold if it were hollow. Surface area measures the total area of every outer face, in square units (like cm² or in²) — think of it as how much material would be needed to wrap the shape completely.
How to Use
- Select a shape from the buttons above
- Enter its dimensions — results and the 3D view update instantly
- Drag the 3D view to rotate it, or click ⟳ to auto-rotate
- Optionally choose a unit label in Advanced Options for display purposes
Formula Reference
| Shape | Volume | Surface Area |
|---|---|---|
| Cube | a³ | 6a² |
| Rectangular Prism (Cuboid) | l × w × h | 2(lw + lh + wh) |
| Sphere | (4/3)πr³ | 4πr² |
| Cylinder | πr²h | 2πr² + 2πrh |
| Cone | (1/3)πr²h | πr² + πr·slant |
| Square Pyramid | (1/3)a²h | a² + 2a·slant |
| Triangular Prism | baseArea × L | 2·baseArea + perimeter × L |
Important Assumptions
- All formulas assume right, regular shapes — a cylinder/cone with its apex directly above the center of a circular base, a pyramid with a square base centered under its apex, and a prism with a uniform cross-section extruded straight (not slanted).
- All dimensions should be entered in the same unit — the result will be in that unit cubed (volume) or squared (surface area).
- Radius, not diameter, is used everywhere a circular measurement is needed.
Understanding Slant Height
For cones and pyramids, slant height is the distance measured along the sloped side, not straight up. It's always found using the Pythagorean theorem: for a cone, slant = √(radius² + height²); for a square pyramid, slant = √(height² + (half the base)²). Several of the worked examples below use classic 3-4-5 right triangles to make this easy to verify by hand.
Worked Examples
Cube
Inputs: side a = 4
Volume: 64
Surface Area: 96
Space diagonal = 4√3 ≈ 6.93 — the longest straight line that fits inside the cube.
Rectangular Prism
Inputs: l = 5, w = 3, h = 2
Volume: 30
Surface Area: 62
Diagonal = √(25+9+4) = √38 ≈ 6.16.
Sphere
Inputs: radius r = 3
Volume: ≈113.10 (36π)
Surface Area: ≈113.10 (36π)
A fun coincidence: at r = 3, a sphere's volume and surface area are numerically equal (both 36π) — this only happens exactly at r = 3.
Cylinder
Inputs: r = 3, h = 5
Volume: ≈141.37 (45π)
Surface Area: ≈150.80 (48π)
Lateral surface area alone is ≈94.25 (30π), before adding the two circular ends.
Cone
Inputs: r = 3, h = 4
Volume: ≈37.70 (12π)
Surface Area: ≈75.40 (24π)
Slant height = √(3²+4²) = 5 — a classic 3-4-5 right triangle.
Square Pyramid
Inputs: base a = 6, h = 4
Volume: 48
Surface Area: 96
Slant height = √(4²+3²) = 5, another 3-4-5 triangle (half the base is 3).
Triangular Prism
Inputs: base b = 6, triangle height = 4, length L = 10
Volume: 120
Surface Area: 184
The two equal triangle sides are √(3²+4²) = 5 each, giving a perimeter of 16.
Frequently Asked Questions
What is the difference between volume and surface area?
Volume measures how much three-dimensional space a shape occupies (like how much water a container holds), measured in cubic units. Surface area measures the total area of all the outer faces of the shape (like how much wrapping paper you'd need to cover it), measured in square units.
Why do a sphere's volume and surface area formulas look related?
Volume is (4/3)πr³ and surface area is 4πr². If you take the derivative of the volume formula with respect to r, you get exactly the surface area formula — a neat calculus relationship that reflects how a sphere grows: each thin outer shell added is essentially its own surface area.
What's the difference between lateral and total surface area?
Lateral (or curved) surface area covers only the sides of a shape, excluding the top and bottom bases. Total surface area adds the base area(s) back in. For a cylinder, lateral surface area is just the curved side; total surface area also includes the two circular ends.
What is slant height, and how is it different from height?
Height is the straight vertical distance from the base to the apex (or top). Slant height is the distance along the sloped surface itself — for a cone, it's the distance from the base edge up to the apex along the cone's side, always longer than the vertical height (except in the degenerate case of a flat shape).
Does this calculator work for any pyramid or prism shape?
This calculator assumes regular, right shapes — a square base centered under the apex for pyramids, and a uniform cross-section extruded straight for prisms. Oblique or irregular-based shapes require different formulas not covered here.
Why does the 3D preview look like a wireframe instead of a solid shape?
The wireframe view is intentionally lightweight — it's drawn with plain Canvas drawing commands and no 3D graphics library, which keeps the page fast and dependency-free while still showing the shape's proportions and letting you rotate it freely.
How do I rotate the 3D shape?
Click and drag anywhere on the 3D view (or swipe on a touchscreen) to rotate it freely. Use the Auto-Rotate button to have it spin automatically, or Reset View to return to the default angle.
Do the units matter for these calculations?
The math itself is unit-agnostic — enter all dimensions in the same unit (all in cm, all in inches, etc.) and the result will be in that unit cubed (for volume) or squared (for surface area). Use the Unit Label option in Advanced Options to label your results for clarity.
What real-world tasks use volume and surface area calculations?
Volume is used for capacity planning — how much a tank, box, or container can hold. Surface area is used for material estimation — how much paint, wrapping, fabric, or metal sheeting is needed to cover a surface.
Why do some shapes use radius and others use diameter?
All formulas here consistently use radius (the distance from center to edge), not diameter (the full width across). If you only know the diameter, divide it by 2 before entering the radius field — mixing the two up is one of the most common geometry mistakes.
What is Cavalieri's principle, and how does it relate to volume?
Cavalieri's principle states that two solids with the same height and equal cross-sectional area at every level have the same volume, even if their shapes look different. It's part of why a cylinder's volume formula (πr²h) looks so similar in structure to a prism's (base area × height).
How accurate are the results?
Calculations use JavaScript's built-in double-precision math and the exact geometric formulas for each shape, so results are accurate to many decimal places — displayed rounded for readability.
Can I calculate a cube using the cuboid (rectangular prism) option instead?
Yes — entering the same value for length, width, and height in the Cuboid option gives you identical results to the dedicated Cube option, since a cube is just a special case of a rectangular prism.
Is this calculator free to use?
Yes, completely free, with no signup and no limit on how many shapes you calculate.