Retaining Wall Calculator
Find how many blocks a retaining wall needs. Enter the wall length, the exposed height and the block size to get the block count, the cap blocks and the backfill gravel. Free, no sign-up, everything runs in your browser.
Formula: blocks = blocks per course x total courses. Blocks per course = round up (wall length / block length). Total courses = round up (exposed height / block height) + buried courses.
Formulas verified against standard references. Calculator logic tested with verified worked examples. Published: November 9, 2026 | Last updated: November 9, 2026. Fact-checked: November 9, 2026. Our methodology
How to Use the Retaining Wall Calculator
Getting a block count takes six quick entries. The tool counts blocks per course first, then the courses, then adds waste and works out the gravel.
- Enter the wall length in feet, measured end to end along the planned wall.
- Enter the exposed height in feet, the part you see above the ground, then the block length and height in inches.
- Enter the buried base courses, usually 1, and your waste allowance. 10% is typical.
- Press Calculate, or press Enter. The blocks to order appear first and large, with the caps, the face area and the gravel below. Press Reset to clear the form and start over.

The Retaining Wall Formula
The retaining wall formula is blocks = blocks per course x total courses. Each part means one thing, and both parts round up, because a part block still costs a whole block.
Blocks per course is the wall length in inches divided by the block face length, rounded up. A 20 ft wall with 12 in blocks needs round up (240 / 12) = 20 blocks per course. Total courses is the exposed height in inches divided by the block height, rounded up, plus the buried base courses. A 3 ft wall with 6 in blocks needs round up (36 / 6) = 6 exposed courses, plus 1 buried course, for 7 courses in total.
Multiply the two for the body blocks, then add waste. Cap blocks come from the wall length, not the face area, because there is one cap per block along the top course. Backfill gravel is the wall length x the exposed height x 1 ft for the drainage zone, divided by 27 for cubic yards. Our concrete block calculator covers the same counting for a plain block wall.
Worked Example: 20 ft by 3 ft
A wall is 20 ft long and 3 ft high above ground, built from 12 in by 6 in blocks, with 1 buried course and a 10% waste allowance. Here is exactly what the calculator does.
- Blocks per course: round up (240 / 12) = 20 blocks.
- Courses: round up (36 / 6) = 6 exposed courses, plus 1 buried = 7 courses.
- Body blocks: 20 x 7 = 140 blocks. With 10% waste, 140 x 1.10 = 154, so order 154 blocks.
- Caps: 20 along the top, with waste that is 22 caps. Gravel: 20 x 3 x 1 = 60 cu ft, which is 2.22 cu yd, about 3.0 tons.
As a second check, the same wall at 2.5 ft high with 4 in blocks needs round up (30 / 4) = 8 exposed courses, plus 1 buried = 9 courses, for 20 x 9 = 180 body blocks, or 198 with 10% waste, and 1.85 cu yd of gravel. The same steps work for any wall, so try your own numbers in the tool above.

Blocks, Caps and the Buried Course
The buried course is the part beginners miss. The first course sits below grade on a compacted gravel base, so it never shows, but it still costs blocks. The rule of thumb is to bury one full course, or 1 in for every 8 in of exposed height, whichever is more. A 4 ft wall needs at least 6 in buried, so one 6 in course is right, and a taller wall needs more.
Cap blocks finish the top of the wall and give it a clean edge. There is one cap per block in the top course, so a 20 ft wall with 12 in blocks needs 20 caps, and the same waste allowance applies, because caps chip in handling and on the saw just like body blocks. Some block systems use a different cap size, so check the cap coverage on the product you buy and enter it as the block length if it differs.
Backfill Gravel and Drainage
Most retaining walls fail from water, not from weak blocks, so the gravel behind the wall matters as much as the block count. The drainage zone is at least 12 in of clean gravel behind the full height of the wall, plus a perforated drain pipe at the base that carries water away. The calculator works out the gravel for that 12 in zone at 100 lb per cu ft, so a 20 ft by 3 ft wall needs 60 cu ft, which is 2.22 cu yd and about 3.0 tons.
Under the wall, allow 6 in of compacted gravel for the base, wider than the block depth, and set the first course level in both directions. Never backfill with soil straight against the blocks, because soil holds water and pushes the wall over. Geogrid reinforcement is often needed for walls over 3 ft, and walls over 4 ft usually need an engineered design, so treat the gravel as part of the structure, not as an optional extra.
When a Wall Needs an Engineer
Height is the line between a garden project and an engineered structure. In most US areas a wall over 4 ft tall, measured from the bottom of the footing to the top, needs a building permit, and many areas require an engineered design above that height. The exact threshold varies, so one call to your local building department settles it before you buy blocks.
Other warning signs are a wall that holds up a driveway, a building or a steep slope, soil that stays wet, or a wall with a surcharge load above it. If any of those apply, get a design from an engineer even for a shorter wall. This calculator counts materials only, and it never decides whether a wall height or a site is structurally suitable. Our concrete calculator and brick calculator cover the materials for the footings and garden walls that often go with the job.

Frequently asked questions
How many blocks do I need for a retaining wall?
Divide the wall length in inches by the block length for blocks per course, then divide the exposed height by the block height and add one for the buried base course. Multiply the two, then add 10% for waste. A 20 ft by 3 ft wall with 12 in by 6 in blocks needs 154 blocks.
How deep should the base course be buried?
Bury one full course, or 1 in for every 8 in of exposed wall height, whichever is more. A 4 ft wall needs at least 6 in buried. The buried course sits on 6 in of compacted gravel.
How much gravel goes behind a retaining wall?
Allow a 12 in drainage zone of clean gravel behind the full height of the wall. The volume is wall length x wall height x 1 ft, divided by 27 for cubic yards. A 20 ft by 3 ft wall needs 2.22 cu yd, about 3.0 tons.
Do I need a permit for a retaining wall?
In most US areas, walls over 4 ft tall need a building permit, and many require an engineered design above that height. The threshold varies by area, so check with your local building department before you build.
What block size should I use?
Small garden blocks at 12 in by 4 in suit borders up to 2 ft. Medium blocks at 16 in by 6 in suit walls of 2 to 3 ft. Standard segmental blocks at 18 in by 8 in suit walls of 3 to 5 ft. Match the block to your wall height.
How much waste should I add?
Add 10% for a straight wall with no corners or curves, and 15% for a wall with corners, curves or many end cuts. Blocks get cut at wall ends, chipped in handling and damaged in delivery.
This calculator gives a material estimate for planning. It does not decide whether a wall height or installation is structurally suitable. Walls over 4 ft tall usually need a permit and an engineered design. Check your local building code. See our disclaimer.
Related calculators
Concrete Block Calculator
Estimate concrete blocks for a wall.
Use calculatorConcrete Calculator
Work out how much concrete a slab or footing needs.
Use calculatorBrick Calculator
Estimate bricks and mortar for a wall.
Use calculatorDeck Calculator
Estimate decking boards and joists for a deck.
Use calculatorFence Calculator
Estimate posts, rails and pickets for a fence.
Use calculatorFraming Calculator
Estimate studs, plates, headers and sheathing for a wall.
Use calculator