🧮
🧮 Math & statistics

Cube & Rectangular Box Calculator

Results update as you type.

Your numbers

Understanding the cube and rectangular box calculator — concept and principle

A rectangular box, or cuboid, is a solid with six rectangular faces meeting at right angles; a cube is the special case where all three edges are equal. This calculator gives the volume, the total surface area and the space diagonal (the longest straight line inside the box, from one corner to the opposite corner). People use it for packaging, tank or room capacity, concrete quantities and checking whether a long object fits.

A 4 by 3 by 2 box made of unit cubes, with its space diagonalTwo layers of 4 × 3 = 12 cubes make 24, the volume. The faces are 12, 6 and 8, each twice, for 52. The floor diagonal is √(16 + 9) = 5, and with the height 2 the space diagonal is √29 ≈ 5.39.A box built from 24 unit cubeslength 4width 3height2floor 5√292corner to corner4 × 3 × 2volume 242(12+6+8)surface 52diagonal √29≈ 5.39√(4² + 3²) = 5, then √(5² + 2²) = √29
Count cubes for volume, add six faces for area, use Pythagoras twice for the diagonal.

How it is calculated

For a cube with edge a, these become V = a³, A = 6a² and d = a√3. Use one unit for all three edges; volume is in cubic units, area in square units and the diagonal in the same length unit.

The principle

Volume counts how many unit cubes fill the box: l × w cubes cover the floor in one layer, and there are h layers. The surface area simply adds the areas of the six faces. The space diagonal uses the Pythagorean theorem twice. First, the floor diagonal is √(l² + w²). That floor diagonal and the vertical edge h form a right triangle whose hypotenuse is the space diagonal, so d² = (l² + w²) + h². This is the same as the distance formula in three dimensions between opposite corners (0, 0, 0) and (l, w, h).

Worked example

  1. Inputs: length 4, width 3, height 2.
  2. Volume: 4 × 3 × 2 = 24.
  3. Face areas: lw = 12, wh = 6, lh = 8; sum = 26.
  4. Surface area: 2 × 26 = 52.
  5. Space diagonal: √(16 + 9 + 4) = √29 ≈ 5.385164807.
How Volume changes with LengthHow Volume changes with Length010203040501234568Example: 24Length
Each point is the calculator re-run with only “Length” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
LengthVolume
16
212
318
424
530
636
848

How to read the result

If the dimensions are in centimetres, the box holds 24 cm³, which is 24 mL, because 1 cm³ = 1 mL and 1,000 cm³ = 1 L. The diagonal of about 5.39 means a thin rod up to that length fits inside, even though the longest edge is only 4. For a fixed volume, a cube has the smallest surface area of any rectangular box.

Common mistakes

Keep in mind: The results describe an ideal box with flat faces and sharp corners. For shipping, construction or material orders, allow for wall thickness, rounded corners, settling and waste, and check carrier or code rules where they apply.

Frequently asked questions

How do I convert the volume to litres?

With centimetres, divide cm³ by 1,000. With metres, multiply m³ by 1,000. 24 cm³ is 0.024 L.

What is the surface area of a box without a lid?

Subtract one top face: 2(lw + wh + lh) − lw. For the example, 52 − 12 = 40.

Does a 5 m pole fit in a 4 × 3 × 2 m room?

Yes, in principle, since the space diagonal is about 5.39 m; in practice the pole's thickness and the room's openings also matter.

Sources: D. Zwillinger (ed.), CRC Standard Mathematical Tables and Formulae, CRC Press · BIPM, The International System of Units (SI Brochure), definition of the litre as one cubic decimetre

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

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