ForHosting KIT · Math

Cube space diagonal calculator

Find the longest straight line inside a cube, from one corner to the opposite one: it is the edge times √3, so an edge of 2 gives about 3.464. Useful when a brace or a rod must fit in a cubic box. 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
Edge
2
You get
Space diagonal
3.4641016151

The space diagonal of a cube is the straight-line segment that joins two opposite vertices through the interior of the solid, not along a face. For a cube with equal edge length a, Pythagoras applied twice yields a closed form: the face diagonal is a times the square root of two, and the space diagonal is a times the square root of three. Students meet this identity in solid geometry, SAT and A-level packs, and first-year engineering statics; makers and CAD users need the same number when a diagonal brace, antenna, or clear span must fit inside a cubic envelope.

What the space diagonal is and why d equals a times square root of three

A cube has twelve equal edges, six square faces, and eight vertices. From any vertex three edges leave at right angles, three face diagonals stay on faces, and one space diagonal reaches the opposite corner through the interior. Place a cube with one corner at the origin and edges along the coordinate axes of length a.

The opposite corner sits at the point with coordinates a, a, and a. The Euclidean distance from the origin to that point is the square root of a squared plus a squared plus a squared, which simplifies to a times the square root of three.

The same result appears if you first find a face diagonal of length a times square root of two on the base, then treat that face diagonal and the vertical edge as legs of a right triangle whose hypotenuse is the space diagonal: square root of two a squared plus a squared again yields a times square root of three. Search intent clusters around cube space diagonal calculator, space diagonal of a cube formula, body diagonal from edge length, and a times square root of three.

Where the cube diagonal helps, and its limits

Classrooms and tutoring platforms use a cube space diagonal calculator so learners can check a√3 for arbitrary edge lengths without calculator-mode mistakes on nested radicals. Exam generators and LMS auto-graders need a deterministic oracle that rejects negative edges instead of silently returning a signed length that a buggy grader might accept. Failed validation does not consume balance.

Extremely large edges above the engine ceiling are rejected to avoid non-finite floating results; ordinary homework and design values stay well inside the safe range.

Homework and solid-geometry drills

Students and tutors verify the body diagonal d = a√3 for many edge lengths, including zero and rejection when the edge is negative.

LMS and contest auto-grading

Mark cube space-diagonal items with a deterministic oracle that fails negative edges and never invents extra metrics.

CAD clearance and packing scripts

Compute the longest internal span of a cubic enclosure before choosing a brace, antenna, or nested part without a full CAD kernel.

What formula does the calculator use?

Face diagonals use a√2 and are not returned here.

Does this tool also return volume or surface area?

No. This capability is focused on the space diagonal from edge length only. Use a general cube calculator if you need volume, surface area, or face diagonals.

What is the difference between the face diagonal and the space diagonal?

The face diagonal crosses one square face and measures the edge times √2. The space diagonal runs through the inside, from a corner to the opposite corner, and measures the edge times √3.

Will a rod fit inside a cubic box?

Only if it is no longer than the space diagonal, the longest straight span inside the cube. A box with an edge of 2 takes a rod of up to about 3.464 laid from corner to corner.

Can the edge be zero?

Yes. An edge of zero gives a space diagonal of zero, the limit of a cube that has shrunk to a point. Negative edges are rejected, because a length cannot be negative.

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/geom/cube-diagonal

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/geom/cube-diagonal \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"edge":2}'
{
  "edge": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geom.cube_diagonal",
  "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.

This cube space diagonal calculator accepts a single non-negative finite edge, multiplies by the constant square root of three, and returns the edge, the space diagonal, a short formula string, and a method tag as structured JSON. Negative edges fail with invalid_input before any arithmetic runs.

What the space diagonal is and why d equals a times square root of three

Delivering edge, space_diagonal, formula, and method as JSON makes the result easy to paste into notes, assert in continuous integration, or feed into a lesson platform without reimplementing Pythagoras in every language you teach or deploy.

Input contract, validation, response shape, and error behaviour

Zero is allowed and returns a space diagonal of zero, which is the degenerate limit of a vanishing cube and is useful in property-based tests. Edge equal to one yields exactly the square root of three. Edge equal to five yields five times the square root of three. POST a JSON body with the required field edge set to a finite number that is greater than or equal to zero. The value may arrive as a JSON number or as a numeric string; missing fields, empty strings, non-finite values such as NaN, and non-numeric text fail with invalid_input naming the field. On success the body echoes the edge rounded for stable goldens, the space_diagonal as edge times the square root of three with the same stable rounding, the formula string d equals a times square root of three, and method set to cube_diagonal. Example: edge equal to two yields space_diagonal equal to two times the square root of three, approximately three point four six four. Pair the response with your own unit labels if the edge is in meters or inches; this endpoint is unit-agnostic and does not convert systems of measure. It also does not return face diagonals, volume, or surface area—those belong to broader cube tools—so the contract stays focused on the long-tail query for the space diagonal alone.

Where a space-diagonal API earns its keep, pricing, and limits

Engineering notebooks and fabrication scripts often need the longest internal clearance of a cubic crate, enclosure, or printed part; calling a tiny parse API avoids pulling a full solid-modeling kernel for one multiply and one square root. Keep requests small, pin the rounded space_diagonal in tests, and you get reproducible diagonals for homework, CAD pre-checks, and edge workers without standing up symbolic geometry infrastructure of your own.

How do I compute the space diagonal of a cube from the edge?

Send a JSON body with edge set to a finite non-negative number. The API returns space_diagonal = edge × √3, plus formula and method fields.

What happens if the edge is negative?

The task fails with invalid_input. A cube edge cannot be negative, so the request is rejected and not billed.

What does the cube space diagonal calculator cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →