{
  "id": "rectangular-prism",
  "version": "a5f1685fc571",
  "status": "published",
  "name": "Rectangular Prism Calculator",
  "question": "How big is my rectangular prism?",
  "summary": "Finds the volume, total surface area, lateral area, base area and space diagonal of a rectangular prism (a box) from its length, width and height.",
  "category": "math",
  "subcategory": "geometry",
  "url": "https://www.acalculator.org/math/rectangular-prism-calculator",
  "markdown": "https://www.acalculator.org/math/rectangular-prism-calculator.md",
  "kind": "function",
  "method": "V = l × w × h; SA = 2(lw + lh + wh); lateral area = 2h(l + w); base area = l × w; diagonal = √(l² + w² + h²).",
  "assumptions": [
    "The prism is a right rectangular prism (a box): every face is a rectangle and every corner is a right angle.",
    "All lengths are in the same unit; areas come out in that unit squared and the volume in that unit cubed."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "l": {
        "title": "Length",
        "description": "The length of the base of the box.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      },
      "w": {
        "title": "Width",
        "description": "The width of the base of the box.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      },
      "h": {
        "title": "Height",
        "description": "The height of the box, at right angles to the base.",
        "type": "number",
        "exclusiveMinimum": 0,
        "maximum": 1000000
      }
    }
  },
  "outputs": {
    "volume": {
      "label": "Volume",
      "description": "Length × width × height, in cubic units.",
      "format": "number"
    },
    "surface": {
      "label": "Total surface area",
      "description": "All six faces: 2(lw + lh + wh), in square units.",
      "format": "number"
    },
    "lateral": {
      "label": "Lateral area",
      "description": "The four side faces, without top and bottom: 2h(l + w).",
      "format": "number"
    },
    "base": {
      "label": "Base area",
      "description": "The bottom face: length × width.",
      "format": "number"
    },
    "diagonal": {
      "label": "Space diagonal",
      "description": "The distance from one corner to the opposite corner: √(l² + w² + h²).",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "l": 10,
      "w": 5,
      "h": 3
    },
    "outputs": {
      "volume": 150,
      "surface": 190,
      "lateral": 90,
      "base": 50,
      "diagonal": 11.575836902790225
    },
    "text": "A box 10 × 5 × 3 has a volume of 150 and a surface area of 190."
  },
  "examples": [
    {
      "given": {
        "l": 5,
        "w": 10,
        "h": 3
      },
      "expect": {
        "surface": 190,
        "volume": 150,
        "lateral": 90,
        "base": 50,
        "diagonal": 11.575836902790225
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (right prism SA = 2B + ph, V = B·h; Example 10.56), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area (SA = 2(10)(5) + 2(5)(3) + 2(10)(3) = 190 cm², V = 150 cm³); hand calculation in content.mdx for the lateral area and diagonal; OpenStax, Calculus Volume 3, §2.2 Vectors in Three Dimensions (distance between two points in space), https://openstax.org/books/calculus-volume-3/pages/2-2-vectors-in-three-dimensions"
    },
    {
      "given": {
        "l": 15,
        "w": 6,
        "h": 6
      },
      "expect": {
        "surface": 432,
        "volume": 540,
        "lateral": 252,
        "diagonal": 17.233687939614086
      },
      "source": "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (right prism SA = 2B + ph, V = B·h; Example 10.56), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area (Your Turn 10.56); hand calculation in content.mdx: SA = 2(90 + 90 + 36) = 432, V = 540"
    },
    {
      "given": {
        "l": 2,
        "w": 3,
        "h": 6
      },
      "expect": {
        "volume": 36,
        "surface": 72,
        "diagonal": 7
      },
      "source": "hand calculation in content.mdx: √(4 + 9 + 36) = √49 = 7; OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (right prism SA = 2B + ph, V = B·h; Example 10.56), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area; OpenStax, Calculus Volume 3, §2.2 Vectors in Three Dimensions (distance between two points in space), https://openstax.org/books/calculus-volume-3/pages/2-2-vectors-in-three-dimensions"
    },
    {
      "given": {
        "l": 0.1,
        "w": 0.2,
        "h": 0.3
      },
      "expect": {
        "volume": 0.006,
        "surface": 0.22,
        "base": 0.02
      },
      "source": "hand calculation in content.mdx: 2(0.02 + 0.03 + 0.06) = 0.22; OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area (right prism SA = 2B + ph, V = B·h; Example 10.56), https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area"
    }
  ],
  "sources": [
    "OpenStax, Contemporary Mathematics, §10.7 Volume and Surface Area: right prism SA = 2B + ph and V = B·h; Example 10.56 (width 10 cm, length 5 cm, height 3 cm: SA = 190 cm², V = 150 cm³) and Your Turn 10.56. https://openstax.org/books/contemporary-mathematics/pages/10-7-volume-and-surface-area (retrieved 2026-10-02)",
    "OpenStax, Calculus Volume 3, §2.2 Vectors in Three Dimensions: the distance between two points in space, which gives the space diagonal. https://openstax.org/books/calculus-volume-3/pages/2-2-vectors-in-three-dimensions (retrieved 2026-10-02)"
  ],
  "related": [
    "triangular-prism",
    "volume",
    "surface-area",
    "cubic-inches"
  ],
  "changelog": []
}
