How this calculator works
Choose a shape—box, cube, cylinder, sphere, cone, square pyramid, or triangular prism—enter its dimensions, and get the total surface area plus the volume for context. Every formula uses the exact value of pi (via Math.PI) rather than an approximation like 3.14, so results stay accurate at any scale.
For a cone and a square pyramid, the slant height (the distance along a sloped face, not the straight vertical height) is derived automatically from the radius/base and vertical height using the Pythagorean theorem, so you only need to enter the measurements you'd actually take with a tape measure.
The formulas
Box: SA = 2(lw + lh + wh), Volume = lwhCube: SA = 6s^2, Volume = s^3Cylinder: SA = 2*pi*r^2 + 2*pi*r*h, Volume = pi*r^2*hSphere: SA = 4*pi*r^2, Volume = (4/3)*pi*r^3Cone: slant l = sqrt(r^2 + h^2), SA = pi*r^2 + pi*r*l, Volume = (1/3)*pi*r^2*hSquare pyramid: slant l = sqrt(h^2 + (base/2)^2), SA = base^2 + 2*base*l, Volume = (1/3)*base^2*hTriangular prism: SA = 2*(triangle area) + (triangle perimeter)*length, Volume = (triangle area)*lengthWorked example: a square pyramid with base 6 and height 4
- Half the base is 3, and the vertical height is 4, so the slant height is sqrt(4^2 + 3^2) = sqrt(25) = 5.
- The base area is 6^2 = 36.
- The four triangular faces each have area (1/2)*6*5 = 15, for a lateral area of 4*15 = 60.
- Total surface area = 36 + 60 = 96. Volume = (1/3)*36*4 = 48.
Frequently asked questions
What's the difference between the pyramid's height and its slant height?
The height is the straight vertical distance from the apex down to the center of the base. The slant height is the distance along the surface of one triangular face, from the apex down to the midpoint of a base edge. They're only equal for a flat (zero-height) shape, so surface area calculations need the slant height, not the vertical height, for the side faces.
Does the cylinder and cone surface area include the flat ends?
Yes—these are total surface area formulas, including both circular ends of the cylinder and the circular base of the cone, plus the curved lateral surface. If you only need the lateral (side) surface, subtract the base area(s) from the total.
Why does the triangular prism need three side lengths instead of a base and height?
Using the three actual side lengths (via Heron's formula for area) lets the calculator also compute the triangle's perimeter directly, which is needed for the three rectangular side faces of the prism. It also naturally catches an invalid triangle before computing anything.
Why is a sphere's surface area exactly four times its great-circle area?
A sphere's great circle (the largest possible circular cross-section) has area pi*r^2, and Archimedes proved the sphere's total surface area is exactly 4 times that, a relationship that has held since antiquity and is still the standard sphere surface area formula today.
Can these formulas be used for real-world material estimates, like paint or wrapping?
Yes, surface area is exactly what you need for paint, wallpaper, or wrapping material coverage, while volume tells you capacity (for water, concrete, or storage). Just remember these formulas describe the idealized geometric shape; add extra material for overlap, waste, or an uneven surface.