Area & Volume Calculator
Calculate area of 2D shapes and volume of 3D solids.
Reviewed by Aygul Dovletova · Last reviewed
Using the Area and Volume Calculator
- Choose a dimension with the 2D / 3D toggle. 2D gives you flat shapes and reports area in square units; 3D gives you solids and reports volume in cubic units.
- Pick a shape from the grid. The 2D options include circle, rectangle, square, triangle, trapezoid, ellipse, and parallelogram; the 3D options include sphere, cube, cylinder, cone, rectangular prism, and pyramid.
- Fill the parameters. Each shape reveals only the fields it needs - radius for a circle, base and height for a triangle, three edges for a rectangular prism, and so on. Decimal inputs are allowed.
- Read the formula and result side by side. The tool renders the formula with your numbers substituted so you can see the arithmetic, and the numeric answer appears underneath.
- Switch shapes and the previously entered values clear, so there is no risk of accidentally reusing the radius of the last circle as the side of the next square.
What the Formulas Evaluate To
Internally the tool implements each formula as a small TypeScript function that takes the shape's parameters and returns the scalar area or volume. Circle: π * r². Rectangle: w * h. Triangle: 0.5 * b * h. Trapezoid: 0.5 * (a + b) * h. Ellipse: π * a * b where a and b are the semi-axes. Parallelogram: b * h. Sphere: (4/3) * π * r³. Cube: s³. Cylinder: π * r² * h. Cone: (1/3) * π * r² * h. Rectangular prism: l * w * h. Pyramid: (1/3) * base_area * h.
All constants come from Math.PI, the 64-bit IEEE 754 approximation of π. The tool does not use symbolic math, so the answers are numeric and subject to the usual floating-point rounding (about 15-17 decimal digits of precision). For most engineering and homework purposes that is three orders of magnitude more precise than your tape measure. Nothing leaves the browser; the inputs, formula rendering, and result are all computed in the Preact component.
Everyday Problems This Solves
- Sizing a circular rug or area rug by computing
π * r²to compare against a rectangular room. - Estimating how much paint is needed for a cylindrical water tank (lateral surface area is the paint, but volume is how much water it holds).
- Checking whether a box you ordered will fit a specific volume of packing material.
- Computing the cross-sectional area of a triangular roof truss for a loading calculation.
- Working out how much concrete is needed for a square slab of a given thickness.
- Designing a tabletop game where token volumes (spheres, cubes, pyramids) need to fit in a standard container.
Gotchas and Measurement Realities
- Unit consistency. The tool is unit-agnostic; if you enter centimetres for every field, the answer is in cm² or cm³. Mixing inches and centimetres between fields gives garbage - always convert first.
- Diameter vs. radius. Circles, spheres, cylinders, and cones ask for radius, which is half the diameter. Entering a diameter instead quadruples your area and octuples your volume.
- Triangle height, not side length. The triangle and pyramid formulas want the perpendicular height from the base to the opposite vertex, not the slant side. For pyramid volume it is the vertical height, not the slant edge.
- Ellipses need semi-axes. The parameters are the half widths along the two axes, not the full axis lengths.
- Negative or zero inputs are rejected at the UI layer because non-positive dimensions have no geometric meaning.
- Floating-point edge cases. Very small values (10-300) underflow; very large values (10308) overflow to Infinity. For normal real-world dimensions this never triggers.
Where the Formulas Come From
Most of these formulas were known in antiquity. The area of a circle as π * r² appears in Archimedes' Measurement of a Circle (3rd century BCE), which also gave the first rigorous bound on π. The volume of a sphere as (4/3) * π * r³ was famously proved by Archimedes using the method of exhaustion, and he asked for the sphere-inside-cylinder figure to be inscribed on his tomb. The cone volume as one-third of the enclosing cylinder was proved by Eudoxus and Archimedes alike. The trapezoid area and Heron's formula for a triangle from its three sides are in Heron of Alexandria's Metrica (1st century CE). ISO 80000-2 standardises the notation we use today: italic variables for lengths, roman π as the mathematical constant, and clear distinctions between V and v.
When a Specialised Tool Is Better
For CAD work with complex shapes (torus, NURBS surface, arbitrary mesh), a dedicated CAD package - Fusion 360, SolidWorks, FreeCAD, Blender - computes volume and surface area of a polyhedral mesh directly. For symbolic answers (what is the volume of a cone as an expression in its half-angle?) you want a CAS like SymPy or Mathematica. For volumes computed from a point cloud, a mesh library like Open3D or MeshLab is required. Excel has basic geometry through its formula engine but no shape UI. This browser tool wins when your shape is on the standard list and you want a fast numeric answer with the formula visible - which covers the overwhelming majority of everyday geometry questions.
Frequently Asked Questions
Why ask for radius instead of diameter?
Standard geometric formulas are expressed in terms of radius: <em>π * r²</em> is cleaner than <em>π * (d/2)²</em>, and ISO 80000-2 follows the same convention. Accepting diameter would invite the common mistake of forgetting whether the field expects the full or the half. Divide your diameter by 2 before entering.
Are the inputs ever sent to a server?
No. The Preact component computes every area and volume locally in the browser. There are no fetch calls, no analytics beacons attached to your measurements, and no persistent storage. If you are measuring sensitive dimensions for a product prototype or a real-estate contract, nothing leaves your device.
How precise are the answers?
Every computation runs in IEEE 754 binary64 double precision, which preserves about 15-17 significant decimal digits. The practical precision is much lower because it is limited by the precision of your inputs: a tape measure good to the nearest millimetre means the result is precise to no more than 3-4 significant figures no matter how many decimal places the output prints. Treat the output as "as precise as the input allows".
Why does a pyramid or cone ask for height and not slant?
Volume depends on the vertical (perpendicular) height from the base to the apex, not the slant distance along a side. The formulas are <em>V = (1/3) * base_area * h</em> for a pyramid or cone. If you only have the slant edge, you need to compute the perpendicular height first using the Pythagorean theorem relative to the base - which is why surveying a real cone takes a plumb line, not a ruler against the surface.
Is the tool safe for mixed units?
Only if you do the unit conversion yourself before entering. The tool treats every number as unit-less and returns area or volume in the same implied unit squared or cubed. Entering some dimensions in cm and others in m will give a number that is off by factors of 100 or more. When in doubt, convert everything to a single unit before typing.
Does it handle compound shapes like an L-shaped room?
Not directly. Break the shape into the primitive 2D or 3D shapes it supports, compute each area or volume, and add or subtract the pieces. An L-shaped room is two rectangles; a cup is a cylinder minus a smaller cylinder; a frustum is a large cone minus the small cone cut off at the top. For highly irregular shapes, a CAD mesh or a Monte Carlo integration in a notebook is the next step.
What is the formula for an ellipse area?
The area of an ellipse with semi-axes <em>a</em> and <em>b</em> is <em>π * a * b</em>. This generalises the circle area <em>π * r²</em>, which you recover when <em>a = b = r</em>. Note that the perimeter of an ellipse has no elementary closed form and requires an elliptic integral - the tool therefore does not compute perimeter, only area.
Why is the trapezoid area (a + b) * h / 2?
A trapezoid has two parallel sides of lengths <em>a</em> and <em>b</em>; the area equals the product of the average of those two lengths and the perpendicular distance between them. Geometrically, rotating a copy of the trapezoid 180 degrees and placing it next to the original produces a parallelogram of base <em>a+b</em> and height <em>h</em>; the area of the parallelogram is twice the trapezoid's, which gives the formula.
Can I calculate surface area in addition to volume?
The current build focuses on area for 2D shapes and volume for 3D shapes. Surface area of 3D solids (the outer skin) is a separate calculation - for a cylinder it is <em>2πrh + 2πr²</em>, for a cone <em>πr² + πr√(r²+h²)</em>, and so on. For now compute these by hand from the radius and height, or use a dedicated geometry reference.
How did Archimedes calculate π?
In his <em>Measurement of a Circle</em> Archimedes inscribed and circumscribed regular polygons inside and around a unit circle, doubling the number of sides up to 96, and bounded π between 3 + 10/71 and 3 + 1/7. The modern IEEE 754 approximation used here agrees with true π to 15 decimal places.
Is this also a 3D shape calculator for volume problems?
Yes. The 3D toggle exposes sphere, cube, cylinder, cone, rectangular prism, and pyramid, each with its own parameter set. Volume is reported in the cubed unit of whatever you typed, and the formula is rendered above the answer so you can verify the substitution. For 3D shape calculator use cases - sizing a tank, estimating concrete for a footing, or volumetric weight on a freight quote - the 3D side handles the standard catalogue without leaving the page.
Can I go from area to volume or volume to area in one workflow?
You can, but they are different shapes. Area is a 2D measurement (square units) and volume is 3D (cubed units), so the relationship between an "area to volume" pair depends on the third dimension you add. For a flat shape extruded into a prism, multiply the area by the extrusion height to get volume; for a "volume to area" question of a solid base, use the rectangular prism (or cylinder) formula and divide volume by height to recover the base area. The calculator handles each step independently rather than chaining them automatically, so you stay in control of which dimension is the extrusion.
More Math & Calculators
Age Calculator
Calculate exact age in years, months and days from a birthdate.
Open toolBMI Calculator
Calculate your Body Mass Index and find your weight category.
Open toolByte / Bit Converter
Convert between bits, bytes, KB, MB, GB, TB and PB.
Open toolDiscount Calculator
Calculate discount amount, sale price, savings, and discounted value with optional sales tax. Supports stacked coupons.
Open toolFibonacci Sequence Generator
Generate Fibonacci numbers up to any length.
Open toolFraction Calculator
Add, subtract, multiply and divide fractions with simplified results.
Open tool