Square side from diagonal calculator
Divide a square's diagonal by √2 to get its side: a diagonal of 14.142135623731 gives a side of 10, and a diagonal of 10 gives about 7.071067811865. Zero is allowed, negative diagonals are rejected. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Diagonal
- 10
- Side
- 7.0710678119
A square is a four-sided figure with equal sides and four right angles. Given only the corner-to-corner diagonal, this calculator recovers the side length with the Pythagorean identity: side equals the diagonal divided by the square root of two. Zero is allowed and yields a zero side for degenerate bounds.
How square side length is recovered from the diagonal
Label the corner-to-corner segment of the square with length d. Because all four sides are equal and every corner is a right angle, the two legs of the right triangle formed by two sides and the diagonal are identical. The Pythagorean theorem then states that d squared equals side squared plus side squared, or d squared equals two times side squared.
Taking the non-negative principal square root of both sides gives d equals side times the square root of two, and rearranging yields side equals d divided by the square root of two. Classic checks include a diagonal of ten, which yields side approximately seven point zero seven one; a diagonal of five times the square root of two, which yields side five; and a unit diagonal of one, which yields side one over the square root of two.
Because the path uses only a single division by a constant, it is deterministic, O(1), and free of iterative solvers. Negative diagonals are rejected before the quotient is taken, because no real side length satisfies a negative hypotenuse.
What you send and what you get back
Provide one required finite number: diagonal is the length of the square diagonal from one corner to the opposite corner. It must be non-negative; zero is accepted and produces side zero. Example checks: diagonal ten yields side approximately seven point zero seven one zero six seven eight one one eight six five; diagonal fourteen point one four two one three five six two three seven three one yields side ten after stable twelve-decimal rounding; a diagonal of minus three fails naming the field.
Wire the free browser tool for quick sanity checks, then call the identical contract from scripts for bulk evaluation without reimplementing the quotient in every language. Invalid input is not charged, so exploratory validation in CI stays cheap while production calls remain predictable across languages and SDKs that already speak the KIT task model.
Where side-from-diagonal calculations show up in real work
Secondary-school and college geometry courses constantly ask for the side of a square given the diagonal, often as the inverse of the side-times-root-two product on the same problem set; a trusted calculator with a strict non-negative gate speeds homework grading and removes spreadsheet mistakes where someone multiplies the diagonal by two or confuses diagonal with perimeter.
Construction, flooring, painting, and landscaping workflows often start from a measured diagonal across a square room, patio slab, or bed, then need the equal edge length for module counts and cutting lists; the same quotient feeds layout when only the diagonal is on the survey. Architecture and interior design tools review square footprints when diagonal clearances are primary and edge dimensions are derived; side length drives framing and tile module tables.
Game, graphics, and CAD libraries store diagonal extents for axis-aligned squares and need equal side lengths for layout math, packing heuristics, and collision proxies without a full computational-geometry stack. If you later need area from side, side from area, rhombus sides from two diagonals, or unit conversion between meters and feet, treat those as separate search intents rather than overloading this side-from-diagonal landing.
What you can do with it
Homework and exam checks
Recover square side length from the diagonal, and reject a negative diagonal with a clear error.
Rooms, floors, and material layout
From a measured square-room diagonal, recover the equal edge length for boards, panels, and tile modules.
FAQ
What formula does this calculator use?
side = diagonal / √2 (equivalently side = diagonal · √2 / 2). The response includes formula set to that identity and echoes the input diagonal.
What happens if the diagonal is negative?
The diagonal must be a finite non-negative number; the error message names the field.
Is zero allowed?
Yes. A zero diagonal yields side zero (a degenerate square). Only strictly negative values are rejected.
What does it cost?
The browser tool is free and runs locally.
What is the side of a square whose diagonal is 10?
About 7.071067811865, which is 10 divided by √2. Doubling or halving the diagonal does not give the side; only dividing by √2 does.
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/square-side-diagonal \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"diagonal":10}'const res = await fetch("https://api.kit.forhosting.com/geom/square-side-diagonal", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"diagonal": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/square-side-diagonal",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"diagonal": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/square-side-diagonal", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"diagonal":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"diagonal":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/square-side-diagonal", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"diagonal": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.square_side_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.
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
A missing, non-finite, or negative diagonal is rejected with a clear invalid_input error instead of a silent nonsense side. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 arithmetic on the number you provide.
How square side length is recovered from the diagonal
Equivalently, side equals d times the square root of two over two; both identities are algebraically the same and produce the same IEEE-754 result when evaluated as diagonal over Math.SQRT2. Huge magnitudes can still overflow IEEE-754 double range; when the result is non-finite the request fails with a clear message instead of returning Infinity in JSON. That closed form matches every elementary geometry textbook and keeps automated graders aligned with hand computation on the same diagonal. The response echoes the input diagonal, the computed side, and a short formula string so logs, worksheets, and teaching UIs can document the algorithm without re-deriving it from first principles each time a client consumes the API.
What you send and what you get back
Missing fields, empty strings, non-numeric text, NaN, Infinity, and any negative diagonal are rejected with invalid_input and are not charged. On success the JSON response returns diagonal, side, and formula set to the side-over-root-two identity so logs and teaching UIs can document the algorithm. API pricing is the published base of $0.002 per successful item.
Where side-from-diagonal calculations show up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Integration use cases
Squares in games and CAD
Turn a diagonal extent into equal side lengths for layout, packing, and box metrics in browser or API.
Technical questions
How is this different from the square side from area calculator?
This tool uses the Pythagorean diagonal identity: you send diagonal and get side. geom.square_side_area sends area and gets side via √area. They target different search intents.