Retaining wall calculator

Blocks, caps, base and drainage gravel and drain pipe for a segmental block wall, with the total cost and a check on when you need a permit or an engineer.

Your wall

Wall face 60 sq ft

Block size (face height x length)

Large wall block, about 12 in deep. Sold as 1 sq ft of face per block.

$
$
$

Wall blocks

74

5 courses of 14, 5% extra

DIY materials

$0

a pro charges more

Cross-section of the wall

Stone

5 tons

Bury

8 in

Caps

15

Shopping list

Tick as you shop
    Estimated total $0

    Hiring it out: about $0 to $0 installed.

    Quoting this wall for a client?Turn it into a branded PDF quote with HomeOutlay Pro.

    Advertisement

    Ad space

    How to calculate blocks for a retaining wall

    A segmental retaining wall is a stack of dry-laid concrete blocks on a gravel base, with clean stone behind it so water can drain out instead of pushing on the wall. The math is courses times blocks per course, but the buried row and the cap change the count. Here it is with the values the calculator opens with: a wall 20 ft long that shows 3 ft above the ground, built with 8 x 18 inch blocks and capped.

    1. 1

      Add the buried course

      The bottom of the wall sits below grade: at least 6 inches, or 1 inch per foot of wall height if that is more. A wall that shows 36 inches needs at least 6 inches buried, so you build 42 inches of wall.

    2. 2

      Count the courses

      Take off the 4 inch cap and divide by the block height: (42 − 4) ÷ 8 = 4.75, so 5 courses. Five courses plus the cap stand 44 inches, which means you bury 8 inches to show exactly 36.

    3. 3

      Blocks per course

      Divide the length in inches by the block length: 240 ÷ 18 = 13.3, so 14 blocks per course. 5 x 14 = 70 blocks. Add 5% for cuts and chipped blocks and buy 74. Caps run the length once: 14, or 15 with the same 5%.

    4. 4

      Stone for the base and drainage

      The base trench is 18 inches wide with 6 inches of compacted stone: 20 x 1.5 x 0.5 = 15 cubic feet. Behind the blocks goes a 12 inch zone of clean stone, 40 inches tall: 20 x 1 x 3.33 = 66.7 cubic feet. Together that is 3.0 cubic yards. At 1.4 tons per yard, plus 10% for compaction, order 5 tons.

    5. 5

      Pipe, fabric and the total

      The drain pipe runs the length of the wall plus 10 ft to daylight: 30 ft. Filter fabric lines the back of the stone, about 96 sq ft. At the default prices the whole list, with a day of plate compactor rental, comes to $998.

    The calculator rounds the stone to the next half ton because most yards sell it that way, and it buys pipe by the foot. If you change the block size, it reruns all five steps with the new height and length.

    Common block sizes

    Wall block comes in three broad sizes. The face height sets how many courses you lay, and the depth (front to back) is what lets bigger blocks hold back more soil without reinforcement.

    Block (H x L x D)Blocks per sq ftTypical use
    4 x 12 x 7 in3.0Garden edging and raised beds, about 2 ft high
    6 x 16 x 10 in1.5Landscape walls up to about 3 ft
    8 x 18 x 12 in1.0Structural walls, about 3½ ft before geogrid

    The heights in the last column are rough rules for a level slope above the wall and firm soil. Every maker publishes a chart of how tall each block can go as a gravity wall, and it shrinks fast with clay soil, a slope above the wall or a driveway near the top. Past that height, the wall needs layers of geogrid buried in the backfill, and the design should come from the manufacturer's tables or an engineer.

    Base, drainage and why walls fail

    Most block walls that lean or bulge did not fail because of the blocks. They failed because water built up behind them or the base settled. Wet soil weighs more and pushes harder, and in cold climates it freezes and heaves. The stone zone and the drain pipe give that water a way out.

    • Base trench. Allan Block's installation guide calls for a trench 24 inches wide for walls 4 ft and taller, and 18 inches wide below that, with at least 6 inches of compacted stone. Do not use sand.
    • Drainage zone. Fill the block cores and a band 12 inches deep behind the wall with clean, angular stone, compacting as you go. The top few inches can be topsoil if you want to plant.
    • Drain pipe. Lay a 4 inch perforated pipe at the back of the base and vent it to daylight at least every 50 ft. Allan Block requires one on gravity walls over 4 ft, on reinforced walls and on poorly drained sites.
    • Filter fabric. A layer of non-woven fabric between the native soil and the stone keeps fine soil from clogging the stone over the years.

    Permits, engineers and the 4 ft line

    The International Residential Code (section R105.2) exempts retaining walls that are not over 4 feet tall, measured from the bottom of the footing to the top of the wall, unless the wall supports a surcharge. A surcharge is extra load on the soil above: a driveway, a parked car, a slope, a fence or a building. The 4 ft is measured from the bottom of the footing, so a wall that shows 3 ft can already be over the line if your inspector counts the gravel base as the footing: the default wall shows 36 inches but measures 4 ft 2 in from the bottom of the base. The calculator shows that full height under the drawing. Asking the town how it measures can be the difference between a permit and none.

    Your town may set a lower limit, ask for a permit for any wall near a property line, or require an engineer's stamp for terraced walls. Call the building department before you dig, and call 811 a few days ahead so buried lines get marked. Walls holding up a driveway, a house foundation or a steep hill are engineering jobs at any height.

    What it costs: DIY vs. hiring a pro

    LawnStarter's October 2026 guide puts the national average for a retaining wall at about $6,300, with most homeowners paying $3,500 to $9,400. Interlocking concrete block runs about $15 to $35 per square foot installed, and permits cost about $40 to $450 where they are needed. DIY figures below are this calculator's totals at the default prices, with caps, pipe and fabric.

    Wall, 8 x 18 blockDIY materialsInstalled by a pro
    10 ft x 2 ft$480$300–$700
    20 ft x 3 ft$998$900–$2,100
    40 ft x 3 ft$1,827$1,800–$4,200
    50 ft x 4 ft$3,001$3,000–$7,000

    The pro column is $15 to $35 per square foot of exposed face. It often lands close to the DIY material cost on small walls because the contractor buys block by the pallet at a lower price. The gap opens on longer and taller walls, and so does the work: the blocks in the 40 ft wall weigh several tons, every one lifted by hand, and the trench and stone come out and go in by wheelbarrow. Hire out walls over 4 ft, walls that hold up a driveway or slope, and anything that needs geogrid.

    Tips from the trade

    • Spend your time on the first course. Level each block front to back and side to side on the compacted base. Any error in the first row shows up three times bigger at the top.
    • Compact in lifts. Compact the base, then the stone behind each course or two. A plate compactor is worth the rental; a hand tamp is fine for small garden walls.
    • Stagger the joints. Offset each course so vertical joints fall near the middle of the block below, at least a quarter of a block over.
    • Step the base on a slope. On sloped ground, step the trench down in block-height steps instead of tilting the wall.
    • Glue the caps. Use a concrete adhesive made for wall caps, two beads per block, so the top row cannot be knocked off.
    • Keep downspouts away. Do not aim a gutter or a sump outlet at the top of the wall. Steer surface water around it with a shallow swale.

    Common questions

    How many retaining wall blocks do I need?

    Divide the wall length by the block length to get blocks per course, then multiply by the number of courses, counting the buried course. A 20 ft wall that shows 3 ft, built with 8 x 18 inch blocks, takes 5 courses of 14 blocks. With 5% extra that is 74 blocks plus 15 caps.

    How tall can a retaining wall be without a permit?

    The International Residential Code exempts retaining walls up to 4 feet tall, measured from the bottom of the footing to the top of the wall, unless the wall holds back a surcharge such as a driveway, a slope or a building. Many towns set their own, lower limits, so call your building department.

    How much gravel do I need behind a retaining wall?

    Plan on a 6 inch compacted gravel base and a zone of clean crushed stone about 12 inches deep behind the blocks, as tall as the wall. A 20 ft wall that is 40 inches tall in block takes about 5 tons of stone in total.

    Do I need a drain pipe behind a retaining wall?

    Allan Block requires a drain pipe on gravity walls over 4 feet, on any reinforced wall and on any site with poor drainage. On shorter walls it is cheap insurance. Lay a 4 inch perforated pipe at the back of the base and run it out to daylight.

    How deep should the first row of retaining wall blocks be buried?

    Bury at least 6 inches of block, or 1 inch for every foot of wall height if that is more, on top of the gravel base. The buried course keeps the bottom of the wall from kicking out.

    How much does a retaining wall cost?

    LawnStarter puts the national average at about $6,300, with most homeowners paying $3,500 to $9,400. Interlocking concrete block walls run about $15 to $35 per square foot installed. Doing it yourself costs mostly the blocks and gravel, often $15 to $25 per square foot of wall face.

    Sources and assumptions

    Block counts and volumes are plain geometry. Build details follow a major block maker's published instructions, and costs come from a 2026 cost survey. Prices are typical US prices checked in October 2026; block, cap and stone prices can be edited.

    • Base, buried course, drainage zone and drain pipe: Allan Block, basic installation (trench 18 in wide under 4 ft and 24 in wide above, at least 6 in of compacted wall rock, 12 in of wall rock behind the block, pipe vented every 50 ft) and its material estimation worksheet (bury at least 6 in, or 1 in per foot of height).
    • Permit threshold: 2021 International Residential Code, section R105.2, which exempts retaining walls not over 4 ft from the bottom of the footing unless they support a surcharge. Local codes often differ.
    • Installed cost (average $6,300, typical $3,500 to $9,400, $15 to $35 per sq ft for interlocking block, $2 to $10 per block, permits $40 to $450): LawnStarter, retaining wall cost (October 2026).
    • Block sizes and prices: 4 x 12 x 7, 6 x 16 x 10 and 8 x 18 x 12 inch are the sizes most home centers stock; an 8 x 18 block is sold as 1 sq ft of face. Default prices of $3.25, $5 and $7.50 per block and $3, $4.50 and $6 per cap are our estimates inside LawnStarter's $2 to $10 range; store pages hide prices by ZIP code, so enter your local price.
    • Stone: clean crushed stone at $40 per ton and 1.4 tons per cubic yard, plus 10% for compaction, in line with HomeGuide's gravel prices. Rounded up to the next half ton.
    • Fixed prices (estimates): 4 in perforated drain pipe $1.20 per ft, non-woven fabric $0.25 per sq ft with 10% overlap, cap adhesive $7 a tube per 20 caps, and plate compactor rental $86 a day per LawnStarter. Cap heights are taken as 3 in for the small and medium blocks and 4 in for the large one.
    • Gravity heights in the block table and the warning under the drawing (2, 3 and 3½ ft) are cautious rules of thumb, not engineering. Use the manufacturer's chart for your block, soil and slope.
    • Digging: call 811 before you dig.