In most places, you can build a shed somewhere between 3 and 10 feet from your side and rear property lines, but the exact distance is set by your local zoning code and can be stricter on corner lots, under HOA rules, or near an easement. There is no national number. The question of how close you can build a shed to your property line has to be answered by pulling up your municipality’s rules for accessory structures and measuring from the actual legal boundary, not the fence.
Find the Property Line First
Setback distances only mean something if you know where your property ends. Fences, hedges, and driveways frequently sit off the real line, and measuring from the wrong edge is one of the quickest ways to end up with a code violation or a neighbor dispute.
Your deed and the plat map filed with the county recorder show the legal dimensions of the lot. Translating those dimensions to physical marks in the yard usually calls for a licensed land surveyor, who will locate the corners from the recorded legal description. A residential boundary survey generally runs between $1,200 and $6,500, depending on lot size, terrain, and how findable the existing monuments are. If you have a recent survey from your purchase, check whether the corner pins are still in the ground before paying for a new one.
How Local Setback Rules Work
A setback is the minimum distance a local government requires between a structure and a property line. The numbers live in your municipal or county zoning code, usually posted on the planning or zoning department’s website. Look for the section on accessory structures, which is the category that covers sheds, detached garages, and similar outbuildings.
Side and rear setbacks for accessory structures most often fall in the 3-to-10-foot range. Some jurisdictions allow as little as 2 feet; others require 15 or more. Front yard setbacks are almost always larger, and many codes prohibit accessory structures in the front yard altogether. Height matters too: a taller shed often has to sit farther back. One common formula adds a foot to the setback for every foot of shed height above 10 feet.
Corner Lots
Corner lots are tighter. With two street-facing sides, zoning codes typically treat the street-facing side yard more like a front yard. A side setback that would be 5 feet on an interior lot can jump to 15 feet or more on the street side of a corner lot. That cuts into the buildable area quickly, so read the corner-lot provisions in your zoning district before you pick a spot.
HOA Rules
Zoning is not the only source of limits. If your home is in an HOA, the CC&Rs you agreed to at purchase can impose setbacks tougher than the zoning code, along with rules on shed size, materials, color, and placement. You have to comply with both sets of rules, and whichever is stricter controls.
Easements
You cannot build on an easement, period. Easements reserve strips of your lot for utility lines, drainage, or access, and they show up on your deed or plat. Utility companies prohibit structures within their easements and can force removal of anything built there, even if you held a valid building permit for the shed itself.
When Your Lot Can’t Meet the Setback
If the lot is too small, oddly shaped, or already crowded by existing structures, you may be able to apply for a zoning variance. A variance is permission from your local zoning board of appeals to deviate from a specific requirement. You file an application, the board holds a public hearing, and you have to show that strict compliance creates an undue hardship tied to the property itself.
Hardship is the operative word. Boards will not grant a variance because a homeowner prefers a different spot. The showing has to involve something about the lot, such as its dimensions, slope, or the position of structures already on it, that makes compliance unreasonable. Application fees usually run a few hundred dollars, the process takes weeks to months, and neighbors can object. Variances are never guaranteed, but for genuinely constrained lots this is the correct route rather than building and hoping no one notices.
Drainage Still Matters Even If You Meet the Setback
Meeting the setback does not give you a free hand with runoff. A shed roof concentrates rainwater, and most municipalities prohibit directing roof drainage onto a neighbor’s property. The broader common-law rule in most states is that you cannot alter the natural flow of water in a way that damages adjoining land. A shed placed close to the line with gutters dumping across the boundary is a reliable way to produce both a code violation and a lawsuit from next door.
Plan the drainage before you build. Downspouts should discharge onto your own lawn or into a rain barrel, dry well, or similar approved system. Some jurisdictions also bar discharging roof runoff straight into roadway ditches or storm sewers without first spreading it over vegetated ground.
What Happens If You Build Too Close
Enforcement tends to catch up, usually through a neighbor complaint or a county aerial survey. The first step is typically a stop-work order and a notice of violation. Daily fines for maintaining a non-compliant structure after notice can range from $25 to several thousand dollars depending on jurisdiction, and they keep accruing until the problem is corrected. If you ignore the notice, the municipality can go to court and obtain an order requiring you to move or demolish the shed at your own expense.
The problems do not stop at fines. When you sell the house, appraisers flag non-compliant work, which can drag down the appraised value. Lenders may refuse to finance the purchase because they cannot verify value or safety compliance on an unpermitted structure. Buyers who find the issue during inspection often ask for a price cut, demand that you obtain a retroactive permit, or walk away. A neighbor hurt by the encroachment or by runoff from the shed can also sue directly for damages or an injunction, and that litigation will cost more than the shed did.
The Short Version
Pull up your local zoning code, find the accessory structure section, and note the side, rear, and front setbacks for your district. Check whether you are on a corner lot, whether an HOA applies, and whether any easement crosses the spot you have in mind. Confirm the real property line with a survey or existing corner pins. Then measure from the line, not the fence, and leave yourself a comfortable margin for drainage. A few hours of homework at this stage is the difference between a shed that stays where you put it and one you have to move.