ThisCalculator

Physics

Density Calculator: Length, Width & Height

Updated · Standard formula, shown below

Density 1.00 g/cm³
Volume
100.00 cm³
Result
Length
10 cm
You entered
Width
5 cm
You entered

Density Calculator: Length, Width & Height

This calculator works out the density of a rectangular object from its length, width, height, and mass. You enter the three dimensions and the mass, and it returns the density in grams per cubic centimeter (g/cm³) or kilograms per cubic meter (kg/m³), depending on the unit you pick.

Formula

Density (�) equals mass (m) divided by volume (V). For a rectangular box, volume is length × width × height, so:

� = m / (l × w × h)

  • Ï� = density, in g/cm³ (or kg/m³)
  • m = mass, in grams (or kg)
  • l = length, in cm (or m)
  • w = width, in cm (or m)
  • h = height, in cm (or m)

If you use meters for all dimensions and kilograms for mass, the density comes out in kg/m³. If you use centimeters and grams, you get g/cm³. The calculator’s unit selector converts between these two common scales.

Worked Example

Using the default values: length = 10 cm, width = 5 cm, height = 2 cm, mass = 100 g.

  1. Volume = 10 × 5 × 2 = 100 cm³
  2. Density = 100 g ÷ 100 cm³ = 1.00 g/cm³

The calculator shows 1.00 g/cm³ and a volume of 100 cm³. This matches the expected result for a cube of water-like density, which is a useful sanity check.

Why Density Matters

Density tells you how much mass is packed into a given space. It’s a physical property of a material, so it can help identify substances (pure gold is about 19.3 g/cm³, while pine wood is around 0.5 g/cm³). For objects that are not a single material, density gives an average value that can indicate whether the object will float, sink, or something in between.

In engineering and manufacturing, density is used to calculate weight from volume, to design parts that meet weight limits, and to check for voids or air pockets inside cast or molded parts. In shipping, density (often called “volumetric weight�) determines freight class and cost.

How to Measure the Inputs

Accurate measurements matter more than the formula itself. Here’s how to get each number right:

  • Length, width, height: Use a ruler, caliper, or tape measure. Measure the longest dimension as length, the next as width, and the vertical as height—but order doesn’t affect the product. For irregular shapes, use water displacement instead.
  • Mass: Use a digital scale. For small objects, grams are convenient; for large objects, kilograms. Make sure the object is dry and free of loose debris.
  • Unit consistency: If you measure dimensions in cm, mass must be in grams to get g/cm³. If you use meters, mass must be in kilograms to get kg/m³. Mixing units (cm with kg) gives a wrong number.

Common Mistakes and How to Avoid Them

The most frequent error is mixing units. For example, measuring length in centimeters but mass in kilograms gives a density that is off by a factor of 1,000. Always convert to a consistent system first.

Another mistake is ignoring the shape. This calculator assumes a perfect rectangular prism. If the object has holes, rounded edges, or is not a box, the volume calculation will be wrong. For such objects, use water displacement or a 3D model to get the true volume.

Rounding too early can also skew results. Keep at least three significant figures during intermediate steps, then round the final density to two decimals as the calculator does.

Finally, remember that density changes with temperature. Most materials expand when heated, so their density decreases. If you need high precision, note the temperature of the object and the material’s thermal expansion coefficient.

How to Read the Result

The first output is the density in the unit you selected. The second output is the volume, which is useful on its own. A density below 1 g/cm³ means the object will float in water (water’s density is about 1 g/cm³ at room temperature). Above 1 g/cm³, it will sink.

For comparison, common densities: air at sea level is about 0.0012 g/cm³, aluminum is 2.7 g/cm³, iron is 7.87 g/cm³, and lead is 11.34 g/cm³. If your result is far from these for a known material, re-check your measurements.

Limits of the Formula

The formula � = m/V is exact for any homogeneous object, but the volume calculation via length × width × height is only valid for rectangular prisms. For spheres, cylinders, or irregular objects, you need a different volume formula. Also, if the object is hollow or porous, the “density� you compute is the bulk density, not the material’s true density. The calculator gives the average density of the whole object.

Another limitation: the calculator assumes uniform mass distribution. If the object has a heavy core and a light shell, the average density is still correct, but it doesn’t tell you about internal variations.

Frequently Asked Questions

What if my object is not a perfect box?

Then length × width × height overestimates the volume if the object is curved or has gaps. Use water displacement: submerge the object in a graduated cylinder and note the volume of water displaced. Then divide mass by that volume.

How do I convert between g/cm³ and kg/m³?

Multiply g/cm³ by 1,000 to get kg/m³. For example, 1 g/cm³ = 1,000 kg/m³. The calculator does this automatically when you switch the unit selector.

Why does density change with temperature?

Most materials expand when heated, increasing volume while mass stays the same. Since density = mass/volume, a larger volume means lower density. Water is an exception between 0°C and 4°C, where it contracts slightly.

Can I use this for liquids?

No, because liquids don’t have a fixed length, width, and height. For a liquid, measure the mass of a known volume (e.g., a graduated cylinder) and divide. This calculator is for solid rectangular objects only.

What is the difference between density and specific gravity?

Specific gravity is the ratio of a material’s density to the density of water (at a reference temperature). It has no units. For example, a density of 2.5 g/cm³ gives a specific gravity of 2.5. The calculator gives density, not specific gravity, but you can divide by 1 g/cm³ to get specific gravity.

Related

Formula used
in l | Length | cm | 10 | 0
in w | Width | cm | 5 | 0
in h | Height | cm | 2 | 0
in m | Mass | g | 100 | 0
sel unit | Density unit | g/cm³=1, kg/m³=1000
out d | Density | g/cm³ | m / (l * w * h) | 2
out v | Volume | cm³ | l * w * h | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.