Quick answer

The 2024 International Residential Code exempts fences not over 7 feet high from a building permit (IRC R105.2). That exemption is often narrowed locally, and it doesn't cover zoning. Most cities and many counties limit front-yard fences to a lower height, regulate corner sight lines, and may require a fence or zoning permit. Fences that serve as pool barriers must meet separate barrier rules, and retaining walls over 4 feet are not exempt.

What the model code says

The International Residential Code (IRC) is the model building code most U.S. jurisdictions use for houses. Its list of work exempt from permit (Section R105.2) includes:

Fences not over 7 feet (2134 mm) high.

The same wording appears in the 2021 and 2024 editions. In practice this means:

  • Building permits are uncommon for ordinary residential fences. A typical 4- to 6-foot wood, vinyl, or chain-link fence falls under the exemption in jurisdictions that adopt the model text unchanged.
  • Local amendments are common. Many jurisdictions adopt a lower number. The City of Federal Way, Washington, for example, lists “Fences not over 6 feet high” in its residential exemptions.
  • Exempt doesn’t mean unregulated. R105.2 states that the exemption does not authorize “any work to be done in any manner in violation of the provisions of this code or any other laws or ordinances of this jurisdiction.” Zoning rules still apply in full.
  • Retaining walls. The IRC exempts retaining walls “that are not over 4 feet (1219 mm) in height measured from the bottom of the footing to the top of the wall, unless supporting a surcharge.” A fence built on top of a retaining wall, or a tall wall holding back a slope, may need engineering review.
  • Masonry and concrete walls. Heavier walls may be treated as structures needing footing review, depending on height and local rules.
  • Pool barriers. These have their own rules (below), whatever the fence height.

Pool barrier fences

The 2024 IRC sends pools and spas to the International Swimming Pool and Spa Code (ISPSC) (IRC R328.1). ISPSC Section 305 sets barrier rules for residential pools. In the edition we reviewed:

  • The barrier must be at least 48 inches high, measured on the side facing away from the pool.
  • The gap under the barrier must not exceed 2 inches over grass or gravel, or 4 inches over a solid surface.
  • Openings must not allow passage of a 4-inch sphere, with tighter limits for some picket and chain-link designs.
  • Gates must open outward away from the pool and be self-closing and self-latching.
  • Pool equipment and other climbable objects must be kept at least 36 inches from the outside of the barrier.

The U.S. Consumer Product Safety Commission’s Pool Safely campaign gives the same basic advice: a fence of at least four feet on all sides, with self-closing, self-latching gates. Our pool permit guide covers the barrier rules in more detail.

Zoning, HOA rules, and setbacks

For most fences, zoning is the real gatekeeper. Common local rules include:

  • Height by yard. A lower limit in the front yard (often for open or decorative styles) and a higher limit in side and rear yards. How a “front yard” is defined on a corner lot matters.
  • Sight-distance triangles. At street corners and driveways, fences and hedges are often limited in height so drivers can see.
  • Materials. Some ordinances prohibit barbed wire, razor wire, or electrified fencing in residential zones.
  • Location. Rules about building on or near the property line, in easements, or in the public right-of-way (which often extends beyond the sidewalk).
  • Historic districts. Design review may control style and materials.
  • HOA covenants. Private rules about style, color, height, and which side faces out. They are separate from, and in addition to, government rules.

Look up your zoning district on the local zoning map (many county profiles in our directory link one), then read the fence section of the zoning ordinance.

Permits and inspections you can expect

What you will see depends on the jurisdiction:

  • No permit. Where the model exemption is adopted and zoning does not require review.
  • Fence or zoning permit. A short application with a site plan, reviewed for height and location. There is often no inspection, or a single final check.
  • Building permit. For fences over the local exemption height, masonry walls, or fences combined with retaining walls.
  • Pool barrier review. Inspected as part of the pool’s final inspection before the pool can be used.

Before digging post holes, call 811 to reach your state’s one-call center and have underground utilities marked. Ask it how much notice it needs.

What to prepare

  • Site plan or marked-up survey showing the fence line, distances to property lines, streets, and driveways, and any easements.
  • Fence height and style, including whether it is solid or open, and the material.
  • Gate locations, including swing direction and latch details if it is a pool barrier.
  • Retaining wall details, if any, including height from the bottom of the footing.
  • HOA approval, if required.
  • Neighbor considerations. Some places require notice for fences on a shared line.

How permit fees are calculated

Fence permit fees are set locally. Where a fee applies, offices commonly use:

  • A flat zoning or fence permit fee per application.
  • Valuation-based building permit fees for fences that need a building permit. Jurisdictions often benchmark against the International Code Council’s Building Valuation Data, which the ICC describes as a resource “jurisdictions across the U.S. use as a benchmark to determine building permit fees.”
  • Linear-foot pricing in some jurisdictions.

Check your county’s or city’s current fee schedule, which is linked from our county profiles where one is published.

Common mistakes

  • Using the 7-foot figure without checking local rules. Local building codes and zoning ordinances often set lower limits, especially in front yards.
  • Guessing the property line. Fences built over the line are a frequent source of neighbor disputes and removal orders. Use a survey.
  • Ignoring corner visibility rules. Solid fences near intersections and driveways are a common violation.
  • Treating a pool fence like any other fence. Gate hardware, height, and gaps are inspected, and a non-compliant barrier can hold up final approval of the pool.
  • Skipping 811. Striking a buried line is dangerous and can be costly.
  • Building on a retaining wall without review. The combined height and loads may require a permit and engineering.

State notes

Some states set a rule for this project statewide. These notes come from our state research; your city or county may add its own requirements.

Connecticut
Fences not over 7 feet high are exempt from a building permit under the state residential code, except fences that serve as swimming pool barriers. Source
Massachusetts
780 CMR 51.00 R105.2: no building permit for fences not over 7 feet high. Local zoning limits still apply. Source
Michigan
Under R 408.30505, a fence no more than 7 feet high does not need a building permit under the residential code. Local zoning rules on fence height and placement still apply. Source
Minnesota
Where the State Building Code is enforced, fences no taller than seven feet are exempt from a building permit (Minnesota Rules 1300.0120). Local zoning rules on height and placement still apply. Source
New Jersey
N.J.A.C. 5:23-2.14(b)9: no permit for fences six feet or less in height. This exception does not apply to barriers around swimming pools. Local zoning limits still apply. Source
North Dakota
Where the state building code is enforced, the state amendment to IRC R105.2 exempts fences up to 8.5 ft high from a building permit. Cities, townships, and counties may amend the code, and zoning rules may still apply. Source
Ohio
Fences not over 6 ft high are exempt from RCO approval. Retaining walls up to 4 ft, measured from the bottom of the footing, are also exempt unless they support a surcharge (RCO 102.10). Local zoning may still regulate fences. Source
Pennsylvania
Fences no more than 6 ft high and retaining walls up to 4 ft that don't support a surcharge do not need a UCC permit (34 Pa. Code § 403.62(c)). Local zoning may still regulate fences. Source
Rhode Island
Fences up to 6 ft high are exempt from a building permit under SBC-2 R105.2. Retaining walls up to 32 inches are exempt, but cast-in-place concrete retaining walls over 24 inches need a permit. Source
South Carolina
An owner of residential property who builds a fence up to 7 ft high, or a retaining wall up to 4 ft high (bottom of footing to top, not supporting a surcharge), is exempt from the building permit requirement (S.C. Code § 40-59-265). Source
South Dakota
Counties, cities and townships may not require a building permit to repair or replace, with something substantially similar, a fence panel or post at a detached, owner-occupied single-family home (SDCL 11-10-15). Designated historic properties are an exception. Source
Virginia
Fences of any height are exempt from a building permit unless they are a swimming pool barrier or required for pedestrian safety. Masonry or concrete walls up to 6 ft and retaining walls holding back less than 3 ft of fill are also exempt (VCC 108.2). Local zoning may still regulate height and location. Source

Common questions

How tall can a fence be without a permit?

The model IRC exempts fences not over 7 feet high from a building permit (R105.2). Local codes frequently lower that figure (Federal Way, Washington, for example, exempts fences not over 6 feet), and zoning ordinances commonly set lower limits for front yards. Check both the building and the zoning rules for your address.

Do I need a permit to replace an existing fence?

Replacing a fence with one of the same height and location is often treated the same as building a new one for zoning purposes. Some jurisdictions allow like-for-like replacement without review, and others do not. If the existing fence was built before current rules, replacing it may require meeting today's height and setback limits. Ask your zoning office.

Does a pool fence need a permit?

A fence that serves as the required barrier around a pool or spa is usually reviewed with the pool permit. The model pool code requires a barrier at least 48 inches high with self-closing, self-latching gates (ISPSC 305). Your jurisdiction may adopt different numbers.

Who decides which side of the fence faces the neighbor?

The building code doesn't. Some zoning ordinances and many HOA covenants require the finished side to face outward. Check your local ordinance and any recorded covenants.

Can I build a fence on the property line?

It depends on local zoning and on knowing exactly where the line is. Many owners set fences slightly inside the line to avoid disputes. A boundary survey is the reliable way to locate the line. Utility easements may also limit where posts can go.

Check your county’s rules

The rules above are the model-code starting point. Your county or city decides which edition applies, what it changed, and what it charges. Look up the permit office that serves your address.

Sources

Last reviewed October 2026. Section numbers refer to the International Code Council’s model codes. We checked the wording against the published adoptions linked above, which reproduce the model text without amendment unless the source notes a state amendment. Codes take effect only when a state or local government adopts them, and many make amendments. This guide is general information, not legal or engineering advice. Suggest a correction