{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://askcalculators.com/calculator/volume-calculator/schema.json",
  "title": "Volume Calculator inputs",
  "description": "Calculate volume and related surface measurements for eleven common three-dimensional shapes.",
  "type": "object",
  "properties": {
    "shape": {
      "title": "Solid",
      "type": "string",
      "default": "sphere",
      "enum": [
        "sphere",
        "cone",
        "cube",
        "cylinder",
        "box",
        "capsule",
        "spherical-cap",
        "frustum",
        "ellipsoid",
        "square-pyramid",
        "tube"
      ],
      "x-optionLabels": {
        "sphere": "Sphere",
        "cone": "Cone",
        "cube": "Cube",
        "cylinder": "Cylinder",
        "box": "Rectangular tank",
        "capsule": "Capsule",
        "spherical-cap": "Spherical cap",
        "frustum": "Conical frustum",
        "ellipsoid": "Ellipsoid",
        "square-pyramid": "Square pyramid",
        "tube": "Tube"
      }
    },
    "sphereRadius": {
      "title": "Sphere radius",
      "type": "number",
      "default": 5,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "sphere"
      }
    },
    "coneRadius": {
      "title": "Cone base radius",
      "type": "number",
      "default": 3,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "cone"
      }
    },
    "coneHeight": {
      "title": "Cone height",
      "type": "number",
      "default": 8,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "cone"
      }
    },
    "cubeEdge": {
      "title": "Cube edge length",
      "type": "number",
      "default": 4,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "cube"
      }
    },
    "cylinderRadius": {
      "title": "Cylinder radius",
      "type": "number",
      "default": 3,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "cylinder"
      }
    },
    "cylinderHeight": {
      "title": "Cylinder height",
      "type": "number",
      "default": 8,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "cylinder"
      }
    },
    "boxLength": {
      "title": "Tank length",
      "type": "number",
      "default": 10,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "box"
      }
    },
    "boxWidth": {
      "title": "Tank width",
      "type": "number",
      "default": 6,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "box"
      }
    },
    "boxHeight": {
      "title": "Tank height",
      "type": "number",
      "default": 4,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "box"
      }
    },
    "capsuleRadius": {
      "title": "Capsule radius",
      "type": "number",
      "default": 2,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "capsule"
      }
    },
    "capsuleHeight": {
      "title": "Cylinder-section height",
      "type": "number",
      "default": 6,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "capsule"
      }
    },
    "capBallRadius": {
      "title": "Ball radius",
      "type": "number",
      "default": 5,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "spherical-cap"
      }
    },
    "capHeight": {
      "title": "Cap height",
      "type": "number",
      "default": 2,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "spherical-cap"
      }
    },
    "frustumTopRadius": {
      "title": "Top radius",
      "type": "number",
      "default": 2,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "frustum"
      }
    },
    "frustumBottomRadius": {
      "title": "Bottom radius",
      "type": "number",
      "default": 4,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "frustum"
      }
    },
    "frustumHeight": {
      "title": "Frustum height",
      "type": "number",
      "default": 6,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "frustum"
      }
    },
    "ellipsoidA": {
      "title": "Ellipsoid axis a",
      "type": "number",
      "default": 3,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "ellipsoid"
      }
    },
    "ellipsoidB": {
      "title": "Ellipsoid axis b",
      "type": "number",
      "default": 4,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "ellipsoid"
      }
    },
    "ellipsoidC": {
      "title": "Ellipsoid axis c",
      "type": "number",
      "default": 5,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "ellipsoid"
      }
    },
    "pyramidBaseEdge": {
      "title": "Square-pyramid base edge",
      "type": "number",
      "default": 6,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "square-pyramid"
      }
    },
    "pyramidHeight": {
      "title": "Square-pyramid height",
      "type": "number",
      "default": 8,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "square-pyramid"
      }
    },
    "tubeOuterDiameter": {
      "title": "Tube outer diameter",
      "type": "number",
      "default": 10,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "tube"
      }
    },
    "tubeInnerDiameter": {
      "title": "Tube inner diameter",
      "type": "number",
      "default": 8,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "tube"
      }
    },
    "tubeLength": {
      "title": "Tube length",
      "type": "number",
      "default": 12,
      "minimum": 0.000001,
      "x-step": 0.01,
      "x-showWhen": {
        "field": "shape",
        "equals": "tube"
      }
    }
  },
  "required": [
    "shape"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "shape": {
            "const": "sphere"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "sphereRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "cone"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "coneRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "cone"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "coneHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "cube"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "cubeEdge"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "cylinder"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "cylinderRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "cylinder"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "cylinderHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "box"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "boxLength"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "box"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "boxWidth"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "box"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "boxHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "capsule"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "capsuleRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "capsule"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "capsuleHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "spherical-cap"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "capBallRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "spherical-cap"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "capHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "frustum"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "frustumTopRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "frustum"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "frustumBottomRadius"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "frustum"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "frustumHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "ellipsoid"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "ellipsoidA"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "ellipsoid"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "ellipsoidB"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "ellipsoid"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "ellipsoidC"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "square-pyramid"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "pyramidBaseEdge"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "square-pyramid"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "pyramidHeight"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "tube"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "tubeOuterDiameter"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "tube"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "tubeInnerDiameter"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "shape": {
            "const": "tube"
          }
        },
        "required": [
          "shape"
        ]
      },
      "then": {
        "required": [
          "tubeLength"
        ]
      }
    }
  ],
  "additionalProperties": false,
  "x-askcalculators": {
    "version": "2.0.0",
    "calculatorUrl": "https://askcalculators.com/calculator/volume-calculator/",
    "queryExample": "https://askcalculators.com/calculator/volume-calculator/?shape=sphere&sphereRadius=5",
    "migrationStatus": "new",
    "reviewStatus": "pending",
    "pageStatus": "live",
    "workStatus": "pending",
    "formula": {
      "expression": "Shape formulas include V=4πr³/3, πr²h, lwh, πr²(h+4r/3), πh(r²+rR+R²)/3, and 4πabc/3."
    },
    "quality": {
      "availability": "live",
      "technicalReviewRecord": "/reviews/volume-calculator.json",
      "qualifiedReview": "pending",
      "qualifiedReviewer": null,
      "qualifiedReviewDate": null,
      "formulaVersion": "2.0.0",
      "referenceCoverage": "references-listed",
      "releaseTestScope": "Flagship reference cases are specified in scripts/test-v20-1.mjs; consult release evidence for executed results.",
      "historicalMetadataDate": "2026-08-25",
      "historicalMetadataNotice": "The imported date is not evidence of a completed human review."
    },
    "outputs": {
      "volume": {
        "title": "Volume",
        "type": "number",
        "x-format": "number",
        "x-digits": 6,
        "x-primary": true
      },
      "surfaceArea": {
        "title": "Surface area",
        "type": "number",
        "x-format": "number",
        "x-digits": 6
      },
      "baseArea": {
        "title": "Base or cross-sectional area",
        "type": "number",
        "x-format": "number",
        "x-digits": 6
      },
      "shapeName": {
        "title": "Solid",
        "type": "string",
        "x-format": "text"
      }
    }
  }
}
