🧮
🧮 Math & statistics

Pyramid Calculator (square or rectangular base)

Results update as you type.

Your numbers

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.

Square pyramid with base 6 by 6 and height 4The pyramid stands 4 high on a 6 by 6 base. Three pyramids of sand fill the 6 × 6 × 4 box of 144, so one is 48. Half the base (3) and the height (4) give a slant height of 5; each triangular face is ½ × 6 × 5 = 15, and 36 + 4 × 15 = 96.A pyramid is ⅓ of its boxh = 4566slant height= 3-4-5 triangle× 36·6·4 = 144volume 144 ÷ 3= 48one face ½ × 6 × 5= 15surface = base 36 + 4 faces × 15= 36 + 60 = 96
Volume = base × height ÷ 3; the slant height comes from a 3-4-5 triangle.

How it is calculated

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

  1. Inputs: base length a = 6, base width b = 6, height h = 4.
  2. Volume: 6 × 6 × 4 ÷ 3 = 144 ÷ 3 = 48.
  3. Slant height: √(4² + 3²) = √25 = 5 (the same for all four faces because the base is square).
  4. Lateral faces: 6 × 5 + 6 × 5 = 60. Base: 6 × 6 = 36.
  5. Surface area: 36 + 60 = 96.
How Volume changes with Base lengthHow Volume changes with Base length0204060801001.534.567.5912Example: 48Base length
Each point is the calculator re-run with only “Base length” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Base lengthVolume
1.512
324
4.536
648
7.560
972
1296

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

Keep in mind: The formulas assume a right pyramid with a rectangular base. Real roofs need margins for thickness and waste, and structural designs must follow local codes and a qualified professional.

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

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →