# Rectangular Prism Calculator

> Computes the volume, total surface area, space diagonal and total edge length of a rectangular prism (cuboid or box) from its length, width and height.

- Calculator id: `rectangular-prism` · Category: Geometry (`geometry`) · Tool name: `calculate_rectangular_prism_properties`
- Canonical page: https://tttkmbb.com/geometry/rectangular-prism · This document: https://tttkmbb.com/geometry/rectangular-prism.md · JSON definition: https://tttkmbb.com/geometry/rectangular-prism.json

## Purpose

Computes the volume, total surface area, space diagonal and total edge length of a rectangular prism (cuboid or box) from its length, width and height.

**Use when:** You need the capacity, surface or longest internal dimension of a box, room, aquarium, container or any cuboid.

**Do not use when:** The base is not a rectangle (use cylinder or pyramid) or you only need the floor area (use rectangle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `length` | number | units | required | Length of the base. (> 0) |
| `width` | number | units | required | Width of the base. (> 0) |
| `height` | number | units | required | Height of the prism. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `volume` | number | units³ | length × width × height. |
| `surface_area` | number | units² | 2 × (length×width + length×height + width×height). |
| `space_diagonal` | number | units | √(length² + width² + height²), the longest straight line inside the box. |
| `total_edge_length` | number | units | 4 × (length + width + height). |

## Formula

`volume = length · width · height; surface_area = 2 · (length·width + length·height + width·height); space_diagonal = √(length² + width² + height²); total_edge_length = 4 · (length + width + height)`

## Data Sources

- Wikipedia – Cuboid — https://en.wikipedia.org/wiki/Cuboid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Cuboid — https://mathworld.wolfram.com/Cuboid.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/rectangular-prism?length=…&width=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/rectangular-prism` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/rectangular-prism · OpenAPI operationId `calculate_rectangular_prism_properties` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "rectangular-prism", "inputs": {…}}`

## Example

- 3 × 4 × 12: inputs `{"length":3,"width":4,"height":12}` → `{"volume":144,"surface_area":192,"space_diagonal":13,"total_edge_length":76}`
- 2 × 3 × 4: inputs `{"length":2,"width":3,"height":4}` → `{"volume":24,"surface_area":52,"space_diagonal":5.3852,"total_edge_length":36}`

```
GET https://tttkmbb.com/api/v1/calculate/rectangular-prism?length=3&width=4&height=12
```

## Limitations

The base is not a rectangle (use cylinder or pyramid) or you only need the floor area (use rectangle). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**How do I use it for a cube?**

Enter the same value for all three sides: volume = side³, surface area = 6 × side², space diagonal = side × √3.

**Will a rod of a given length fit in the box?**

Only if it is no longer than the space diagonal (ignoring the rod's thickness).

## Related

- [Rectangle Calculator](https://tttkmbb.com/geometry/rectangle.md) — Area and diagonal of one face.
- [Volume Converter](https://tttkmbb.com/conversion/volume.md) — Convert the volume to litres, gallons or cubic feet.
- [Concrete Slab Calculator](https://tttkmbb.com/construction/concrete-slab.md) — Concrete needed for a rectangular slab of these dimensions.
