Rectangle sides from area and ratio
Give the area of a rectangle and how many times longer it is than wide, and get both sides: an area of 48 with a ratio of 3 gives a length of 12 and a width of 4. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Area
- 48
- Ratio
- 3
- Length
- 12
- Width
- 4
- Perimeter
- 32
- Diagonal
- 12.6491106407
Many design, packaging, and homework problems give you a rectangle’s area and how long it is relative to its width, then ask for the actual side lengths. If the area is A and the aspect ratio R is length divided by width, the unique positive solution is length equals the square root of A times R and width equals the square root of A divided by R. Students check textbook exercises; layout and print tools size frames and media boxes; scripts recover dimensions from area and a fixed ratio without reopening a spreadsheet.
What area and aspect ratio determine about a rectangle
A rectangle is fixed up to congruence once you know its two side lengths. In practice you often know the product of those sides—the area—and the quotient of those sides—the aspect ratio—long before you know either length alone. Area A equals length times width, and the aspect ratio R equals length over width when you adopt the convention used by this calculator.
Multiplying those two equations yields length squared equals A times R, so length is the positive square root of A times R. Dividing area by the ratio yields width squared equals A over R, so width is the positive square root of A over R. Both roots are unique and positive whenever A and R are positive, which is exactly the geometric regime of a non-degenerate rectangle with finite positive sides.
If the ratio is greater than one, length is the longer side; if the ratio is less than one, width is longer and the figure is taller than it is wide in the length-width naming you chose. Search intent clusters around phrases such as rectangle sides from area and ratio, find length and width from area and aspect ratio, and rectangle calculator area aspect ratio.
People want numeric sides they can paste into a bill of materials, a CSS box, a packing list, or a homework answer key—not only a proof that the figure is determined.
How this calculator validates input and computes length, width, perimeter, and diagonal
Zero area would collapse the rectangle to a line segment or a point; a non-positive ratio would reverse or destroy the length-over-width interpretation, so both are rejected before any square root runs. On success the engine sets length to the square root of area times ratio and width to the square root of area divided by ratio, then perimeter to twice the sum of the sides and diagonal to the square root of length squared plus width squared—the ordinary Euclidean diagonal of a plane rectangle.
The response also echoes the input area and ratio and includes a short formula string restating the length and width identities for display next to the numbers. Edge cases worth knowing: very large products can overflow floating-point range and surface as a non-finite failure; very small positive values still succeed as long as the roots remain finite and positive. There is no optional unit field—the unit of length is whatever unit squared you used for area, and the response sides share that same unit.
Where this calculation helps, and its limits
Use the browser tool when you need an immediate length and width from a known area and aspect ratio while checking homework, sizing a photo frame, planning a garden bed, or verifying a print layout without installing a computer-algebra system. Accepted inputs must be strictly positive and finite; units are yours to keep consistent between area and the returned lengths. Results are fully deterministic: the same area and ratio always produce the same length, width, perimeter, and diagonal fields.
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. Prefer this focused solver over a general rectangle tool when the search intent is specifically “sides from area and ratio,” so landing copy and examples match how people phrase the problem in search engines and course notes.
What you can do with it
Homework and exam rectangle drills
Students and graders recover length and width from area and a stated aspect ratio, including clear rejection when area or ratio is not positive.
FAQ
What does the ratio field mean?
Ratio is the aspect ratio length divided by width. For a 16:9 rectangle use ratio 16/9 ≈ 1.777…; for a 3:1 rectangle use ratio 3.
What happens if area or ratio is zero or negative?
A non-degenerate rectangle requires strictly positive area and a positive aspect ratio; those calls are not charged.
Is the rectangle sides calculator free?
The browser tool runs free on your device.
How do I find the sides from the area and the ratio?
The length is the square root of the area times the ratio, and the width is the square root of the area divided by the ratio. With 48 and 3, that gives 12 and 4.
What happens when the ratio is less than one?
The width becomes the longer side, so the rectangle is taller than it is wide under the length and width names you chose. The two sides still multiply back to the same area.
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/rectangle-from-area-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"area":48,"ratio":3}'const res = await fetch("https://api.kit.forhosting.com/geom/rectangle-from-area-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"area": 48,
"ratio": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/rectangle-from-area-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"area": 48,
"ratio": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/rectangle-from-area-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"area":48,"ratio":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"area":48,"ratio":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/rectangle-from-area-ratio", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"area": 48,
"ratio": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.rectangle_from_area_ratio",
"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
How this calculator validates input and computes length, width, perimeter, and diagonal
Send a JSON body with two required fields: area and ratio. Each must be a positive finite number, accepted as a JSON number or as a numeric string. Missing fields, empty strings, non-finite values, zero, and negative values fail with invalid_input and name the offending field or rule so callers can fix the request without guessing.
Practical uses, limits, pricing, and when to call the API
Use the API when a script, lesson platform, e-commerce dimension helper, or notebook must recover sides for many area-and-ratio pairs under one stable contract. Each successful request is one billable item at $0.002; failed validation does not consume balance. Wire the endpoint into packaging calculators that store only area and a brand-standard aspect ratio, into media tools that size canvases from pixel area and a 16:9 or 4:3 ratio, into construction worksheets that give floor area and a length-to-width proportion, or into contest auto-graders that mark both sides and optionally the diagonal.
Integration use cases
Packaging and print layout sizing
Design tools that store only printable area and a fixed brand aspect ratio call the API to obtain length, width, perimeter, and diagonal for cut lists and mockups.
Deterministic fixtures for geometry tests
Pipelines that seed unit tests or interactive area-ratio demos use a pure rectangle oracle instead of reimplementing square roots in every language.
Technical questions
How do I find rectangle sides from area and aspect ratio?
Send positive finite numbers area and ratio (length/width) to geom.rectangle_from_area_ratio. The response returns length = √(area·ratio), width = √(area/ratio), plus perimeter and diagonal.
Which other outputs come with the sides?
Besides length and width, the response includes perimeter = 2·(length+width) and diagonal = √(length²+width²), plus a short formula string and the echoed inputs.