ForHosting KIT · Math

Cuboid calculator

Enter a box's length, width and height and get both its volume and its total surface area: 3 by 4 by 5 gives a volume of 60 and a surface of 94. One tells you what fits inside, the other what covers it. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Length
3
Width
4
Height
5
You get
Volume
60
Surface area
94

The cuboid calculator takes the three dimensions of a rectangular box — length, width and height — and returns its volume and total surface area in a single call. A cuboid is the shape of almost everything we pack, ship, store or build: rooms, crates, shelves, tanks and bricks. Getting its two key measurements right matters whether you are quoting paint for a wall job, sizing a shipping carton or checking how much water a tank holds. Results are deterministic and rounded once to six decimals, and the exact same code runs free in your browser on this page.

What the calculator returns

For any cuboid defined by its length, width and height, the calculator returns two measurements. The volume is the product of the three dimensions, l × w × h, and it tells you how much space the solid occupies or encloses — cubic metres of concrete for a footing, litres of capacity in a container, cubic inches inside a parcel. The total surface area is 2(lw + lh + wh): the sum of the six rectangular faces, counted in opposite pairs.

That number answers questions about covering rather than filling — how much cardboard a box needs, how much paint a closed tank takes, how much wrapping paper a gift requires. Because the three dimensions share one unit, the volume is expressed in that unit cubed and the surface area in that unit squared; the calculator does not convert units, it simply applies the geometry.

When to use it and how it runs

Use this capability whenever a workflow needs box geometry without a spreadsheet: e-commerce backends quoting dimensional weight or packaging, construction estimators checking volumes of footings and rooms, warehouse tools computing how much film or paint a batch of crates needs, or classroom exercises that want a trustworthy reference answer. There are no network calls, no random seeds and no clocks inside the algorithm: the same input always produces the same output, which makes it safe to cache and trivial to test.

For a full diagnostic breakdown of any single box, one request is all it takes.

Quote packaging and shipping

Compute the volume of a carton from its length, width and height to feed a dimensional-weight quote or a pallet-loading check.

Estimate materials for a build

Get the surface area of a tank, room or crate to estimate paint, sheet material or wrapping, and the volume for fill or capacity.

What does it cost?

The same calculation is free in your browser on this page.

What happens with a zero or negative dimension?

Invalid requests are rejected before any arithmetic and are not billed.

Which units does it use?

Whatever unit your dimensions share. The volume is that unit cubed and the surface area that unit squared; no unit conversion is applied.

How do I know how much paint or cardboard a box needs?

Use the surface area result: it adds up all six faces, so it is the amount of cardboard, paint or wrapping needed to cover the box completely. The volume, by contrast, tells you what fits inside.

How is the surface area of a box calculated?

Multiply each pair of dimensions, add the three products and double the total. Opposite faces of a box are identical, which is why each of the three face sizes is counted twice.

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.

POSThttps://api.kit.forhosting.com/math/cuboid

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.

curl -X POST https://api.kit.forhosting.com/math/cuboid \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"length":3,"width":4,"height":5}'
{
  "length": 3,
  "width": 4,
  "height": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.cuboid",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The endpoint validates every dimension before doing any arithmetic, so a missing or non-positive value fails cleanly with an invalid_input error instead of producing a plausible-looking wrong number.

What the calculator returns

Both values come back in the same response, together with an echo of the three dimensions you sent, so the payload is self-describing and easy to log or to feed into the next step of a pipeline.

Inputs, validation and precision

The validation happens before any arithmetic, so there is no path by which a bad dimension silently contaminates a result. Inputs are echoed back unrounded so you always see precisely what was interpreted. Each call requires three fields: length, width and height. They may be sent as JSON numbers or as numeric strings, which makes the endpoint friendly to form submissions and spreadsheets where values often arrive as text. Every dimension must be a positive, finite number: zero, negative values, NaN, infinities, empty strings and non-numeric text are all rejected with an invalid_input error that names the offending field, and failed requests are not billed. On the precision side, the computation uses ordinary IEEE 754 double arithmetic and the outputs are rounded once to six decimal places.

When to use it and how it runs

The API price is $0.002 per request with no per-unit surcharge, and the tier-A execution path runs at the edge with no data retained after the response.

Teach or verify box geometry

Use the deterministic, double-checked answers as a reference when learning or testing V = l·w·h and S = 2(lw + lh + wh).

What inputs does it need?

Three fields: length, width and height. Each must be a positive finite number, sent as a JSON number or a numeric string.

How precise are the results?

Computed with IEEE 754 doubles and rounded once to six decimal places, so the output is stable and exactly reproducible across machines.

Read the full KIT documentation →