Rectangular Prism Calculator: Volume, Area & Diagonal

Find a rectangular prism's volume, surface area, and space diagonal from length, width, and height — or solve backward from the volume, area, or diagonal.

Loading calculator…

The three rectangular prism formulas

A rectangular prism (also called a cuboid or box) is defined by its three edges: length ll, width ww, and height hh. Given all three, every other measure follows directly:

V=lwhS=2(lw+lh+wh)d=l2+w2+h2V = lwh \qquad S = 2(lw + lh + wh) \qquad d = \sqrt{l^2 + w^2 + h^2}

The surface area comes from adding up 3 pairs of identical rectangular faces — a l×wl \times w pair (top and bottom), a l×hl \times h pair (front and back), and a w×hw \times h pair (left and right) — hence the factor of 2 on each term. The space diagonal is the 3D extension of the Pythagorean theorem: it's the straight-line distance between two opposite corners of the box, cutting through the interior (the same formula used by a general 3D distance calculation).

Tip: A cube is just the special case where l=w=hl = w = h — every rectangular-prism formula here reduces to the cube's own V=a3V = a^3, S=6a2S = 6a^2, d=a3d = a\sqrt{3} when all three edges are equal.

Solving in the other direction

This calculator also works backward: give it the volume, surface area, or space diagonal together with length and width, and it solves for the height first, then derives the rest.

KnownSolve for heightThen
ll, ww, hh— (already known)V=lwhV = lwh, S=2(lw+lh+wh)S = 2(lw+lh+wh), d=l2+w2+h2d = \sqrt{l^2+w^2+h^2}
Volume VV, ll, wwh=V/(lw)h = V/(lw)S=2(lw+lh+wh)S = 2(lw+lh+wh), d=l2+w2+h2d = \sqrt{l^2+w^2+h^2}
Surface area SS, ll, wwh=(S2lw)/(2l+2w)h = (S - 2lw)/(2l + 2w)V=lwhV = lwh, d=l2+w2+h2d = \sqrt{l^2+w^2+h^2}
Space diagonal dd, ll, wwh=d2l2w2h = \sqrt{d^2 - l^2 - w^2}V=lwhV = lwh, S=2(lw+lh+wh)S = 2(lw+lh+wh)

Worked example: l = 4, w = 3, h = 2

V=4×3×2=24S=2(12+8+6)=52V = 4 \times 3 \times 2 = 24 \qquad S = 2(12 + 8 + 6) = 52 d=16+9+4=295.3852d = \sqrt{16 + 9 + 4} = \sqrt{29} \approx 5.3852

Because all three edges are whole numbers, the volume and surface area are EXACT integers, and the space diagonal has an exact simplified-radical form (29\sqrt{29}) in addition to its decimal approximation.

Worked example (reverse): volume V = 60, l = 4, w = 3

Dividing the volume by the base area gives h=60/(4×3)=5h = 60/(4\times3) = 5 exactly. Since the height lands on a clean whole number, the surface area and space diagonal also have tidy exact forms: S=2(12+20+15)=94S = 2(12+20+15) = 94 and d=16+9+25=507.0711d = \sqrt{16+9+25} = \sqrt{50} \approx 7.0711.

Tip: Remember volume is measured in CUBIC units (e.g. cm³) while surface area is SQUARE units (e.g. cm²) — the two numbers are never directly comparable, even for the same box.

Worked example (reverse): surface area S = 100, l = 4, w = 3

Rearranging the surface-area formula gives h=(10024)/145.4286h = (100-24)/14 \approx 5.4286 — not a clean whole number, so no exact form applies here. The volume comes out as V65.1429V \approx 65.1429 and the space diagonal as d7.3803d \approx 7.3803, both plain decimal approximations.

Common mistakes

  • Dropping a term under the space-diagonal square root. d=l2+w2+h2d = \sqrt{l^2+w^2+h^2} needs all three squared edges — leaving one out (e.g. treating it as a 2D diagonal) always understates the true distance.
  • Forgetting the factor of 2 in the surface area. A box has 3 PAIRS of faces, not 3 single faces — S=2(lw+lh+wh)S = 2(lw+lh+wh), not lw+lh+whlw+lh+wh.
  • Confusing the space diagonal with a face diagonal. A face diagonal only uses 2 of the 3 edges (e.g. l2+w2\sqrt{l^2+w^2} for the top face); the space diagonal cuts through the interior and always uses all 3.

Where this shows up

  • Boxes, rooms, tanks, shipping containers: the volume tells you how much they can hold; the surface area tells you how much material (cardboard, paint, wallpaper) is needed to cover them.
  • Fitting a rigid object diagonally: the space diagonal tells you the longest straight object (a pole, a screen) that can fit inside a box-shaped space.
  • The general case of the cube: every formula here reduces to the cube's own formulas when l=w=hl = w = h, and the same shape of formula (via x2+y2+z2\sqrt{x^2+y^2+z^2}) reappears as the plain 3D distance formula between two points.

A rectangular prism is the natural 3D extension of a rectangle — knowing its three edges (or two edges plus one of volume, surface area, or space diagonal) is always enough to determine every other measure.

Frequently asked questions

What are the formulas for a rectangular prism?
With length ll, width ww, and height hh: volume V=lwhV = lwh, total surface area S=2(lw+lh+wh)S = 2(lw + lh + wh), and space diagonal d=l2+w2+h2d = \sqrt{l^2+w^2+h^2}. Knowing all three edges is enough to find the other three measures.
How is a rectangular prism different from a cube?
A cube is the special case of a rectangular prism where all three edges are equal (l=w=hl = w = h). A general rectangular prism (also called a cuboid or box) allows each edge to be a different length.
How do I find the height if I only know the volume, length, and width?
Divide the volume by the base area: h = V/(lw). For example, a volume of 24 with l = 4 and w = 3 gives a height of 24/(4×3) = 2, since V = lwh rearranges to h = V/(lw).
How do I find the height if I only know the surface area, length, and width?
Rearrange the surface-area formula: h = (S − 2lw)/(2l + 2w). A surface area of 52 with l = 4 and w = 3 gives h = (52 − 24)/14 = 2, since S = 2(lw + lh + wh) solves for h that way.
How do I find the height from the space diagonal, length, and width?
Use the rearranged Pythagorean form: h = √(d² − l² − w²). A space diagonal of about 5.3852 with l = 4 and w = 3 gives h ≈ 2, since d = √(l²+w²+h²) rearranges to isolate h² first.
What is the most common mistake with rectangular prism formulas?
Leaving out one of the three terms under the square root for the space diagonal (it needs all of l², w², and h²), or forgetting the factor of 2 in the surface-area formula — a box has 3 PAIRS of identical faces, not 3 single faces.
Do volume and surface area have different units?
Yes. The three edges and the space diagonal share the same linear unit (e.g. cm), but surface area is that unit squared (e.g. cm²) and volume is that unit cubed (e.g. cm³) — a 4×3×2 cm box has a surface area of 52 cm² and a volume of 24 cm³, not the same number with a different label.
How is the rectangular prism related to the cube and the square?
A cube is the special case of a rectangular prism where l = w = h — the rectangular prism is the general 3D box shape. The space-diagonal formula √(l²+w²+h²) is also the 3D distance formula between two opposite corners, and a rectangular prism's rectangular cross-sections are the same rectangle formula extended one dimension.

Related calculators