You picked the house partly because of the backyard. Now you want to use it — add a deck, put up a shed, maybe extend the patio — and the first question your permit office will ask has nothing to do with the structure itself. It's: how far is this from your rear property line?
That distance is your rear yard setback, and it's set by your local zoning code, not by any national rule. Most single-family zones require somewhere between 10 and 30 feet between your main house and the rear lot line. Accessory structures like sheds usually get a much smaller number — often 3 to 5 feet — but the exact figure changes from one city, and sometimes one block, to the next.
This guide walks through what a rear setback is, what typical numbers look like, how the rules differ for sheds and decks, how to find the exact requirement for your address, and what to do if your lot can't comply.
Table of Contents
- 1What a Rear Yard Setback Actually Is
- 2Typical Rear Yard Setback Distances
- 3Why Rear Setbacks Exist
- 4Rules for Sheds, Decks, and Other Backyard Projects
- 5Sheds and small outbuildings
- 6Decks and patios
- 7ADUs and garage apartments
- 8How to Find the Rear Setback for Your Address
- 9Easements: The Setback Nobody Talks About
- 10Corner Lots, Pie Lots, and Other Complications
- 11What Happens If You Build Inside the Setback
- 12Getting a Variance If Your Lot Can't Comply
- 13Quick Answers From Homeowners
- 14How far from my rear property line can I build?
- 15How close can a shed be to the rear property line?
- 16Do fences have to follow rear setback rules?
- 17Can I put a deck in my rear setback?
- 18Do rear setbacks apply to swimming pools?
- 19How do I know where my rear property line actually is?
What a Rear Yard Setback Actually Is
A rear yard setback is the minimum distance that must stay open between a structure and your rear property line. Your "yard" in zoning terms isn't the grass — it's the open space itself. If your zone requires a 20-foot rear yard, the nearest part of your house must sit at least 20 feet inside the lot, measured straight back from the rear line.
Three details trip up homeowners constantly:
- Measurement starts at the property line, not the fence. A fence can sit anywhere from the line itself to a few feet inside it. Always measure from the recorded line.
- It applies to covered, roofed structures first. The main house, additions, garages, and covered porches all count. Open patios at grade are often allowed closer, or even inside the setback, depending on local code.
- It's separate from the permit question. A project can be small enough to skip a building permit and still be illegal if it sits inside the required yard. Zoning and building codes are different rulebooks.
Overhangs and eaves usually get a small break — many codes let roof projections extend a foot or two into the yard — but rules vary, so confirm before you draw the plan around that assumption.
Typical Rear Yard Setback Distances
There is no national number, but real codes cluster in a familiar range. Detached single-family homes in conventional suburban zones usually see rear setbacks of 20 to 30 feet, while denser districts and older street grids accept less. Here's how the range looks in practice:
| Structure Type | Typical Rear Setback | What Sets the Number |
|---|---|---|
| Main house (new construction) | 20–30 ft | Zoning district bulk standards |
| Main house (dense urban zone) | 15–30 ft | District rules; NYC requires a 30-ft rear yard for detached buildings in most lower-density residence districts |
| Detached garage / large accessory building | 5–15 ft | Accessory-structure section of the code |
| Shed under 150 sq ft | 3–5 ft | Size-tiered accessory rules in many cities |
| Open, at-grade patio | Often allowed in setback | Impervious-surface and drainage rules instead |
| Swimming pool | 5–15 ft | Pool/barrier code plus zoning |
Two verified examples show how much codes differ. New York City's Zoning Resolution requires a rear yard with a depth of 30 feet for detached buildings in its lower-density residence districts — a legacy of ensuring light and air between rows of lots (NYC Zoning Resolution, Article II, Chapter 3).
Raleigh, North Carolina, uses district-specific numbers for houses, but makes an explicit exception for small accessory buildings: structures of 150 square feet or less and 10 feet or less in height need only 5 feet from side and rear lines (Raleigh UDO, Sec. 6.7.2).
That two-tier pattern — big number for houses, small number for little buildings — is the single most useful thing to understand about rear yards. Your project's size class often matters more than the district itself.
💡 Tip: When you research your address, write down three numbers: the house setback, the accessory setback, and any easement widths on your plat. Ninety percent of backyard project questions are answered by one of those three lines.
Why Rear Setbacks Exist
Setbacks look arbitrary until you see what they do. Each rule behind them solves a problem that showed up repeatedly as neighborhoods developed.
Light, air, and privacy. Rear yards keep living space from walling up against the neighbor's living space. The 30-foot rear yard in older codes is fundamentally a daylight and ventilation standard carried forward from early housing reform.
Drainage and utilities. Rear lot lines commonly carry drainage swales, sewer laterals, or overhead and buried utility lines. Keeping structures clear protects access for repair crews and keeps water moving.
Fire separation and emergency access. Space between structures on adjacent lots slows fire spread and gives crews a working corridor. This is why the gap between your shed and the neighbor's fence, not just your own line, can be regulated.
Orderly development. Uniform build-to lines prevent each new house from shaving a little closer to the line than the last, which is how you end up with windows staring into windows down an entire block.
Rules for Sheds, Decks, and Other Backyard Projects
The main house follows the bulk standard, but everything you actually build in a backyard usually falls into the accessory-structure chapter. That's where the numbers get friendlier — and the exceptions get numerous.
Sheds and small outbuildings
Most codes tier accessory setbacks by footprint and height. Raleigh's 150-square-foot / 10-foot rule with a 5-foot yard is a common shape, and many jurisdictions land in the same 3-to-5-foot neighborhood for the smallest tier. Bigger sheds, workshops, and garages usually step up to 5, 10, or even the full house setback as they grow.
Don't confuse the setback with the permit exemption. Under the model residential code, one-story detached accessory structures up to 200 square feet with no utilities are exempt from building permits — but that exemption belongs to the building code, and the zoning code still applies (2021 IRC, Section R105.2). A 10x12 shed can be permit-exempt and still illegal if it sits 2 feet off the line in a district that wants 5.
If you're sorting through that overlap, our guide to whether your shed needs a building permit covers the permit side in detail.
Decks and patios
Ground-level, uncovered patios are the friendliest case — many codes treat them like landscaping and only regulate how much of the yard they pave. Decks change once they rise above grade or attach to the house. Attached decks usually follow the main-structure setback, and even freestanding ones above a certain height get pulled into the building setback.
Raleigh's code makes the logic explicit: porches, decks, patios, and stoops more than a foot high may extend up to 12 feet into a required side or rear setback, with conditions (Raleigh UDO, Sec. 1.5.4). Some cities allow that partial encroachment; others allow none. The height threshold is the trigger to look for in your local text.
ADUs and garage apartments
Detached accessory dwelling units are habitable space, so most cities treat them stricter than sheds. A 5-foot rear setback is common for detached ADUs in states that have standardized their rules, but height caps, lot coverage, and separation-from-house rules frequently bind first. Treat an ADU like a small house, not a big shed, until you've read your local ADU section.
How to Find the Rear Setback for Your Address
You can get a defensible answer in four steps, and none of them cost money:
- Step 1 — Identify your zoning district. Most cities publish an interactive zoning map on their GIS or planning portal. Type your address, note the district code (something like R-4, R1-6, or SF-3), and screenshot it for your records.
- Step 2 — Read the district's bulk table. Search the municipal or county code for "[your district] setbacks" or "yard requirements." You're looking for a table row labeled rear yard, and then a separate accessory-structure section that overrides it for small buildings.
- Step 3 — Check the exceptions. Search the same chapter for "easement," "corner lot," "accessory," and "encroachment." The general table gives you the rule; the exceptions tell you whether your actual lot can use it.
- Step 4 — Confirm at the counter. A five-minute call or email to the planning desk — with your address and parcel number — converts your reading into an answer someone at the city stands behind. Ask them to note the district and any overlays on your parcel.
If you're doing this because a build is coming, remember the setback research is only one slice of the timeline. Our walkthrough of how long it takes to get a building permit puts this step in context with plan review and inspection queues.
Easements: The Setback Nobody Talks About
An easement is someone else's legal right to use a strip of your land — typically a utility corridor, drainage path, or access route — and it overrides your zoning rights entirely. A 10-foot utility easement running along your rear line means the rear 10 feet of your yard may be off-limits to permanent structures even if the zoning code would let you build there.
The two rules interact in a way that surprises people: in most places an easement does not count toward satisfying a setback. If your district wants a 20-foot rear yard and a 10-foot easement runs down the rear line, you may need to keep structures 20 feet clear of the line anyway — and the easement area stays empty on top of that.
⚠️ Warning: Structures built inside a utility easement can be removed by the utility without compensation, and the cost of concrete cutting or fence rebuilds lands on you. Easements show up on your recorded plat and survey, not the zoning map — pull both before you finalize a layout.
Municipal law researchers at MRSC summarize the underlying rule: grantors generally need written consent before placing structures within an easement corridor (MRSC, Easements). Your plat, title report, or county GIS parcel layer will show recorded easements — if any of those sources disagree, that's a question for the planning desk, not a judgment call.
Corner Lots, Pie Lots, and Other Complications
Square interior lots are the easy case. Three lot shapes need extra care:
- Corner lots have two street frontages, and many codes treat the side street yard as a second front yard — with the front-yard rules (bigger setback, fence height limits) applying there instead of the friendlier side-yard numbers. On some corner configurations the code declares there is no rear yard at all, which reshuffles your entire site plan.
- Pie-shaped and flag lots may have a rear line that's a point rather than an edge. Codes handle this with averaging rules or by measuring from a designated rear lot line, which is exactly the kind of interpretation you want confirmed in writing.
- Double-frontage lots (backing a street or greenbelt) often carry two front yards and no true rear yard — a common setup along arterial roads and drainage corridors.
If your lot is any of these, skip the DIY reading and get the yard designations from the planning desk. One email now is cheaper than a revised site plan later.
What Happens If You Build Inside the Setback
Setback violations surface in predictable ways: a neighbor's permit application triggers a site review of your parcel, an appraiser spots it during a sale, or the assessor's aerial imagery catches a new roofline. Once flagged, the code enforcement case usually runs the same sequence — notice of violation, a correction window, and escalating penalties if the structure stays.
Your options at that point are limited and none are cheap: apply for a variance retroactively, rework the structure to comply, or remove it. Building a deck into a required yard and hoping nobody measures is not a strategy — it's a countdown. And that's before the separate consequences of skipping the permit entirely, which we cover in what happens if you build without a permit.
✅ Key takeaway: The rear setback is the cheapest constraint to respect on paper and the most expensive one to fix in lumber. Locate your property pins or order the survey before the site plan is final — never after the footing inspection fails.
Getting a Variance If Your Lot Can't Comply
Some lots genuinely can't meet the standard yard — a narrow pie lot, a steep grade, a legacy house built to an older code. Zoning boards handle this through an area variance, which grants permission to build within the setback if you can show hardship.
The application walks a familiar path: site plan showing the encroachment, a written hardship explanation rooted in the lot's physical characteristics, notices to neighboring owners, and a public hearing where abutters can speak. Approval turns on whether your difficulty is created by the land itself and whether the variance is the minimum relief that fixes it.
Two honest expectations: variances take weeks to months and add a filing fee, and boards routinely approve smaller encroachments than requested. Design the project so the part nearest the line is the least valuable to you — an open patio edge rather than a roofed addition — and your odds improve with the same footprint.
Costs for the underlying permits still apply once the variance is in hand, and they vary widely. If you're budgeting the whole project, our state-by-state look at what building permits cost and our guide to how front yard setbacks are measured by state round out the picture.
Quick Answers From Homeowners
How far from my rear property line can I build?
For your main house, expect 10 to 30 feet depending on your zoning district, with 20 to 30 feet common in suburban zones. Detached garages and large accessory buildings typically need 5 to 15 feet, and small sheds often only 3 to 5 feet. Your district's bulk table is the number that counts — the ranges here are orientation, not authority.
How close can a shed be to the rear property line?
Commonly 3 to 5 feet for sheds under roughly 150 square feet and 10 feet tall, as long as they carry no plumbing or electrical hookups. Larger sheds step up to 5 to 10 feet or more. Check whether your code also limits the combined footprint of all accessory buildings — several cities cap it at a share of the rear or total lot area.
Do fences have to follow rear setback rules?
Usually no — fences are typically allowed on the property line itself, but they have their own height limits and, in some cities, different rules inside front and street-side setbacks. Portland, for example, caps fences in many front setbacks at three and a half feet while allowing taller fences elsewhere in the yard (Portland PPD, Residential Fences). Check the fence chapter, not the building setback table.
Can I put a deck in my rear setback?
It depends on height and attachment. At-grade, uncovered patios are frequently allowed in the setback. Raised or attached decks are usually pulled into the main setback, though some codes — like Raleigh's — permit a defined encroachment (up to 12 feet) for porches, decks, and stoops above a height threshold, subject to conditions. Search your code for "encroachment" before you assume either answer.
Do rear setbacks apply to swimming pools?
Yes, plus a second layer. Pools commonly need 5 to 15 feet from the rear and side lines depending on the city, and the barrier and equipment rules add their own distances — pumps and heaters often have separate setbacks from both property lines and doors. Pool permits also trigger barrier inspections, so treat the setback and the fence code as one combined layout problem.
How do I know where my rear property line actually is?
Start with your recorded plat or survey — the rear line will be dimensioned there. If the pins aren't findable on the ground, a county GIS parcel layer gets you close, but for anything within a few feet of the required setback, hire a licensed surveyor to locate or re-stake the line. Measuring from a fence, hedge, or the neighbor's assertion is how setback violations happen.

