{
    "name": "Volume Calculator",
    "url": "https://calculators.geekmidst.com/calculators/volume-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/volume-calculator.md",
    "category": "Algebra, geometry & advanced math",
    "description": "Calculate the volume and surface area of a box, cube, cylinder, cone, sphere or pyramid, with the capacity in litres and US gallons.",
    "summary": "Pick a solid, enter its dimensions in one unit, and see its volume, its surface area and how much liquid it would hold.",
    "also_called": [
        "Capacity calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "shape",
            "label": "Shape",
            "type": "select",
            "default": "cylinder",
            "options": {
                "box": "Box (rectangular prism)",
                "cube": "Cube",
                "cylinder": "Cylinder",
                "cone": "Cone",
                "sphere": "Sphere",
                "pyramid": "Pyramid (rectangular base)"
            }
        },
        {
            "name": "unit",
            "label": "Measurements in",
            "type": "select",
            "default": "cm",
            "options": {
                "mm": "Millimetres",
                "cm": "Centimetres",
                "m": "Metres",
                "in": "Inches",
                "ft": "Feet",
                "yd": "Yards"
            }
        },
        {
            "name": "box_l",
            "label": "Length",
            "type": "number",
            "default": "30",
            "shown_when": {
                "shape": "box"
            }
        },
        {
            "name": "box_w",
            "label": "Width",
            "type": "number",
            "default": "20",
            "shown_when": {
                "shape": "box"
            }
        },
        {
            "name": "box_h",
            "label": "Height",
            "type": "number",
            "default": "10",
            "shown_when": {
                "shape": "box"
            }
        },
        {
            "name": "cube_a",
            "label": "Edge length",
            "type": "number",
            "default": "10",
            "shown_when": {
                "shape": "cube"
            }
        },
        {
            "name": "cyl_r",
            "label": "Radius",
            "type": "number",
            "default": "5",
            "shown_when": {
                "shape": "cylinder"
            }
        },
        {
            "name": "cyl_h",
            "label": "Height",
            "type": "number",
            "default": "10",
            "shown_when": {
                "shape": "cylinder"
            }
        },
        {
            "name": "cone_r",
            "label": "Base radius",
            "type": "number",
            "default": "3",
            "shown_when": {
                "shape": "cone"
            }
        },
        {
            "name": "cone_h",
            "label": "Height (tip to base, vertically)",
            "type": "number",
            "default": "4",
            "shown_when": {
                "shape": "cone"
            }
        },
        {
            "name": "sph_r",
            "label": "Radius",
            "type": "number",
            "default": "5",
            "shown_when": {
                "shape": "sphere"
            }
        },
        {
            "name": "pyr_l",
            "label": "Base length",
            "type": "number",
            "default": "6",
            "shown_when": {
                "shape": "pyramid"
            }
        },
        {
            "name": "pyr_w",
            "label": "Base width",
            "type": "number",
            "default": "6",
            "shown_when": {
                "shape": "pyramid"
            }
        },
        {
            "name": "pyr_h",
            "label": "Height (apex to base, vertically)",
            "type": "number",
            "default": "4",
            "shown_when": {
                "shape": "pyramid"
            }
        }
    ],
    "outputs": [
        {
            "key": "volume",
            "label": "Volume (your unit, cubed)",
            "format": "number"
        },
        {
            "key": "litres",
            "label": "Capacity in litres",
            "format": "number"
        },
        {
            "key": "us_gallons",
            "label": "Capacity in US gallons",
            "format": "number"
        },
        {
            "key": "surface_area",
            "label": "Surface area (your unit, squared)",
            "format": "number"
        }
    ],
    "formula": {
        "text": "Box L·W·H;  Cube a³;  Cylinder πr²h;  Cone ⅓πr²h;  Sphere ⁴⁄₃πr³;  Pyramid ⅓·L·W·H;  1 L = 1,000 cm³;  1 US gal = 3.785411784 L",
        "variables": {
            "L, W, H, a": "lengths of the edges",
            "r": "radius",
            "h": "perpendicular height"
        }
    },
    "worked_example": {
        "inputs": {
            "shape": "cylinder",
            "unit": "cm",
            "box_l": "30",
            "box_w": "20",
            "box_h": "10",
            "cube_a": "10",
            "cyl_r": "5",
            "cyl_h": "10",
            "cone_r": "3",
            "cone_h": "4",
            "sph_r": "5",
            "pyr_l": "6",
            "pyr_w": "6",
            "pyr_h": "4"
        },
        "steps": [
            "Volume = π × 5² × 10 = 250π ≈ 785.40 cm³.",
            "1 litre is 1,000 cm³, so the cylinder holds 785.40 ÷ 1,000 ≈ 0.785 L.",
            "Surface = 2πr(r + h) = 2π × 5 × 15 = 150π ≈ 471.24 cm²."
        ],
        "result": "A cylinder 10 cm across (radius 5 cm) and 10 cm tall holds about 785 cm³, or 0.79 litres."
    },
    "interpretation": "Volume is in your unit cubed (cm³ if you measured in centimetres). For a container, measure the inside dimensions to get the capacity rather than the outside size.",
    "assumptions": [
        "Solids are ideal shapes: right cylinders and cones, a pyramid with its apex above the centre of the base."
    ],
    "limitations": [
        "Wall thickness is not subtracted; use inside measurements for capacity."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why is a cone exactly one third of a cylinder?",
            "answer": "A cone with the same base and height as a cylinder always holds one third as much; the same is true of a pyramid and the box around it. Calculus proves it, and you can check it by filling one with the other."
        },
        {
            "question": "How many litres are in a cubic metre?",
            "answer": "Exactly 1,000. A cubic foot is about 28.32 litres."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Area Calculator",
            "url": "https://calculators.geekmidst.com/calculators/area-calculator"
        },
        {
            "name": "Concrete Calculator",
            "url": "https://calculators.geekmidst.com/calculators/concrete-calculator"
        },
        {
            "name": "Triangle Calculator",
            "url": "https://calculators.geekmidst.com/calculators/triangle-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}