molecalculator

Moles & Molar Mass

Volume Formula with Height and Diameter

Calculator No. 01-16760 · Updated · Formula and assumptions shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

To find the volume of a cylinder, use the formula V = π(D/2)²h, where D is the diameter and h is the height. For a sphere, the volume is V = (π/6)D³, using only diameter (height = diameter). For other shapes, height and diameter alone are insufficient.

Formula Derivation and Explanation

The volume of a three-dimensional shape quantifies the space it occupies, measured in cubic units (e.g., m³, cm³, L). When height and diameter are the only given linear dimensions, the most common applicable shape is a right circular cylinder—think of a can, pipe, or column. Its volume derives from the area of its circular base multiplied by height. The base area is A = πr², and since radius r = D/2, substituting yields A = π(D/2)². Multiplying by height h gives the cylinder volume formula:

V = π(D/2)²h = (πD²h)/4

For a sphere, diameter fully defines size; its volume is V = (4/3)πr³ = (4/3)π(D/2)³ = (π/6)D³. Note that in this case, “height” equals diameter by symmetry, so no separate height input is needed. For cones, pyramids, or ellipsoids, height and one diameter (e.g., base diameter) are necessary but insufficient without additional parameters (e.g., top diameter for a frustum). Always verify the shape before applying a formula.

When the Cylinder Formula Applies

The cylinder volume formula is valid only for a right circular cylinder: a solid with two parallel, congruent circular bases connected by a curved surface, where the lateral surface is perpendicular to the bases. This excludes:

  • Oblique cylinders, where the sides are slanted; volume still equals base area × height (per Cavalieri’s principle), but measuring perpendicular height is critical.
  • Non-circular cross-sections, such as square or rectangular prisms—these use V = base area × height, but base area isn’t π(D/2)².
  • Hollow cylinders (pipes, tubes); use V = π(D² − d²)h/4, where d is the inner diameter.

In engineering and manufacturing, cylinders dominate: fuel tanks, hydraulic pistons, columnar scaffolds, and pipe segments all conform to this geometry. In laboratories, graduated cylinders for liquid measurement approximate this shape, though calibration accounts for meniscus and wall thickness.

Step-by-Step Calculation Process

To compute cylinder volume from diameter and height:

  1. Measure diameter accurately using calipers or a tape measure across the widest part of the circular face.
  2. Measure height perpendicularly between the two bases; ensure it’s the true vertical or axial height, not slant length.
  3. Convert units consistently (e.g., both in meters, or both in inches).
  4. Compute radius: divide diameter by 2.
  5. Square the radius.
  6. Multiply by π (≈ 3.14159265358979).
  7. Multiply by height to obtain volume in cubic units.

For example, a cylinder with diameter 10 cm and height 25 cm:

– Radius = 10 cm / 2 = 5 cm
– Base area = π × (5 cm)² = 25π cm² ≈ 78.5398 cm²
– Volume = 78.5398 cm² × 25 cm = 1963.495 cm³

This equals 1963.5 mL (since 1 cm³ = 1 mL), or ≈0.519 US gallons.

Common Unit Conversion Pitfalls

Unit mismatches are the leading source of error. Key conversions:

  • 1 m = 100 cm → 1 m³ = 1,000,000 cm³
  • 1 L = 1000 mL = 1000 cm³
  • 1 ft = 12 in → 1 ft³ = 1728 in³; 1 US gallon = 231 in³ = 3.78541 L
  • 1 barrel (oil) = 42 US gallons ≈ 158.987 L

A frequent mistake is forgetting to square the diameter-to-radius conversion. For instance, using V = πD²h (omitting the /4) overestimates volume by 4×. Similarly, entering diameter in inches but height in meters without conversion yields nonsensical results. Always write units in calculations and cancel them algebraically.

Real-World Applications and Examples

Industrial Tank Sizing

A vertical storage tank for liquid nitrogen has an inner diameter of 1.2 m and height of 2.8 m. Its usable volume is:

V = π × (0.6 m)² × 2.8 m = π × 0.36 × 2.8 ≈ 3.1667 m³ = 3166.7 L

This determines cryogenic inventory capacity and insulation requirements.

Medical Device Design

A syringe barrel has a diameter of 12 mm and a stroke length (height) of 40 mm. Its volume is:

V = π × (6 mm)² × 40 mm = π × 36 × 40 ≈ 4523.89 mm³ = 4.52389 cm³ = 4.52 mL

This matches standard 5 mL syringe capacities—designers adjust diameter or height to achieve exact volumes.

Geology and Core Sampling

Geologists extract cylindrical rock cores. A 2-inch diameter core sample that is 6 inches long has volume:

V = π × (1 in)² × 6 in = 6π ≈ 18.85 in³ = 308.8 cm³

Porosity calculations compare this geometric volume to the volume of extracted fluid.

Assumptions and Limitations

The formula assumes:

  • The cylinder is perfectly circular in cross-section (no ovality or taper).
  • Height is measured perpendicularly between parallel bases.
  • Material is homogeneous and solid (no voids or internal compartments).
  • Temperature and pressure do not significantly deform the object (relevant for flexible containers).

For thin-walled tubes, the formula gives internal volume only if diameter and height refer to inner dimensions. External volume requires outer diameter. Manufacturing tolerances may cause ±1–2% deviation; high-precision applications (e.g., calibration standards) use liquid displacement or interferometry for verification.

Frequently Asked Questions

Can I use diameter and height to find the volume of a cone?

Yes, but the formula differs: V = (1/3)π(D/2)²h. The cone’s volume is one-third that of a cylinder with the same base diameter and height. Ensure you’re not confusing a cone with a cylinder—cones taper to a point, while cylinders maintain constant cross-section.

What if the object isn’t a perfect cylinder—how accurate is the approximation?

For slightly tapered or irregular objects (e.g., a tree trunk), the cylinder formula gives a rough estimate. Accuracy depends on deviation: a 5% taper may cause ~2–3% volume error. For precision, use the trapezoidal rule with multiple diameter measurements along the height, or 3D scanning.

Does the formula work for non-metric units?

Yes, as long as diameter and height share the same unit. Volume will be in cubic units of that system (e.g., in³, ft³). Convert to liters or gallons afterward using exact factors: 1 ft³ = 28.3168 L, 1 in³ = 16.3871 mL. Never mix units in the formula (e.g., diameter in cm and height in m).

Why is radius used instead of diameter in the standard formula?

The circle area formula is fundamentally derived from radius: A = πr². Using diameter requires substituting r = D/2, introducing the /2 factor twice (squared), hence the /4 in V = (πD²h)/4. You can compute directly with diameter—just remember to divide by 2 first.

How does temperature affect volume calculations?

Thermal expansion changes physical dimensions. For metals, α ≈ 10⁻⁵ /°C means a 10°C rise increases diameter by ~0.01%, height similarly, so volume changes by ~0.03%. For liquids inside containers, both container volume and liquid expansion matter. In high-precision work (e.g., metrology labs), corrections using coefficient of thermal expansion (α) are applied: ΔV/V ≈ 3αΔT.

Is there a difference between internal and external volume?

Yes. Internal volume (capacity) uses inner diameter and inner height. External volume (displacement) uses outer dimensions. For a pipe with wall thickness t, inner diameter = outer diameter − 2t. Always specify which is intended—engineering drawings distinguish “ID” and “OD”.

Related

Formula used
in d | Diameter | m | 0.05 | 0
in h | Height | m | 0.12 | 0
out v | Cylinder volume | m³ | pi * (d/2)^2 * h | 6
out v_l | Volume in liters | L | v * 1000 | 2
out v_gal | Volume in US gallons | gal | v_l / 3.78541 | 4

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 with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →