Carpet calculator
A 5 by 4 m room with a 4 m roll needs one 5 m strip, or 5.5 linear metres with 10 percent waste, instead of two strips totalling 8 m. The calculator tries both directions and keeps the shorter run. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Room length
- 5
- Room width
- 4
- Roll width
- 4
- Waste percent
- 10
- Room area
- 20
- Waste factor
- 1.1
- Waste area
- 2
- Area with waste
- 22
Ordering carpet by guesswork is how rooms end up short one strip or with an expensive leftover that never matches the dye lot. This carpet calculator turns four practical numbers into a clear purchase plan: the length and width of the room, the fixed width of the roll your supplier stocks, and a waste percentage for seams, cuts, and pattern matching. It compares both ways of running strips across the rectangle, keeps the orientation that uses fewer raw linear metres, inflates that run by the waste factor, and multiplies by roll width so you also see the carpet area you are actually buying. Keep every linear field in one unit system—metres throughout or feet throughout—and treat the waste percent as the allowance your fitter recommends for the pile, pattern, and room shape you chose.
Carpet is sold by the metre of roll, not by the square metre
Shops cut carpet from a roll of fixed width, so what you order is a length of that roll, not a shape. To cover a rectangle, the strips can run along the room or across it. Along the length, you need as many strips as it takes to cover the width, each as long as the room; across, it is the other way round, and a partial strip still counts as a whole one. The calculator works out both layouts and keeps the one with fewer raw linear metres. In a 5 by 4 m room with a 4 m roll, one strip along the length is 5 m, while running across would take two strips of 4 m, or 8 m in total.
Waste, units and the mistakes that leave a room short
Once the direction is chosen, the run is increased by your waste percentage for seams, cuts and pattern matching, then multiplied by the roll width so you see the carpet area you are really buying. With 10 percent waste, the 5 m run becomes 5.5 m. Use the allowance your fitter recommends for the pile, the pattern and the shape of the room, and enter zero only for a perfect fit. Keep every measurement in one system, metres throughout or feet throughout, because the calculator does not convert between them. Ordering too little means a missing strip later, and a second order may not match the dye lot of the first.
What you can do with it
DIY room shopping list
Measure room length and width, enter the supplier’s roll width and the waste percent your fitter suggests, and order linear metres without shortfall or bulk overstock.
Contractor room-by-room estimates
Feed each room’s edges and the SKU roll width into the same formula so purchase orders match the estimate and every orientation choice is auditable.
FAQ
What happens if a dimension is zero or negative?
Room length, room width, and roll width must all be strictly positive; a zero or negative size would make coverage undefined or non-physical.
Which units should I use?
Any consistent linear system: metres throughout, or feet throughout. Do not mix systems.
Why is waste percent required?
Seams, pattern matching, doorways, and fitting almost always need extra material. Use 0 only for a perfect single-strip fit; 10 is a common starting point for standard residential layouts.
What does it cost?
The browser tool is free and runs locally.
Why do I buy more carpet than the floor area of my room?
Because carpet comes off a fixed-width roll by the linear metre, plus your waste allowance. In the example, 5.5 m of a 4 m roll is 22 m² of carpet for a 20 m² room, and the extra 2 m² covers seams, cuts and fitting.
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/home/carpet \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"room_length":5,"room_width":4,"roll_width":4,"waste_percent":10}'const res = await fetch("https://api.kit.forhosting.com/home/carpet", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"room_length": 5,
"room_width": 4,
"roll_width": 4,
"waste_percent": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/home/carpet",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"room_length": 5,
"room_width": 4,
"roll_width": 4,
"waste_percent": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/home/carpet", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"room_length":5,"room_width":4,"roll_width":4,"waste_percent":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"room_length":5,"room_width":4,"roll_width":4,"waste_percent":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/home/carpet", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"room_length": 5,
"room_width": 4,
"roll_width": 4,
"waste_percent": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "home.carpet",
"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
The same pure function powers the free browser tool and the paid API, so a quote you generate on a phone matches the line item a script posts later. Zero or negative room edges and roll width are rejected with a clear invalid_input message instead of a silent divide-by-zero.
How the carpet linear-metre and area formula works
Start from how carpet is sold in practice: shops cut a fixed-width roll by linear metre, not by freeform polygons. Two strip layouts cover that rectangle. The calculator keeps the cheaper of those two raw linear totals so a four-metre roll in a four-by-five room does not force an unnecessary second strip when one strip already spans the shorter edge. Room area, waste area, and area with waste are reported in parallel so you can audit the plan against a floor-area quote. Waste percent must be non-negative so a zero-waste perfect fit remains expressible without inventing negative material. Your room is a rectangle of room_length by room_width, and the product is a roll of roll_width. In the first orientation, strips run along the room length: you need ceil of room_width divided by roll_width strips, each of length room_length, so linear_along_length equals that strip count times room_length. In the second orientation, strips run along the room width: ceil of room_length divided by roll_width strips each of length room_width gives linear_along_width. After the orientation is chosen, waste_factor equals one plus waste_percent divided by one hundred, linear_meters equals linear_raw times waste_factor, and area_needed equals linear_meters times roll_width—the sheet area you pay for when that length is cut from the roll. The pipeline is deterministic floating-point arithmetic with no random seeds, no wall-clock timestamps, and no network calls, so identical inputs always produce identical JSON. Room length, room width, and roll width must all be strictly positive: zero or negative dimensions are rejected with invalid_input because a zero edge would make coverage undefined and a negative edge is non-physical.
What you send and what you get back
All four fields are required. Classic checks include a five-by-four metre room with a four-metre roll and ten percent waste: one strip along the length yields five raw metres, five point five linear metres after waste, and twenty-two square metres of carpet area. Send four finite numbers: room_length and room_width for the rectangular floor plan in matching linear units, roll_width for the carpet roll width as printed on the product (for example four for a four-metre roll), and waste_percent as the extra material percentage (for example ten for a ten percent allowance). Missing fields, non-numeric strings, NaN, and Infinity fail with invalid_input and are not charged. When any room edge or the roll width is zero or negative the request fails with a message that dimensions must be positive, so clients can correct measurements before retrying instead of receiving Infinity metres. On success the response echoes cleaned inputs, room_area, waste_factor, waste_area, area_with_waste, both orientation candidates (strip counts and raw linear runs), the chosen orientation label, strips, linear_raw, linear_meters after waste, area_needed, spare_area_vs_room (how much purchased sheet area exceeds the bare room), a unit_note reminder to keep one unit system, and a short formula string for documentation. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.
Where carpet calculators show up in real work
Homeowners refreshing bedrooms, living rooms, and hallways need a trustworthy linear-metre figure before a showroom visit or online order, especially when broadloom has a high unit price and dye-lot continuity matters. If you later need floor tile box counts, underlay roll lengths, stair runners with tread and riser breakdowns, or L-shaped room polygons, treat those as separate search intents and landings rather than overloading this carpet linear-metre calculator page. Flooring contractors build room schedules from measured edges and manufacturer roll widths; a single deterministic endpoint that picks the cheaper strip orientation and applies waste reduces spreadsheet drift between the estimator and the purchasing clerk. Interior designers comparing three roll SKUs for the same plan can swap only roll_width and waste_percent while holding room edges fixed, then rank linear_meters and area_needed without re-deriving strip counts each time. Property managers planning multi-unit refreshes feed a batch of room sizes through the API and attach linear_meters to purchase orders so overstock stays intentional rather than accidental. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Roll SKU comparison for designers
Hold room edges fixed, swap roll width and waste across candidate products, and compare linear_meters and area_needed side by side.
Technical questions
How does this carpet calculator work?
It compares both strip orientations across the room rectangle, keeps the cheaper raw linear run, multiplies by (1 + waste_percent/100) for linear_meters, then multiplies by roll_width for area_needed.