Understanding the pyramid calculator — concept and principle
A pyramid has a polygon base and triangular faces meeting at one top point, the apex. This calculator handles a right pyramid with a square or rectangular base, the apex directly above the base centre. It returns the volume and total surface area, useful for geometry homework, roof or cap material estimates, and the capacity of pyramid-shaped containers.
How it is calculated
- Volume: V = (a × b × h) ÷ 3, where a is the base length, b the base width and h the perpendicular height from the base to the apex.
- Slant heights: the two faces standing on the sides of length a have slant height s₁ = √(h² + (b/2)²); the two faces on the sides of length b have s₂ = √(h² + (a/2)²).
- Surface area: A = a × b + a × s₁ + b × s₂. The first term is the base; each pair of identical triangles contributes 2 × (½ × side × slant height).
Use one length unit; volume is in cubic units and area in square units.
The principle
The factor 1/3 is the heart of the formula. Euclid's Elements proves that a prism splits into three pyramids of equal volume with the same base and height. In calculus terms, a horizontal slice at height y is a rectangle whose sides shrink linearly to zero at the apex, so its area is proportional to (1 − y/h)²; integrating from 0 to h gives one third of base area × height. The rule holds for any base shape, even with an off-centre apex, as long as h is the perpendicular height. Each face's slant height comes from the Pythagorean theorem.
Worked example
- Inputs: base length a = 6, base width b = 6, height h = 4.
- Volume: 6 × 6 × 4 ÷ 3 = 144 ÷ 3 = 48.
- Slant height: √(4² + 3²) = √25 = 5 (the same for all four faces because the base is square).
- Lateral faces: 6 × 5 + 6 × 5 = 60. Base: 6 × 6 = 36.
- Surface area: 36 + 60 = 96.
| Base length | Volume |
|---|---|
| 1.5 | 12 |
| 3 | 24 |
| 4.5 | 36 |
| 6 | 48 |
| 7.5 | 60 |
| 9 | 72 |
| 12 | 96 |
How to read the result
The volume is one third of the enclosing box (144). Doubling the height doubles it; doubling both base sides quadruples it. The surface area includes the base; for the sloping sides only, subtract a × b: 96 − 36 = 60.
Common mistakes
- Entering the slant height instead of the perpendicular height. The calculator expects the vertical height and works out the slant height itself.
- Forgetting the 1/3 and getting the volume of a prism instead.
- Treating the lateral edge (base corner to apex) as the slant height.
Frequently asked questions
How do I find the height if I only know the slant height?
For a square base of side a, h = √(s² − (a/2)²). With s = 5 and a = 6, h = √(25 − 9) = 4.
Does the formula work for a triangular or hexagonal pyramid?
The volume rule V = base area × h ÷ 3 works for any base, but the surface area formula here is only for rectangular bases.
Is the lateral edge the same as the slant height?
No. The lateral edge runs to a corner: √(h² + (a/2)² + (b/2)²). For the example, √(16 + 9 + 9) ≈ 5.83.
Sources: Euclid, Elements, Book XII, Proposition 7 and its corollary (a pyramid is one third of the prism with the same base and height) · D. Zwillinger (ed.), CRC Standard Mathematical Tables and Formulae, CRC Press