Retaining wall calculator
A wall 10 m long and 1.2 m high built from 0.4 by 0.2 m blocks takes 150 wall blocks plus 20 cap units of 0.5 m: two separate order lines, each rounded up to whole pieces. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Wall length
- 10
- Wall height
- 1.2
- Block length
- 0.4
- Block height
- 0.2
- Cap length
- 0.5
- Courses exact
- 6
- Courses
- 6
- Blocks per course exact
- 25
- Blocks per course
- 25
This retaining wall calculator converts a measured wall run, finished height, and modular block face size into two purchase counts: the wall blocks that form the stacked face, and the cap units that finish the top as coping stones. Enter wall length, wall height, block length, and block height in one consistent linear unit. Optional cap length defaults to the block face length when the coping stone matches the block module. The engine ceilings height into courses, ceilings length into blocks per course, multiplies those integers for the wall-block order, then ceilings length by cap length for a separate cap-unit count because caps are a different SKU sitting on top of the wall rather than replacing the last course. The work is pure deterministic arithmetic with no network calls, no sampling, and no date-dependent shortcuts.
Where a retaining-wall take-off with caps earns its keep
Homeowners meet this calculation when a garden terrace, driveway cut, or raised planter needs a modular block order and a matching cap pallet before the weekend delivery, or when a second pallet of coping stones must not surprise the budget after they counted only face blocks by eye.
Landscapers and small hardscape crews use the same numbers to turn a measured elevation into two shopping-list lines at the merchant yard: wall blocks for the stacked face and cap units for the finished top, then add corners, radius pieces, and a buried base course on top of the pure geometric counts.
Product and education tools show learners why ceiling the run and the height separately matters more than dividing total face area by one block face, and why the cap is a second SKU even when its length matches the block. This is not a brick count for a freestanding wall, not a concrete-volume pour, and not a gravel-backfill tonnage: those are different search intents with different inputs.
Pair it with gravel or fence helpers when you are building a small lab of free, deterministic site calculators, and keep field judgement for setbacks, drainage, geogrid, and the waste margin your crew actually leaves on the ground.
What you can do with it
Hardscape quotes with separate cap SKUs
Turn elevation schedules into two line items — stacked face blocks and coping units — so the quote matches how the merchant sells the wall.
FAQ
What happens if a dimension is zero or negative?
Wall length, wall height, block length, block height, and any provided cap length must each be a positive number; a wall with no extent cannot consume blocks.
What does the retaining wall calculator cost?
It is free in your browser on this page.
How many blocks do I need for a 10 m retaining wall 1.2 m high?
With blocks 0.4 m long and 0.2 m high you need 6 courses of 25, so 150 wall blocks. Caps 0.5 m long add 20 units on top, for 170 pieces in total.
Why are cap units counted separately from wall blocks?
Caps are a different product that sits on top of the wall and finishes it; they do not replace the last course. Their count is the wall length divided by the cap length, rounded up, and the cap length matches the block when you leave it out.
Why not just divide the wall area by the area of one block?
Because height and length are rounded up separately to whole courses and whole blocks. A 1.1 m wall on 0.2 m blocks needs 6 courses, not five and a half, and a 7.3 m run of 0.45 m blocks gives 16.22 per row, which becomes the next whole number.
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/build/retaining-wall \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"wall_length":10,"wall_height":1.2,"block_length":0.4,"block_height":0.2}'const res = await fetch("https://api.kit.forhosting.com/build/retaining-wall", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"wall_length": 10,
"wall_height": 1.2,
"block_length": 0.4,
"block_height": 0.2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/build/retaining-wall",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"wall_length": 10,
"wall_height": 1.2,
"block_length": 0.4,
"block_height": 0.2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/build/retaining-wall", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"wall_length":10,"wall_height":1.2,"block_length":0.4,"block_height":0.2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"wall_length":10,"wall_height":1.2,"block_length":0.4,"block_height":0.2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/build/retaining-wall", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"wall_length": 10,
"wall_height": 1.2,
"block_length": 0.4,
"block_height": 0.2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "build.retaining_wall",
"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.
Limits
max_abs | 1000000000 |
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
Every dimension must be a finite positive number: zero or negative length, height, or block size is rejected as invalid_input instead of a hollow zero. Use it free in the browser before you order, or call the API at $0.002 per successful request when estimating software needs a reproducible take-off.
How courses become wall blocks and a separate cap-unit count
A modular retaining wall is ordered as two product lines even when they share a face module: stacked face blocks that hold the grade, and cap or coping units that close the top, shed water, and give a finished seat. This calculator never treats the cap as a free extra you can ignore, and it never silently folds the last course into the cap SKU. There is no manufacturer SKU table, no geogrid schedule, no buried base course, and no setback batter: those are site judgements you apply after you have a clean geometric take-off. It first forms courses as the ceiling of wall_height divided by block_height, so a 1.1 m wall on 0.2 m blocks becomes six courses, not five-and-a-half. It then forms blocks_per_course as the ceiling of wall_length divided by block_length, so a 7.3 m run of 0.45 m blocks becomes seventeen pieces per row rather than a fractional 16.22 that no merchant will cut for you. wall_blocks is the product of those two integers: every course, including the top structural course, is a wall block. cap_units is a separate ceiling of wall_length divided by cap_length, because the coping stone sits on top of the finished height rather than replacing the last row. When cap_length is omitted, the engine uses block_length so a matching module still returns a distinct cap count you can buy as a different pallet. The response echoes the parsed dimensions, the exact ratios before ceiling, the integer courses and blocks_per_course, wall_blocks, cap_units, total_units as wall_blocks plus cap_units, and a short formula string for audit.
Input contract, units, defaults, and error behaviour
Keep metres with metres or feet with feet: the engine never converts units, so mixing centimetres for the block and metres for the wall would silently produce a wrong course count. Failed validation is not billed. POST a JSON body with four required fields and one optional field. wall_length is the run along the grade (aliases length, L, run, wall_run) and must be a finite strictly positive number. wall_height is the finished face height from the top of the base course to the wall top before the cap is seated (aliases height, H, wall_h) and must likewise be strictly positive. block_length is the horizontal face dimension along the wall (aliases block_width, face_length, unit_length, bl) and block_height is the course height (aliases face_height, unit_height, course_height, bh). cap_length is optional (aliases cap_unit_length, coping_length, cap_width): when you omit it, the engine copies block_length so a matching module still yields a distinct cap_units integer; when you send it, it must be a finite strictly positive number of its own. Missing fields, empty strings, non-finite values, and magnitudes above the supported ceiling fail with invalid_input naming the field. A zero or negative dimension fails with a message that the named wall_length, wall_height, block_length, block_height, or cap_length must be a positive number, matching the rule that a wall with no extent cannot consume blocks. On success the body echoes the parsed dimensions, courses_exact and courses, blocks_per_course_exact and blocks_per_course, wall_blocks, cap_units_exact and cap_units, total_units, and the formula string. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline; nothing is stored after the response returns, and the work never leaves your isolate for a model or a network hop.
Where a retaining-wall take-off with caps earns its keep
Estimators embed the contract in take-off tools so a schedule of run length, finished height, modular face size, and optional cap length becomes integer courses, wall_blocks, and cap_units without a spreadsheet full of hidden ceiling cells. On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — lets you move from a phone check at the merchant to an automated pipeline without changing the mathematical result.
Integration use cases
Garden terrace and planter walls
Convert measured run, finished height, and modular block size into wall_blocks plus a matching cap_units order before you buy.
Estimating software and fixtures
Generate deterministic wall_blocks, cap_units, and total_units for quotes, unit tests, and automated take-off pipelines.
Technical questions
How many blocks and cap units do I need for a retaining wall?
Send wall_length, wall_height, block_length, and block_height in one unit system. The API returns wall_blocks as courses times blocks per course, and cap_units as the ceiling of length over cap length (defaulting to block length).
Are cap units included in the wall-block count?
No. wall_blocks covers every structural course, including the top row. cap_units is a separate SKU that sits on top of the finished height. total_units is the sum of the two.
What if my cap stone is a different length from the wall block?
Send cap_length. The engine ceilings wall_length by that value independently of block_length, so a 10 m wall with 0.4 m blocks and 0.5 m caps yields 25 blocks per course and 20 cap units.