Cuboid volume calculator
Multiply length, width and height to get the space a box, room or crate encloses: 3 by 4 by 5 gives 60, in your unit cubed. Zero, negative or missing dimensions are refused instead of producing a wrong figure. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Length
- 3
- Width
- 4
- Height
- 5
- Volume
- 60
A cuboid, also called a rectangular prism or rectangular box, is a three-dimensional solid with six rectangular faces meeting at right angles. Its volume—the cubic space it encloses—is the product of its three edge lengths: volume equals length times width times height.
How the cuboid volume formula works
Label the three mutually perpendicular edges of the box as length, width and height. The volume of a cuboid is the product of those three numbers: volume equals length times width times height. Geometrically this counts how many unit cubes fit inside the solid: the base rectangle of length by width holds length times width unit squares in a single layer, and stacking height such layers multiplies the count by height.
The unit of the result is the cube of the unit you measured in—meters give cubic meters, inches give cubic inches—so all three dimensions must share the same unit before you multiply, or the product mixes scales and is meaningless. Classic sanity checks: edges three, four and five yield sixty; a two-by-two-by-two cube yields eight; a unit cube yields one. Because the formula is a closed-form product, the computation is O(1), deterministic, and needs no iteration or approximation.
Practical uses and measurement tips
Cuboid volume shows up anywhere a box-shaped space or object must be quantified. In education, solid-geometry courses ask for the volume of a rectangular prism given three edges, and a strict calculator with a positive-only gate speeds homework grading and removes spreadsheet mistakes such as squaring one edge or forgetting a dimension. In logistics and storage, carton, crate and room volumes drive capacity planning, freight-class estimates and how much void fill or dunnage a shipment needs; measure the outer length, width and height in one consistent unit and multiply.
In construction and landscaping, rectangular forms for concrete footings, raised garden beds and planter boxes convert directly from dimensions to cubic meters or cubic yards of material; remember that a cubic yard is twenty-seven cubic feet, so convert units before multiplying, not after guessing. A practical measuring tip: for irregular interiors, take length, width and height at their extremes so the computed volume is an upper bound, and for nested boxes compute each volume separately and subtract.
If you need surface area, diagonals, or the volumes of cylinders, spheres or prisms with other bases, treat those as separate search intents rather than overloading this cuboid-volume landing.
What you can do with it
Homework and exam checks
Compute cuboid volume from three edges and reject zero, negative or non-numeric dimensions with a clear field-named error.
Box, crate and room capacity
Turn outer length, width and height into cubic capacity for shipping cartons, storage rooms and freight estimates.
Material estimates for rectangular forms
Convert the dimensions of concrete footings, planter boxes and raised beds into cubic volume for ordering material.
FAQ
What happens if a dimension is zero or negative?
Every dimension must be a positive finite number; the error message names the offending field.
Can I pass dimensions as strings like "2.5"?
Yes. Numeric strings (with optional sign, decimals and exponent) are parsed strictly; non-numeric text, NaN and Infinity are rejected.
What unit is the volume in?
The cube of whatever unit you measured in: meters give cubic meters, inches give cubic inches. Convert all three dimensions to one unit before multiplying.
What does it cost?
The browser tool is free and runs locally.
What if my measurements are in different units?
Convert them to one unit first, then multiply. Mixing feet and inches, for example, produces a meaningless number. For concrete ordered by the cubic yard, remember that one cubic yard is 27 cubic feet.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/cuboid-volume \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"length":3,"width":4,"height":5}'const res = await fetch("https://api.kit.forhosting.com/math/cuboid-volume", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"length": 3,
"width": 4,
"height": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/cuboid-volume",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"length": 3,
"width": 4,
"height": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/cuboid-volume", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"length":3,"width":4,"height":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"length":3,"width":4,"height":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/cuboid-volume", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"length": 3,
"width": 4,
"height": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.cuboid_volume",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This calculator takes those three dimensions and returns the volume with a strict validation gate: every dimension must be a positive finite number, and anything else (zero, negatives, NaN, Infinity, missing fields, non-numeric text) fails with a clear invalid_input error instead of a silent nonsense result. No network calls, no randomness, no dates—just IEEE-754 multiplication on the numbers you provide, rounded to twelve decimals for byte-stable output.
How the cuboid volume formula works
The implementation multiplies the three validated numbers in double precision and rounds the result to twelve decimal places so the JSON output is byte-stable across machines and runs. Extremely large magnitudes can still overflow the finite range of IEEE-754 doubles; when the product is non-finite the request fails with a clear overflow message instead of returning Infinity in the response. That matches what any solid-geometry textbook computes by hand, so automated graders, spreadsheets and this calculator stay aligned on the same three inputs.
Inputs, validation and output contract
Provide three required fields: length, width and height, the edge lengths of the cuboid. Each must be a positive finite number. Failed validation is not charged. Example: length three, width four, height five returns volume sixty. Values may arrive as JSON numbers or as numeric strings such as "2.5" or "1e3", which are parsed with a strict numeric grammar before use. Validation is strict on purpose: zero is rejected because a collapsed box has no interior volume for the purposes of this capability, negatives are rejected because they are not geometric lengths, and NaN, Infinity, empty strings, booleans, arrays and missing fields are all rejected with an invalid_input error whose message names the offending field. On success the JSON response echoes the parsed length, width and height, returns the volume, and sets method to cuboid_volume_lwh so logs, tests and teaching interfaces can document exactly which algorithm produced the number. API pricing is the published base of $0.002 per successful item.
Practical uses and measurement tips
Because this capability is a pure parse engine, invalid input is rejected without consuming balance and successful runs stay at $0.002 per item.
Technical questions
What formula does this calculator use?
volume = length × width × height. The response includes method: "cuboid_volume_lwh" and echoes the three parsed dimensions.