Cube calculator
Enter one measure of a cube, its edge, volume or surface area, and get all the others: an edge of 2 gives a volume of 8, a surface area of 24 and both diagonals. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Cube edge length
- 2
- Volume
- 8
- Surface area
- 24
- Face diagonal
- 2.8284271247
- Space diagonal
- 3.4641016151
A cube is a regular hexahedron: six congruent square faces, twelve equal edges, and eight vertices where three edges meet at right angles. Once any one of edge length, volume, or total surface area is fixed and strictly positive, every classical metric of the solid is determined. Volume is the cube of the edge, surface area is six times the square of the edge, the face diagonal is the edge times the square root of two, and the space diagonal is the edge times the square root of three. Students meet these formulas in solid-geometry homework and standardized tests; makers, packagers, and engineers need the same numbers when a sketch or bill of materials lists only one of those three measures.
What a cube is and which single measure determines the rest
In Euclidean solid geometry a cube is completely determined, up to congruence, by a single positive length scale. All twelve edges share that length. The volume is the product of three orthogonal edges, which is simply the edge length raised to the third power.
The total surface area sums the areas of six identical squares, so it equals six times the edge squared. The face diagonal is the hypotenuse of a right isosceles triangle with legs equal to the edge, and therefore equals the edge times the square root of two. The space diagonal runs from one vertex to the opposite vertex through the interior; by applying Pythagoras twice, or once in three dimensions, it equals the edge times the square root of three.
If instead you know the volume, the edge is the real cube root of that volume. If you know the surface area, the edge is the positive square root of the surface area divided by six. Giving none of the three fields leaves the solid under-determined; giving two or three over-specifies the problem and can hide inconsistency when the numbers fail the cube relations.
Search intent clusters around phrases like cube calculator, cube volume surface area, cube face diagonal, cube space diagonal, and edge from volume. People want numeric results they can check against a textbook answer key, a packaging size chart, or a CAD note, not only a geometric argument that the figure is determined.
How this calculator validates input and applies the closed-form formulas
Each provided measure must be a positive finite number. The engine counts how many of the three fields are present: zero fails as under-specified, two or three fail as over-specified, and only a single field proceeds. When edge is known, volume is edge cubed, surface area is six times edge squared, the face diagonal is edge times the square root of two, and the space diagonal is edge times the square root of three.
When volume is known, the engine first checks that the volume is strictly positive; the edge is then the real cube root of the volume, after which the remaining metrics follow the same formulas. When surface area is known, the engine checks positivity and recovers the edge as the positive square root of surface area divided by six before computing volume and both diagonals.
You may use any consistent unit system for the edge; volume and area are expressed in the corresponding cubic and square units without conversion inside the engine.
What you can do with it
Homework and exam cube drills
Students and graders confirm volume, surface area, face diagonal, and space diagonal from a single known measure, including rejection when the value is not positive.
FAQ
Which formulas does the calculator use?
Volume is edge³. Surface area is 6·edge². Face diagonal is edge·√2. Space diagonal is edge·√3.
What happens if the input is not positive?
A cube requires a strictly positive edge (or an equivalent positive volume or surface area); zero and negative values are rejected and those calls are not charged.
Is the cube calculator free?
The browser tool runs free on your device.
What is the difference between face diagonal and space diagonal?
The face diagonal lies on one square face and equals edge·√2. The space diagonal passes through the interior between opposite vertices and equals edge·√3, which is always longer for a positive edge.
Can I start from the volume or the surface area instead of the edge?
Yes. Enter exactly one of the three. From a volume the edge is its cube root, from a surface area it is the square root of the area divided by six, and every other measure follows.
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/geom/cube \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"edge":2,"volume":8}'const res = await fetch("https://api.kit.forhosting.com/geom/cube", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"edge": 2,
"volume": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/cube",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"edge": 2,
"volume": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/cube", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"edge":2,"volume":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"edge":2,"volume":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/cube", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"edge": 2,
"volume": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.cube",
"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 capacity accepts exactly one of edge, volume, or surface_area, rejects non-positive values and ambiguous multi-field inputs, and returns the full set of metrics as structured JSON.
What a cube is and which single measure determines the rest
Delivering edge, volume, surface_area, face_diagonal, and space_diagonal as JSON makes the result easy to paste into notes, diff in automated tests, or feed into a larger pipeline without reimplementing roots and multiplications in every language you teach or deploy.
How this calculator validates input and applies the closed-form formulas
Send a JSON body with exactly one of the three fields edge, volume, or surface_area. Results are rounded to a stable decimal precision so the same input always yields the same JSON across JavaScript engines. Edge cases are explicit: zero or negative measures, non-numeric strings, missing fields, and providing more than one of edge, volume, and surface_area all fail before any metric is returned.
Practical use, limits, pricing, and delivery channels
Use the browser tool when you want an immediate cube solution while checking homework, sizing a cubic package, verifying a storage bin volume from an edge length, or confirming a workshop drawing without installing a computer-algebra system. Results are fully deterministic: the same single measure always yields the same edge, volume, surface area, and both diagonals. There is no language model, no external geometry service, and no randomness, so the capacity is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Accepted inputs must be strictly positive; zero-edge or negative-volume cubes are rejected with a clear invalid_input message. Wire the endpoint into solid-geometry drills, contest answer checkers, packaging worksheets that list only volume or surface area, or floating preprocessing steps where you already prefer explicit domain errors over opaque black-box widgets that cannot show why a non-positive measure is rejected.
Integration use cases
Deterministic fixtures for solid-geometry tests
Pipelines that seed unit tests or interactive cube demos can call a pure cube oracle instead of reimplementing cube roots and square roots in every language.
Packaging and cubic storage from one known measure
Shop or logistics notes that list only an edge, a volume, or a total surface recover full cube metrics as structured JSON for reports, size charts, or lightweight CAD helpers.
Technical questions
How do I compute cube metrics with this API?
Send a JSON body with exactly one of edge, volume, or surface_area to geom.cube. The response returns edge, volume, surface_area, face_diagonal, and space_diagonal.