Width of a rectangle calculator
Divide the area by the known length to get the width: a rectangle with an area of 40 and a length of 8 is 5 wide. An area of zero is accepted and gives a width of zero. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Area
- 40
- Length
- 8
- Width
- 5
A rectangle is a four-sided figure with four right angles and opposite sides equal. Given the enclosed area and one side called the length, this calculator recovers the adjacent side — the width — by dividing area by length. Zero area is allowed and yields a zero width for degenerate bounds.
How rectangle width is recovered from area and length
Label the enclosed region of the rectangle with area A and one side as length. Because every corner is a right angle, the figure is a product of independent extents along two perpendicular axes, so the enclosed area is simply A equals length times width. Inverting that identity for the unknown adjacent side is a single rearrangement: divide the given area by the known length, which yields width equals area divided by length.
The same quotient appears whether you think of undoing a unit-square tiling count, taking the other edge of an axis-aligned box whose area product is A, or solving A equals l times w for w: all reduce to one division. Classic checks include area forty with length eight, which yield width five; area thirty-six with length twelve, which yield width three; and a unit rectangle with area one and length one, which yields width one.
Swapping the names length and width is only a labeling convention in the forward problem; here length is the known side you send, and width is the recovered unknown. Because the path uses only a single division, it is deterministic, constant time, and free of iterative solvers. A length of zero is rejected before the division, because no finite width satisfies A equals zero times w unless the area is also unconstrained nonsense.
A negative area is rejected because no drawable rectangle has a negative enclosed region.
What you send and what you get back
Provide two required finite numbers: area is the enclosed surface of the rectangle and length is one known side. Area must not be negative; zero area is accepted and produces width zero. Length must not be zero, because width is recovered by dividing area by length and a zero denominator is undefined.
Example checks: area forty with length eight yields width five; area twelve point five with length two point five yields width five; a length of zero or an area 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 continuous integration stays cheap while production calls remain predictable.
Where rectangle-width calculations show up in real work
Secondary-school and college geometry courses constantly ask students to find the width of a rectangle given the area and the length, often after the forward area problem has already been practiced. That search is not the same as a rectangle-area landing: learners who type width of a rectangle already have A and one side and want the unknown adjacent side, not another product worksheet that assumes both sides are known.
Construction, flooring, painting, and landscaping workflows often inherit area from a takeoff sheet or a target square footage while one wall is measured on site; recovering width then sizes boards, tile modules, sod rolls, and paint once the missing run is known. Architecture and interior design tools review axis-aligned room plans when occupancy or finish schedules publish area and one wall length; width is the missing clearance. Game, graphics, and computer-aided design libraries store area-constrained rectangles and one fixed extent; deterministic width supports packing heuristics without a full computational-geometry stack.
If you later need the forward area from length and width, the side of a square from area, rectangular prism volume, or unit conversion between metres and feet, treat those as separate search intents rather than overloading this width-of-a-rectangle landing.
What you can do with it
Homework and exam checks
Recover rectangle width from area and length, and reject a zero length or a negative area with a clear error.
Rooms, floors, and material takeoffs
From a known floor area and one measured wall, recover the missing run for flooring, paint, sod, and boards.
Bounding boxes in games and CAD
Turn a constrained area and one fixed extent into width for layout, packing, and axis-aligned box metrics.
FAQ
How do I find the width of a rectangle from its area?
Send two finite numbers: the area and the known length. Area must not be negative and length must not be zero.
What happens if the length is zero?
Width is area divided by length, so a zero length is an undefined quotient, not a drawable rectangle, and is not billed.
Why is a negative area rejected?
No real rectangle has a negative enclosed region. Zero area is allowed and yields width zero.
Is this the same as a rectangle area calculator?
No. A rectangle-area tool multiplies length by width. This landing is the inverse: you already have the area and one side, and you want the unknown width.
Does it work with decimal measurements?
Yes. Decimals are handled the same way as whole numbers, so an area of 12.5 with a length of 2.5 gives a width of 5.
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/math/width-of-a-rectangle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"area":40,"length":8}'const res = await fetch("https://api.kit.forhosting.com/math/width-of-a-rectangle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"area": 40,
"length": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/width-of-a-rectangle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"area": 40,
"length": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/width-of-a-rectangle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"area":40,"length":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"area":40,"length":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/width-of-a-rectangle", 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": 40,
"length": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.width_of_a_rectangle",
"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 or non-finite value, a length of zero, or a negative area is rejected with a clear invalid_input error instead of a silent nonsense width. No network calls, no random sampling, and no floating-point surprises beyond ordinary IEEE-754 division on the numbers you provide.
How rectangle width is recovered from area and length
Huge magnitudes can still overflow the IEEE-754 double range; when the quotient is not 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 two numbers. The response echoes the given area, the given length, the computed width, and a short formula string so logs, worksheets, and teaching interfaces can document the algorithm without re-deriving it.
What you send and what you get back
Missing fields, empty strings, non-numeric text, NaN, Infinity, a length of zero, a negative length, and any negative area are rejected with invalid_input and are not charged. On success the JSON response returns area, length, width, and formula set to the quotient identity so logs and teaching interfaces can document the algorithm. Numeric strings and integers are accepted the same way as JSON numbers. API pricing is the published base of $0.002 per successful item.
Where rectangle-width 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.
Technical questions
What does the width of a rectangle calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.