{
  "id": "cubic-inches",
  "version": "e6d0a2481c09",
  "status": "published",
  "name": "Cubic Inches Calculator",
  "question": "How many cubic inches is it?",
  "summary": "Finds a volume in cubic inches from the sides of a box, the diameter and height of a cylinder, or an engine’s bore, stroke and cylinders, with the same volume in cc, litres, cubic feet and gallons.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/cubic-inches-calculator",
  "markdown": "https://www.acalculator.org/math/cubic-inches-calculator.md",
  "kind": "function",
  "method": "Box: V = l × w × h. Cylinder: V = π ÷ 4 × d² × h. Engine: V = π ÷ 4 × bore² × stroke × cylinders. 1 in³ = 16.387064 cm³; 1 ft³ = 1,728 in³; 1 gal = 231 in³.",
  "assumptions": [
    "Engine displacement is the swept volume: the volume each piston moves through, times the number of cylinders. It leaves out the combustion chamber above the piston.",
    "A typed length is read as the exact decimal you typed in its unit (1 in = 2.54 cm exactly)."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "shape": {
        "title": "Shape",
        "description": "What you are measuring: a box, a cylinder, or the cylinders of an engine.",
        "type": "string",
        "enum": [
          "box",
          "cylinder",
          "engine"
        ]
      },
      "l": {
        "title": "Length",
        "description": "The length of the box.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "w": {
        "title": "Width",
        "description": "The width of the box.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "h": {
        "title": "Height",
        "description": "The height of the box or the cylinder.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "d": {
        "title": "Diameter",
        "description": "The inside diameter of the cylinder.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "bore": {
        "title": "Bore",
        "description": "The diameter of one engine cylinder.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "stroke": {
        "title": "Stroke",
        "description": "How far the piston travels from the bottom to the top.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "exclusiveMinimum": 0,
        "maximum": 1000
      },
      "cyl": {
        "title": "Cylinders",
        "description": "How many cylinders the engine has.",
        "type": "integer",
        "minimum": 1,
        "maximum": 24
      }
    }
  },
  "outputs": {
    "cubicInches": {
      "label": "Cubic inches",
      "description": "The volume in cubic inches (in³).",
      "format": "number"
    },
    "cc": {
      "label": "Cubic centimetres (cc)",
      "description": "The volume in cubic centimetres; 1 in³ = 16.387064 cm³.",
      "format": "number"
    },
    "liters": {
      "label": "Litres",
      "description": "The volume in litres; 1 L = 1,000 cm³.",
      "format": "number"
    },
    "cubicFeet": {
      "label": "Cubic feet",
      "description": "The volume in cubic feet; 1 ft³ = 1,728 in³.",
      "format": "number"
    },
    "gallons": {
      "label": "US gallons",
      "description": "The volume in US liquid gallons; 1 gal = 231 in³.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "shape": "box",
      "l": 0.30479999999999996,
      "w": 0.254,
      "h": 0.2032,
      "d": 0.1016,
      "bore": 0.1016,
      "stroke": 0.088392,
      "cyl": 8
    },
    "outputs": {
      "cubicInches": 960,
      "cc": 15731.58144,
      "liters": 15.73158144,
      "cubicFeet": 0.5555555555555556,
      "gallons": 4.1558441558441555
    },
    "text": "The volume is 960 cubic inches (15.732 litres)."
  },
  "examples": [
    {
      "given": {
        "shape": "box",
        "l": 0.30479999999999996,
        "w": 0.254,
        "h": 0.2032
      },
      "expect": {
        "cubicInches": 960,
        "cc": 15731.58144,
        "liters": 15.73158144,
        "cubicFeet": 0.5555555555555556,
        "gallons": 4.1558441558441555
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (rectangular prism V = l·w·h; right cylinder V = πr²h), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area; NIST Special Publication 811, Appendix B (1 in = 2.54 cm exactly; 1 gal = 231 in³ exactly), https://www.nist.gov/pml/special-publication-811; hand calculation in content.mdx: 12 × 10 × 8 = 960 in³"
    },
    {
      "given": {
        "shape": "box",
        "l": 0.1,
        "w": 0.2,
        "h": 0.3
      },
      "expect": {
        "cc": 6000,
        "liters": 6,
        "cubicInches": 366.14246456839373
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (rectangular prism V = l·w·h; right cylinder V = πr²h), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area; NIST Special Publication 811, Appendix B (1 in = 2.54 cm exactly; 1 gal = 231 in³ exactly), https://www.nist.gov/pml/special-publication-811; hand calculation in content.mdx: 10 × 20 × 30 = 6,000 cm³ = 366.14 in³"
    },
    {
      "given": {
        "shape": "cylinder",
        "d": 0.1016,
        "h": 0.15239999999999998
      },
      "expect": {
        "cubicInches": 75.39822368615503
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (rectangular prism V = l·w·h; right cylinder V = πr²h), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area; hand calculation in content.mdx: π × 2² × 6 = 24π = 75.40 in³",
      "tolerance": 1e-12
    },
    {
      "given": {
        "shape": "engine",
        "bore": 0.1016,
        "stroke": 0.088392,
        "cyl": 8
      },
      "expect": {
        "cubicInches": 349.8477579037594,
        "liters": 5.732977599025411
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (rectangular prism V = l·w·h; right cylinder V = πr²h), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area (each cylinder sweeps a right cylinder of diameter bore and height stroke); NIST Special Publication 811, Appendix B (1 in = 2.54 cm exactly; 1 gal = 231 in³ exactly), https://www.nist.gov/pml/special-publication-811; hand calculation in content.mdx: π ÷ 4 × 4² × 3.48 × 8 = 349.85 in³ = 5.733 L",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area: volume of a rectangular prism (V = B·h) and of a right cylinder (V = πr²h). https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area (retrieved 2026-10-02)",
    "NIST Special Publication 811, Guide for the Use of the International System of Units, Appendix B: 1 in = 2.54 cm exactly, 1 US gallon = 231 in³ exactly. https://www.nist.gov/pml/special-publication-811 (retrieved 2026-10-02)"
  ],
  "related": [
    "rectangular-prism",
    "volume",
    "cubic-feet",
    "cylinder-volume"
  ],
  "changelog": []
}
