# Retaining Wall Calculator

Page: https://pilemath.com/retaining-wall-calculator/

Plan a block retaining wall in three steps: every block, cap and ton of gravel, geogrid for taller walls, a to-scale drawing of your wall, and a height check before you build.

By [Vijay Kumar Singh](https://pilemath.com/about/#owner) · Last reviewed November 24, 2026 · [12 sources](https://pilemath.com/retaining-wall-calculator/#sources)

## Example

The calculator opens with this example. To run it with other numbers, open the page, or change this link (the link format is in https://pilemath.com/llms.txt): https://pilemath.com/retaining-wall-calculator/?a=w20x2&b=standard&c=1&g=auto&x=5&pb=4.5&pc=5&pg=40&pr=50&pp=1.5&pf=0.3&pq=100&t=1500

### You need about

- **79** wall blocks
- **16** cap blocks

- **Wall length:** 20 ft
- **Wall face:** 40 sq ft
- **Courses, tallest section:** 5 (1 buried)
- **Weight of block:** 3,766 lb

**Materials list**

- **Wall blocks:** 79 · $356. 6 × 16 in face · 5 courses, with 1 buried course · 5% extra
- **Cap blocks:** 16 · $80. 16 in long, in one row along the top
- **Base gravel:** 1.11 tons · $44. 0.74 yd³ · trench 6 in deep, 20 in wide · +20% for compaction
- **Drainage stone:** 2.75 tons · $138. 2.04 yd³ · a 12 in band of clean stone behind the blocks
- **Perforated drain pipe:** 20 ft · $30. 4 in pipe along the back of the base. Needed for walls over 4 ft and wet sites.
- **Filter fabric:** 55 sq ft · $17. Between the drainage stone and the soil
- **Cap adhesive:** 3 tubes. 10 oz tubes, two 3/8 in beads along the wall

- Total: $665

Using example prices. Open “Enter your prices” to use your own.

[Find retaining wall block suppliers near you](https://www.google.com/maps/search/retaining%20wall%20block%20supplier%20near%20me) to compare prices.

## Blocks for common walls

Wall blocks for the block chosen above, including the buried course and your 5% extra.

| Wall length | 1 ft tall | 2 ft tall | 3 ft tall |
| --- | --- | --- | --- |
| 10 ft | 26 blocks | 42 blocks | 59 blocks |
| 20 ft | 48 blocks | 79 blocks | 111 blocks |
| 30 ft | 73 blocks | 121 blocks | 170 blocks |
| 50 ft | 120 blocks | 200 blocks | 280 blocks |

## Key numbers

- **Buried:** about 10% of the wall height, and at least one full course
- **Base:** 6 in of compacted gravel, in a trench twice as wide as the block is deep
- **Drainage:** a 12 in band of clean stone behind the blocks
- **Geogrid:** usually above about 3 ft: a layer every other course, about 60% of the wall height long
- **Engineer:** walls holding back more than 4 ft of soil need an engineered design under most codes

## How the calculator works

1. Courses: height above ground ÷ block height, rounded up, plus a buried course of about 10% of the wall height, never less than one full block.
2. Blocks: courses × blocks per course (section length ÷ block length, rounded up), plus your extra for cuts and breakage.
3. Caps: one row along the top, section length ÷ cap length, rounded up.
4. Base: a trench twice as wide as the block is deep, with 6 in of compacted gravel, plus 20% because gravel shrinks when it is compacted.
5. Drainage: a 12 in band of clean stone behind the blocks, the full height of the block stack, plus 10%.
6. Pipe and fabric: perforated pipe along the back of the base, and fabric between the drainage stone and the soil, plus 10%.
7. Geogrid (sections over 3 ft): a layer on top of the bottom course, then every other course, never more than 16 in apart. Each piece runs back from the face 60% of the wall height, rounded up to the next half foot, cut from 4 × 50 ft rolls and butted side by side.

## Block sizes we use

| Block | Face | Depth | Weight | Blocks per sq ft |
| --- | --- | --- | --- | --- |
| Small garden block | 4 × 11.5 in | 7.5 in | 22.5 lb | 3.13 |
| Wall block | 6 × 16 in | 10 in | 42 lb | 1.5 |
| Large wall block | 8 × 18 in | 11.25 in | 76.5 lb | 1 |

From maker spec sheets: two common home-center blocks and the Allan Block AB Classic. Brands differ, so pick “Other: enter a size” and type in yours.

## Worked example: a 20 ft garden wall, 2 ft tall

The wall the planner opens with: one section 20 ft long and 2 ft tall above the ground, in 6 × 16 in wall blocks 10 in deep, with caps and 5% extra blocks.

1. Courses: 24 in ÷ 6 in = 4 above ground, plus 1 buried course (10% of the height, at least one block) = 5 courses.
2. Blocks per course: 240 in ÷ 16 in = 15. Blocks: 15 × 5 = 75, plus 5% = 79.
3. Caps: 240 in ÷ 16 in = 15, plus 5% = 16.
4. Base: a trench 20 in wide (twice the block depth) and 6 in deep, 20 ft long, plus 20% for compaction = 20 cubic feet, or 1.11 tons of gravel.
5. Drainage: a 12 in band behind the 30 in stack of blocks, 20 ft long, plus 10% = 55 cubic feet, or 2.75 tons of clean stone.
6. Pipe and fabric: 20 ft of perforated pipe and 55 sq ft of filter fabric. Caps glued down with 3 tubes of adhesive.
7. Cost at this page’s example prices: wall blocks $356, cap blocks $80, base gravel $44, drainage stone $138, perforated drain pipe $30, filter fabric $17.

**Answer:** 79 blocks and 16 caps, 1.11 tons of base gravel and 2.75 tons of drainage stone: about $664 in materials, or $16.60 per sq ft of wall face. No geogrid at this height.

## How to build it

- Call 811 a few days before you dig, so buried lines get marked.
- Dig a trench for the base, then spread and compact 6 in of gravel in it. Get it level: every course above follows the base.
- Bury the first course, about 10% of the wall height and at least one full block.
- As each course goes up, fill 12 in behind the blocks with [clean drainage stone](https://pilemath.com/stone-calculator/) such as #57, and compact the soil behind that in layers of 8 in or less.
- For walls over 4 ft, or on wet ground, lay perforated pipe along the back of the base and let it drain out to daylight at least every 50 ft.
- Glue the caps on with landscape block adhesive: a bead along the front and back of the top course.

## Geogrid for walls over 3 ft

Geogrid is a strong plastic mesh laid between courses and buried in the backfill. The soil on top of it holds the wall back, so a block wall can stand taller than the blocks could alone. The calculator adds it to every section over 3 ft, or to every section if you choose.

- Where it goes: the first layer on top of the bottom course, then every other course, never more than 16 in apart.
- How long: at least 60% of the wall height, measured from the face of the wall. A 4 ft wall in 8 in blocks is 7 courses with the buried one, 4.67 ft of block, so each piece runs 3 ft back.
- How to lay it: strong direction running back from the wall, pieces butted side by side at the face, edge against the back of the block’s front lip. Pull out the slack, stake it, then fill and compact over it in layers of 8 in or less.
- How far to dig: back as far as the grid reaches. Fill that zone with gravel or soil with few fines, not wet clay.
- Many block makers publish their own grid charts. If yours asks for more layers or longer grid, follow it. Walls over 4 ft still need an engineer’s design under most codes.

## How tall can a block wall be?

Start with the block maker’s limit. Small garden blocks are often rated for walls up to about 2 ft, and common 6 in wall blocks for about 3 ft. The calculator warns you when your wall is taller than the block is rated for. Taller walls need heavier blocks, layers of geogrid in the backfill, or both.

Most US building codes (IRC R404.4) require an engineered design for a wall that holds back more than 4 ft of soil, and local rules can be stricter. On a steep slope, two shorter terraced walls are often simpler than one tall one. Check with your building department before you start.

## Building on a slope

When the ground slopes along the wall, step the base instead of tilting it. Allan Block’s guidance: start the base trench at the lowest point, and dig each step up deep enough for the base gravel plus a block that is completely buried. Every course stays level; only the base steps.

To plan it here, enter each stretch between steps as its own section, with the height of wall showing above ground there. The calculator adds the buried course and base for every section and draws the tallest one. If the ground also slopes away below the wall, talk to an engineer first.

## What does a retaining wall cost?

| What you pay for | Typical price |
| --- | --- |
| Segmental block wall, installed | $15–$35 per sq ft of wall face |
| Retaining walls of all kinds, installed (average) | $35–$65 per sq ft of wall face |
| Engineering for a taller wall | $500–$2,000 or more |
| Permit | About $25–$100 |
| Adding drainage to an existing wall | $60–$70 per linear foot |

Sources: HomeGuide (January 2026) and Fixr (January 2025). Built yourself, the materials for the worked example above come to about $16.60 per sq ft of wall face at this page’s example prices.

## Mistakes to avoid

- A base that is not level and compacted. Every course copies the one below, so a dip in the base becomes a wave in the top of the wall.
- Backfilling with the soil you dug out. Clay holds water, and wet soil pushes hard on a wall. Use clean drainage stone right behind the blocks.
- No buried course. The bottom course in the ground keeps the wall from sliding out at the base.
- Skipping geogrid on a taller wall, or cutting it short. Lay every layer the calculator lists, at full length.
- Forgetting what sits above the wall. A driveway, a parked car, a building or a steep slope above the wall pushes much harder than flat ground. The code asks for an engineered design once such a wall is over 24 in tall, well under the usual 4 ft.

## Common questions

### How many retaining wall blocks do I need?

Courses × blocks per course. A 20 ft wall 2 ft tall in 6 × 16 in blocks has 4 courses above ground plus 1 buried, at 15 blocks per course: 75 blocks, or 79 with 5% extra.

### How many caps do I need?

One row along the top: wall length ÷ cap length. A 20 ft wall with 16 in caps takes 15 caps, or 16 with 5% extra.

### How much gravel goes behind a retaining wall?

A 12 in band of clean stone behind the blocks, the full height of the wall. For a 20 ft wall 2 ft tall with one buried course, that is about 2.0 cubic yards, or 2.75 tons, with 10% extra.

### How deep should the base be?

6 in of compacted gravel, in a trench about twice as wide as the block is deep: 20 in wide for a 10 in deep block. The first course of blocks then sits below the ground on top of it.

### When does a retaining wall need geogrid?

Usually once it is taller than about 3 ft, or taller than the block maker rates the block for on its own. Below that, the weight of the blocks holds the soil back.

### How much geogrid do I need?

For a 20 ft wall 4 ft tall in 8 × 18 in blocks: 7 courses with the buried one, so 3 layers, each 3 ft long. That is 15 pieces of 4 ft wide grid, 180 sq ft, or 1 roll of 4 × 50 ft.

### How much of the wall goes underground?

About 10% of the wall height, and at least one full course. Allan Block suggests 1 in of burial for every foot of wall height, on top of a 6 in base.

### Do I need a permit for a retaining wall?

Walls that hold back more than 4 ft of soil need an engineered design under most building codes (IRC R404.4), and local rules can be stricter. Check with your building department before you build.

### How much does a retaining wall cost?

A segmental block wall costs about $15–$35 per sq ft of wall face installed, according to HomeGuide (January 2026) and Fixr; HomeGuide’s average for all wall types is $35–$65. Built yourself, the materials for a 20 ft wall 2 ft tall come to about $664 at this page’s example prices.

### How do I build a retaining wall on a slope?

Step the base, not the wall. Start the base trench at the lowest point, and dig each step up deep enough for the base gravel and a fully buried block, keeping every course level. Enter each stretch between steps as its own section here.

### How much gravel goes under a retaining wall?

6 in of compacted gravel in a trench twice as wide as the block is deep, plus about 20% for compaction. For a 20 ft wall in 10 in deep blocks that is 1.11 tons.

## Sources

We checked the figures on this page against these sources on November 24, 2026. Prices are national ranges from the dates shown; your local yard may charge more or less.

1. [How to Install a Retaining Wall](https://allanblock.com/installation/residential-installation/basic-installation), Allan Block. Base depth, burial, wall rock behind the block, drain pipe and compaction.
2. [Building a Retaining Wall on a Slope](https://allanblock.com/installation/residential-installation/stepping-up-the-base), Allan Block. Stepping the base on a slope.
3. [AB Reinforcement Grid](https://allanblock.com/installation/residential-installation/ab-reinforcement-grid), Allan Block. Geogrid on every other course to the top of the wall.
4. [Reinforced Soil Walls and Geogrid Systems](https://allanblock.com/installation/commercial-installation/reinforced-soil-walls), Allan Block. Grid at least 60% of the total wall height, in layers about 16 in apart.
5. [Geogrid Spec Guidelines](https://allanblock.com/PDF/Geogrid-Spec-Guidelines.pdf), Allan Block. Laying geogrid: strength direction, butted pieces, lifts and backfill.
6. [International Residential Code R404.4: Retaining walls](https://codes.iccsafe.org/s/IRC2021P3/chapter-4-foundations/IRC2021P3-Pt03-Ch04-SecR404.4), International Code Council. Engineered design for walls retaining more than 48 in of soil, or over 24 in that also hold back other loads.
7. [Retaining Wall Calculator](https://rogueengineer.com/retaining-wall-calculator/), Rogue Engineer. One full buried course; geogrid above about 3 ft.
8. [PROvantage Landscape Construction Adhesive](https://www.titebond.com/product/adhesives/d593f33d-309b-4cfa-a997-46ec883fa207), Titebond. Cap adhesive coverage per tube.
9. Maker spec sheets for the small garden block and the 6 × 16 in wall block, Lowe’s product listings. Block sizes, weights and rated wall heights.
10. AB Classic product catalog, Nitterhouse Masonry. Size and weight of the large block and its cap.
11. [How Much Does a Retaining Wall Cost?](https://homeguide.com/costs/retaining-wall-cost), HomeGuide (January 2026). Installed prices and engineering costs.
12. [Retaining Wall Cost](https://www.fixr.com/costs/retaining-wall-building), Fixr (January 2025). Segmental wall prices, permits and adding drainage.

See a figure that does not match your supplier? [Tell us](https://pilemath.com/contact/) and we will check it. [How we check our numbers](https://pilemath.com/about/#how-we-check).

## More calculators

- [Paver Calculator](https://pilemath.com/paver-calculator/): Pavers by size and pattern, paver base, bedding sand, polymeric sand and edging.
- [French Drain Calculator](https://pilemath.com/french-drain-calculator/): Stone, pipe, fittings and fabric for a French drain, with the fall to the outlet.
- [Crushed Stone Calculator](https://pilemath.com/stone-calculator/): Tons of #57, #8, crusher run or riprap, with a stone size guide.
- [Landscaping Pricing Calculator](https://pilemath.com/landscaping-pricing-calculator/): Price a landscaping job from materials, labor, equipment and overhead at the margin you want.
