How to use the pyramid and prism volume calculator
This calculator finds the volume of a prism, a pyramid or a frustum whose base is a regular n-gon. The number of sides can be anything from 3 to 100, so a triangular prism and a ten-sided pyramid are handled on the same screen, and the base area is reported alongside the volume.
The area of the regular n-gon base is A = n a² ÷ (4 tan(π/n)). From there a prism is V = A × h, a pyramid is V = A × h ÷ 3 and a frustum is V = h ÷ 3 × (A₁ + A₂ + √(A₁A₂)), and the formula line prints which formula ran with which values.
Choosing the pyramid also shows the volume of a prism with the same base and height, so you can confirm at a glance that the pyramid is exactly one third of it. For a frustum the top side must be smaller than the base side: equal sides would be a prism and a larger top would flip the shape, so both cases produce a message.
A number of sides that is not a whole number or is below 3 cannot form a solid, and a side or height of 0 or less is not calculated either. Because tan and √ often make the result irrational, values are shown to six decimal places while the calculation itself runs unrounded. Volumes are in the cube of whatever length unit you entered.
Frequently Asked Questions
With base area A and height h, a prism is V = A × h and a pyramid is V = A × h ÷ 3. For a regular n-gon base, A = n a² ÷ (4 tan(π/n)).
With base area A₁, top area A₂ and height h, the volume is V = h ÷ 3 × (A₁ + A₂ + √(A₁A₂)). Letting the top shrink to 0 turns this into the pyramid formula.
Yes. The number of sides runs from 3 to 100, so triangular, pentagonal and hexagonal bases all work on the same screen. Only regular n-gon bases with equal sides are supported; arbitrary polygon bases are not.