Volume Calculator Widget

Add a 3D shapes calculator to your geometry, packaging or tank page. Pick a cube, box, cylinder, cone, sphere, hemisphere, square pyramid, triangular prism or capsule, enter its dimensions in millimetres to yards, and read off the volume, the capacity in litres and US and imperial gallons, and the total surface area.

Education & Math Calculator Runs in your browser Free · no ads

Customize your widget

Theme
Auto follows the visitor's light/dark setting.
Style
Attribution on your page
Optional and entirely your choice. The exact line is shown in the code below; it links to the tool with rel="nofollow".
More options
Starting values
Leave blank to use the widget's defaults. Visitors can still change every value.

Live preview

Exactly what your visitors will see

Embed code

<iframe src="https://a2z.tools/embed/w/volume-calculator" title="Volume Calculator by A2Z Tools" width="100%" height="600" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>

A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.

Works with

How it works

Only the measurements a solid needs are shown: a radius and height for a cylinder or cone, three triangle sides and a length for a prism, a radius and the straight length for a capsule. Volume and surface area are worked out in the chosen unit and then converted to litres through the exact length definitions (an inch is 0.0254 m, a foot 0.3048 m) and 1 litre = 1,000 cubic centimetres. Gallons use the legal definitions listed by NIST: the US gallon is 231 cubic inches, 3.785411784 L, and the imperial gallon is 4.54609 L, so the same tank shows two different gallon figures. The triangular prism takes its base area from the three sides by Heron's formula and rejects sides that cannot close. A hemisphere's surface includes its flat base, and a cone's includes the base disc plus the slanted side, whose slant height is shown separately. The Metric/Imperial switch only changes the default unit.

Calculation method

  • Cylinder V = pi r^2 h, A = 2 pi r (r + h); cone V = pi r^2 h / 3, A = pi r (r + sqrt(r^2 + h^2))
  • Sphere V = 4/3 pi r^3, A = 4 pi r^2; hemisphere V = 2/3 pi r^3, A = 3 pi r^2
  • Square pyramid V = s^2 h / 3; capsule V = pi r^2 l + 4/3 pi r^3
  • Triangular prism V = T l with T from Heron; cuboid V = l w h
  • 1 L = 1000 cm^3; US gallon = 3.785411784 L; imperial gallon = 4.54609 L

Worked examples

A drinking glass

Inputs: Cylinder, radius 5 cm, height 10 cm

Result: 785.3982 cm^3 = 0.785398 L; surface 471.2389 cm^2

pi x 25 x 10 and 2 pi x 5 x 15.

One US gallon box

Inputs: Cuboid 7 x 11 x 3 in

Result: 231 in^3 = 3.785 L = 1 US gallon = 0.8327 imperial gallons

231 cubic inches is the legal definition of the US gallon.

Limitations

  • Solid shapes only - wall thickness, hollow pipes and partly filled tanks are not modelled.
  • One unit for all dimensions; mixing feet and inches needs converting first.
  • Results show four decimals, which can hide differences in very small parts measured in yards.

Where publishers use it

  • Geometry lessons on mensuration of solids
  • Water-tank and aquarium sites converting dimensions to litres
  • Packaging and shipping guides sizing boxes and tubes
  • Kitchen and brewing blogs measuring pots and fermenters
  • Pharmacy and lab pages working out capsule and vial capacity

Questions

How many litres does a cylinder 5 cm in radius and 10 cm tall hold?

pi x 5^2 x 10 = 785.4 cm^3, which is 0.785 litres, because 1 litre is 1,000 cubic centimetres.

Why are US and imperial gallons different?

The US gallon is defined as 231 cubic inches (3.785 L); the imperial gallon as 4.54609 L. A 231 cubic-inch box holds exactly 1 US gallon but only 0.8327 imperial gallons.

How many gallons are in a cubic foot?

About 7.4805 US gallons: 0.3048^3 m^3 is 28.3168 litres, divided by 3.785411784.

Does the hemisphere surface area include the flat side?

Yes, it is 3 pi r^2: the curved half-sphere (2 pi r^2) plus the circular base (pi r^2). For an open bowl subtract pi r^2.

What length does the capsule ask for?

The straight cylindrical part only, not the overall length. A capsule 2 cm long between hemispherical ends of radius 1 cm is 4 cm long overall.

Sources

  1. NIST Guide to the SI, Appendix B.9: Factors for units listed by kind of quantity - NIST . Volume factors: US gallon 3.785412 L, imperial gallon 4.54609 L, cubic foot 2.831685 E-02 m^3

Cite or recommend this tool

If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.

A2Z Tools Volume Calculator
https://a2z.tools/embed/volume-calculator
  • Triangle Calculator

    Education & Math Calculator New

    Solve a triangle from SSS, SAS, ASA, AAS or two sides of a right triangle: sides, angles, area, type.

    Get code
  • Unit Converter

    Education & Math Converter

    Length, mass, volume, area, temperature, speed, time, data, pressure, energy and power - exact factors.

    Get code
  • Square Footage Calculator

    Real Estate Calculator

    Total floor area of up to six rectangles, circles and triangles in sq ft and square metres.

    Get code
  • Percentage Calculator

    Education & Math Calculator

    X% of Y, X as a percent of Y, and the percentage change between two values.

    Get code
  • Basic Calculator

    Education & Math Calculator

    A clean on-screen calculator with keyboard support, correct operator precedence and percent.

    Get code
  • Scientific Calculator

    Education & Math Calculator

    Trig in degrees or radians, logs, roots, powers, factorials, pi, e and Ans - typed or tapped.

    Get code

Preview