Subscribe

ADJACENCIES · June 13, 2026

Bathroom Vent Through Roof: 2026 Installation Guide + Code Requirements

Bathroom vent through roof: IRC M1501.1 and M1505.2 code, duct limits by CFM, and $350-950 installed cost, plus why attic venting fails.

Bathroom Vent Through Roof: 2026 Installation Guide + Code Requirements

A bathroom vent through the roof is a code-compliant route when the duct discharges directly outdoors: under the International Residential Code (IRC), bathroom exhaust may not be dumped into an attic (Sections M1501.1 and M1505.2 of the 2021 and 2024 IRC). Venting a bathroom exhaust fan into the attic violates the IRC wherever it is adopted and can lead to mold, sheathing rot, and damage to roof framing. HomeGuide puts a new bath fan vented through the roof at $350 to $950 plus permit fees, against $250 to $800 for a fan vented through an exterior wall; roof complexity, duct length and whether the fan itself is replaced decide where a job lands.

Reviewed by The Roofing Brief Team. Last reviewed: October 2026.

The short version

  • Installed cost: HomeGuide lists $350 to $950 plus permit fees for a new bath fan vented through the roof and $250 to $800 through a wall. Steep, tile and metal roofs usually cost more to access.
  • IRC Sections M1501.1 and M1505.2 require bathroom exhaust to discharge outdoors, never into an attic. Most US jurisdictions adopt the IRC, often with local amendments, so confirm the edition your building department enforces.
  • Duct size and length follow IRC Table M1504.2: a 4 inch smooth-wall duct allows 114 ft for a 50 CFM fan, but only 31 ft at 80 CFM and 10 ft at 100 CFM, less 15 ft per elbow. Larger fans usually need 5 or 6 inch duct.
  • Insulating the duct where it crosses a cold attic is strongly advisable to prevent condensation and ceiling stains. The IRC Chapter 15 exhaust provisions do not set an R-value, so follow local amendments and the fan maker’s instructions.
  • Roof cap requires a backdraft damper and proper flashing. IRC M1504.3 requires exhaust openings to be at least 3 feet from property lines, gravity air intake openings, operable windows and doors.
  • Combining bath fans into one roof penetration may be allowed where the fan makers’ instructions and the local inspector permit it, with backdraft dampers on each branch and each fan still meeting the duct length rules.

Short answer and 2026 cost

If your bathroom fan vents into the attic, fix it now. Shower moisture dumped into a cold attic can condense on the underside of the roof sheathing in winter, wet the insulation and, over time, feed mold and rot. That is the problem IRC M1501.1 addresses when it bars exhausting into an attic, soffit, ridge vent or crawl space. For what that moisture does once it settles, see our guide to mold in the attic.

Published installed costs run from $150 to $550 for a replacement to $950 plus permits for a new roof-vented fan, each from a named cost guide. HomeGuide’s guide was last updated Sept. 14, 2023, so treat its ranges as a floor for 2026 quotes rather than a price for your house.

Job Published range Source
Replace an existing fan on a working duct $150 to $550 HomeGuide, Sept. 14, 2023
New fan vented through the roof $350 to $950, plus permit fees HomeGuide, Sept. 14, 2023
New fan vented through an exterior wall $250 to $800 HomeGuide, Sept. 14, 2023
New duct run for a bath vent $50 to $150 on average HomeGuide, Sept. 14, 2023
Permit for roofing modifications $70 to $250 HomeGuide, Sept. 14, 2023

The cost variables that matter most: existing fan condition, duct length from the bathroom to the roof (a new duct run averages $50 to $150), roof penetration complexity, and whether the duct passes through conditioned or unconditioned space.

IRC code requirements for bathroom exhaust

Bathroom exhaust is covered by Chapter 15 (Exhaust Systems) of the IRC. The section numbers below are from the 2021 and 2024 editions on the ICC code site; older editions numbered some of these provisions differently. The key paragraphs for bathroom vents:

  • M1501.1, outdoor discharge. Air removed by every mechanical exhaust system must be discharged to the outdoors and may not be exhausted into an attic, soffit, ridge vent or crawl space.
  • M1505.2, recirculation of air. Bathroom and toilet room exhaust may not be recirculated, must be exhausted directly to the outdoors, and may not discharge into an attic, crawl space or other areas inside the building.
  • M1504.3, exhaust openings. Exhaust openings must terminate at least 3 feet from property lines and from gravity air intake openings, operable windows and doors, and at least 10 feet from mechanical air intakes unless the exhaust sits at least 3 feet above the intake. The 2024 edition adds exceptions, such as an exhaust located at least 1 foot above a gravity intake, window or door. On a roof, keeping the cap well away from operable skylights and attic intake vents is a sensible way to stay clear of these openings; your inspector makes the final call.
  • M1504.2, duct length. Exhaust duct length may not exceed Table M1504.2 (covered in the duct sizing section below) unless the duct system follows the fan maker’s design criteria or the installed airflow is verified with a flow hood, flow grid or similar measuring device.
  • Local exhaust rate. Bathrooms and toilet rooms need a mechanical exhaust capacity of 50 CFM intermittent or 20 CFM continuous, rated at 0.25 inch water column (Table M1505.4.4 in the 2021 IRC; Table M1505.5 in the 2024 IRC).

The provisions that bathroom-fan installs hit most often are the outdoor discharge rules (M1501.1 and M1505.2) and the 3-foot termination clearances in M1504.3. The most common code violations are: dumping exhaust into the soffit or ridge area, placing the cap too close to a skylight or attic intake vent, and using an unsealed duct that leaks into the attic before reaching the cap.

Why attic venting is a code violation

Venting a bathroom fan into the attic, whether intentionally or because the duct disconnected, fails for four reasons:

  1. Moisture damage. Every shower adds water vapor to the bathroom air. Dumped into a cold attic, it can condense on the cold sheathing, drip back onto the insulation and keep the wood wet; EPA’s guidance is that wet building materials must dry within 24 to 48 hours to avoid mold (EPA mold course, chapter 2).
  2. Mold. A persistently damp attic gives mold the moisture it needs on roof sheathing and framing, and attic mold can become an indoor air quality problem where attic air reaches the living space.
  3. Sheathing rot. OSB and plywood sheathing that stays wet can swell, delaminate and rot, and roofing nails can corrode.
  4. Insulation degradation. Damp insulation insulates less effectively until it dries, so the attic insulation that should protect your conditioned space does less of its job.

Repairing attic damage after years of misdirected exhaust (insulation replacement, sheathing repair, mold cleanup and re-routing the fan) is a separate bill that can exceed the cost of venting the fan outdoors in the first place, which HomeGuide puts at $350 to $950 plus permits for a roof exit.

Signs your existing bathroom fan vents into the attic

Seven signs, checked from the bathroom and the attic, point to an attic-vented or otherwise non-compliant install:

  • Visible water stains on the bathroom ceiling near the fan grille.
  • Dust or lint streaks on the ceiling around the fan housing (air leaking around the housing rather than into the duct).
  • Attic inspection shows the duct ending under the insulation, dangling from the ceiling joists, or terminating at a soffit vent, which IRC M1501.1 does not allow.
  • Moldy or musty smell in the attic, particularly in winter when humidity differentials are highest.
  • Visible mold or black staining on attic sheathing, especially near the bathroom fan.
  • Frost or ice on the underside of roof sheathing in winter (a clear sign of moisture infiltration from below).
  • An attic humidity reading that stays well above the outdoor reading after showers.

If you see any of these signs, schedule the through-roof retrofit promptly. Every month of continued attic venting in a cold climate adds to the sheathing damage and mold growth. The vent fix is a one-time job, while attic damage keeps growing as long as the exhaust stays in the attic.

Through-roof vs through-wall venting

Bathroom fans can vent through a roof or through an exterior wall (often through the gable end). Both can comply with the outdoor discharge rules in M1501.1 and M1505.2. The trade-offs:

Factor Through-roof Through-wall
Cost, new fan (HomeGuide) $350 to $950, plus permits $250 to $800
Distance from typical bathroom Shorter, fewer elbows Longer if bathroom is interior
Penetration complexity Higher (roof flashing) Lower (wall cap)
Leak risk Moderate, depends on flashing Low
Visual impact Hidden on roof Visible on wall, some HOA issues
Cold climate performance Slight risk of cap freeze-up Lower risk
Permitted for most layouts Yes Only if exterior wall is reachable

Through-wall ($250 to $800) is usually cheaper than through-roof ($350 to $950) when an exterior wall is close to the bathroom fan, and HomeGuide notes that roof venting is more prone to leaks than sidewall venting. For interior bathrooms or second-story bathrooms with no eave-level wall, through-roof is the practical answer.

Which route fits your bathroom

If your bathroom has Then
No exterior wall nearby, or sits on the second story Vent through the roof: $350 to $950 plus permits
An exterior wall within a short duct run Vent through the wall: $250 to $800
An 80 CFM fan on 4 inch smooth duct 31 ft maximum, less 15 ft per elbow; step up to 5 inch (152 ft) for longer runs
A 100 CFM fan 4 inch smooth duct allows only 10 ft; use 5 inch (91 ft) or 6 inch (no limit)
A duct crossing a cold attic in IECC zones 5 to 8 Insulated duct (R-6 or R-8 versions) to limit condensation
A duct ending in the attic, soffit or ridge vent An M1501.1 violation: re-route to a roof cap or wall cap

Vent cap selection for bathrooms

The cap selection rules are similar to a dryer vent but the airflow direction and humidity load are different. Key requirements:

  • Backdraft damper. Spring-loaded or gravity damper that closes when the fan is off. Prevents cold air infiltration and rain entry.
  • 4 to 6 inch size matched to duct. Many residential bath fans use 4-inch ducts; larger fans often need 5 or 6 inch duct to stay within the IRC length limits.
  • No fine mesh. Coarse pest-resistant openings are fine, but fine screens catch lint-like dust and ice over in cold weather.
  • Roof-rated flashing flange. The cap should come with a built-in flange that integrates with shingle courses.
  • Insulated options in cold climates. Some makers sell insulated roof caps or insulated duct to reduce condensation drip-back; check the product sheet for the cap you are buying.

Whatever cap you choose still has to be installed so the duct discharges outdoors and meets the M1504.3 clearances. For cap sizes, materials, damper styles and dated cap prices, see our guide to gooseneck roof vent sizes and damper options.

Duct sizing and routing

Bathroom fan duct length is set by IRC Table M1504.2 (same values in the 2021 and 2024 editions), based on the fan’s airflow rating at 0.25 inch water column. An X means the size is not allowed at that airflow; NL means no length limit.

Fan rating (CFM at 0.25 in. w.c.) 4 inch smooth-wall 4 inch flex 5 inch smooth-wall 6 inch smooth-wall
50 CFM 114 ft 56 ft No limit No limit
80 CFM 31 ft 4 ft 152 ft No limit
100 CFM 10 ft Not allowed 91 ft No limit
125 CFM Not allowed Not allowed 51 ft 168 ft
150 CFM Not allowed Not allowed 28 ft 112 ft

Elbows: the table assumes a straight run, and footnote c deducts 15 feet of allowable length for each elbow installed. A 4 inch smooth duct on a 50 CFM fan with three elbows is therefore limited to 69 feet (114 minus 45), while the same duct on an 80 CFM fan can take at most two elbows and still have 1 foot to spare (31 minus 30). Under the M1504.2 exception, the table does not cap the length where the duct system follows the fan maker’s design criteria or the installed airflow is measured and verified.

The duct material rules:

  • Rigid metal (galvanized or aluminum) is the gold standard. Smooth interior, no condensation pockets, full code compliance.
  • Insulated flex duct is accepted in many jurisdictions, but flex has much shorter allowable lengths in Table M1504.2 and should be supported per the duct maker’s instructions so it does not sag.
  • Uninsulated foil flex is the worst choice. Condensation forms on the inside, drips back into the bathroom, and can stain ceilings.
  • PVC pipe is not approved for bathroom exhaust in most jurisdictions because it is not listed for that use.

Where the fan maker’s instructions call for it, give horizontal runs a slight slope toward the cap so any condensation that forms drains outside rather than back into the fan housing.

Insulation requirements through the attic

Where the duct passes through unconditioned attic space, insulating it is strongly advisable. The goal: keep the duct surface warmer than the dew point of the air inside the duct, so condensation does not form.

The two acceptable approaches:

  1. Insulated duct. Use insulated flex or wrap rigid metal duct with fiberglass duct wrap. Insulated exhaust duct is commonly sold in R-6 and R-8 versions; the higher value gives more margin in cold climates.
  2. Conditioned-space routing. Route the duct through interior walls or chases that stay above 50 degrees year-round, then only the short section through the attic to the cap needs insulation.

In cold climates (IECC climate zones 5 to 8), inadequate duct insulation can produce the same problem as attic venting: condensation, dripping, and ceiling stains. Bare metal duct running through a cold attic is a common cause. The IRC Chapter 15 exhaust provisions do not set an R-value for bathroom exhaust ducts, so check local amendments and the fan maker’s instructions.

For the broader attic ventilation context that interacts with bathroom fan routing, see that guide and our guide to soffit vents.

Roof flashing for the bathroom vent

The roof penetration for a bathroom vent is the same kind of detail as a dryer vent or plumbing stack. The flashing approach:

  1. Locate the cap position. Maintain at least 3 feet from any ridge vent, soffit vent intake, skylight, or window, and confirm the cap meets the M1504.3 clearances.
  2. From inside the attic, drill a pilot hole through the deck.
  3. On the roof side, mark the hole pattern from the pilot. Use a hole saw sized to the cap maker’s instructions.
  4. Cut the hole through the deck.
  5. Pull back two shingle courses above the cap location. Cut shingles only as needed.
  6. Bed the cap flange in a polyurethane roofing sealant, following the cap maker’s instructions for flange coverage around the hole.
  7. Slide the upslope half of the flange under the existing upper shingles. The downslope half sits on top of the lower shingles, exactly like a plumbing stack flashing.
  8. Nail the upper flange under the shingle course above. Never expose nails to weather.
  9. Replace shingles. Seal cut edges with roofing cement.
  10. Verify the cap is plumb so the damper seats correctly.

This is functionally identical to flashing any other roof penetration. For more on roof flashing principles, see our roof flashing guide. For repair scenarios where existing flashing failed, see our guide to roof leak repair.

Combining multiple bath fans into one penetration

Some installs combine two or three bath fan exhausts into a single roof cap to reduce penetrations. Where the fan makers’ instructions and the local inspector allow it, a shared run generally needs three things: proper duct sizing, backdraft dampers on each branch, and listed fittings for the joint. Each fan still has to meet the duct length rules in Table M1504.2 or the fan maker’s design criteria.

The dampers on each branch are non-negotiable. Without them, running one fan pushes air backward through the other fans and out into other bathrooms (or back into the ceiling cavity). The damper at the fan housing is often built into the fan itself; verify on the spec sheet.

Combined installs save one roof penetration but add a tee fitting, additional duct and more complex sizing, so price both options before choosing. Size the shared main to the combined airflow using the fan makers’ design criteria or Table M1504.2.

Cost breakdown by component

The line items below come from HomeGuide’s bathroom exhaust fan cost guide (updated Sept. 14, 2023). The labor row is Roofing Brief arithmetic from HomeGuide’s hourly rate and install time.

Component Published figure Source
Installer labor rate $50 to $100 per hour HomeGuide
Time for a new fan install 4 to 8+ hours HomeGuide
Labor for a new install $200 to $800 (4 hours at $50 to 8 hours at $100) HomeGuide; Roofing Brief arithmetic
Ductwork for a bath vent $50 to $150 on average HomeGuide
Fan unit $20 to $400 HomeGuide
Permits: wiring and ductwork / roofing modifications $30 to $500 / $70 to $250 HomeGuide
All-in, new fan vented through the roof $350 to $950, plus permits HomeGuide

Labor dominates: $200 to $800 of the $350 to $950 total in the table. The roof cap itself is a small share of the bill, and roof access, duct work and flashing drive the rest. For dated fan and cap prices, electrical and permit add-ons and five worked examples, see our guide to bathroom exhaust fan installation cost. To price other roof vents, see our roof vent replacement cost breakdown.

Fan sizing and selection

If you are replacing the fan as part of the through-roof install, the code minimum is simple: 50 CFM intermittent or 20 CFM continuous for any bathroom, regardless of floor area (IRC Table M1505.4.4 in the 2021 edition, Table M1505.5 in 2024; ASHRAE 62.2 uses the same 50 and 20 CFM figures). The recommended column below is general guidance for larger rooms, not a code requirement:

Bathroom size Floor area Minimum CFM (intermittent) Recommended CFM
Powder room 20 sq ft 50 CFM 50 to 80 CFM
Standard 5×8 full bath 40 sq ft 50 CFM 80 to 110 CFM
Master bath, 80 sq ft 80 sq ft 50 CFM 110 to 150 CFM
Large master, 120 sq ft 120 sq ft 50 CFM 150 to 200 CFM
Bathroom with steam shower any per shower spec 150 to 250 CFM with humidity sensor

The CFM recommendations on the right column assume you actually want the moisture removed, not just code compliance. A higher-airflow fan clears moisture faster, but only if the duct can carry that airflow under Table M1504.2.

ENERGY STAR says certified ventilation fans use about 48% less energy than standard models and must meet sone and cfm-per-watt limits, and the Home Ventilating Institute certifies the airflow and sound figures. Check sound ratings on the maker’s spec sheet, at the same static pressure, before you buy. Two selectable-airflow examples: Panasonic lists the WhisperCeiling DC FV-0511VQ1 at under 0.3 sone at 110 CFM at 0.1 inch water gauge and 0.9 sone at 0.25 inch, and Delta Breez lists the BreezSlim SLM50-110LED-C at 1.3 sones at 110 CFM at 0.1 inch (HVI-certified). Sone ratings rise as static pressure rises, so a long or bent duct run will be louder than the 0.1 inch figure.

Humidity sensor and timer controls

The code floor is 50 CFM intermittent or 20 CFM continuous, so the control decides how long the fan runs. Humidity sensors switch it on as humidity rises and off at baseline; timers come in 20-, 30- and 60-minute settings:

  • Humidity sensor. Runs the fan exactly as long as needed. Best moisture removal for the energy used. Useful for renters, kids, and anyone who forgets to turn the fan on.
  • Timer switch. 20, 30, or 60-minute mechanical timer. Lower cost than humidity sensor. The fan runs after the bathroom is empty, which is when you want it.
  • Motion sensor. Turns the fan on when someone enters. Useful in light-and-fan combo applications but does not handle shower humidity well.
  • Smart switch (Lutron Caseta, Leviton Decora Smart). Integrates with whole-house ventilation strategies and can be tied to occupancy or humidity from a separate sensor. More complex install.

For the energy and mold-prevention math, the humidity sensor is the best choice for any bathroom that gets daily shower use. It costs more than a basic switch, and the better moisture management protects the room finish over the long run.

When to call a pro

At HomeGuide’s 4 to 8+ hours of install time and $50 to $100 per hour, the math usually favors hiring a competent installer. The work crosses three trades: electrical (fan wiring), HVAC (duct sizing and connection), and roofing (penetration and flashing). The mistakes that compound:

  • Wrong duct size leads to fan straining, eventually motor burnout and warranty void.
  • Uninsulated duct in cold climates leads to condensation, ceiling stains, eventual drywall replacement.
  • Poor flashing leads to leaks that show up months later as attic insulation damage.
  • Cap too close to a ridge vent or soffit intake can short-cycle the exhaust back into the attic, defeating the entire install.

HomeGuide describes a completely new bath fan install as not a DIY project, because it involves ductwork, electrical wiring, cutting the ceiling and sometimes cutting the roof. A homeowner with roof and electrical experience may still take on part of the job where local rules allow it; HomeGuide’s installed range for a roof-vented fan is $350 to $950 plus permits.

For contractor vetting criteria, see our guide on how to choose a roofing contractor. For broader ventilation context, see our guides to attic ventilation and soffit vents.

Related: Dryer Vent Through Roof: Installation, Cost, and Why It Matters

Frequently asked questions

Is venting a bathroom fan into the attic ever allowed?

No. IRC Sections M1501.1 and M1505.2 (2021 and 2024 editions) require bathroom exhaust to discharge directly to the outdoors and bar discharge into an attic. Most US jurisdictions adopt the IRC, sometimes with amendments, so check your local code. The same section also bars exhausting into a soffit, ridge vent or crawl space, so the code-compliant routes are a roof cap or gooseneck, or an exterior wall cap, each meeting the M1504.3 clearances.

How much does it cost to vent a bathroom fan through the roof in 2026?

HomeGuide puts a new bath fan vented through the roof at $350 to $950, plus permit fees ($70 to $250 for a roofing modification permit). A wall exit runs $250 to $800. Second-story baths, steep, tile or metal roofs, and long duct runs push toward the high end.

Can I use a soffit vent cap for a bathroom fan?

Not under the 2021 or 2024 IRC. Section M1501.1 says exhaust air shall not be exhausted into an attic, soffit, ridge vent or crawl space, and moist air leaving under the eave can be drawn back in through soffit intake vents. Use a roof cap, a gooseneck or an exterior wall cap instead, and check any local amendment with your building department.

Do I need insulated duct for a bathroom vent through the roof?

In cold climates (IECC climate zones 5 to 8), insulated duct is strongly advisable. Uninsulated duct in unconditioned attic space can collect condensation, which drips back into the fan housing and stains ceilings. The IRC Chapter 15 exhaust provisions do not set an R-value for bathroom exhaust duct, so follow local amendments and the fan maker’s instructions; insulated duct is commonly sold in R-6 and R-8 versions.

How far apart should bathroom and dryer vent caps be on the roof?

The IRC does not set a specific distance between two exhaust caps. Its clearances are measured from openings into the building: M1504.3 keeps exhaust openings at least 3 feet from property lines, gravity air intakes, operable windows and doors, and M1502.3 sets 3 feet from openings into buildings for a dryer termination when the dryer maker does not specify a location. Keeping the two caps apart is still sensible, and each needs its own duct, since IRC M1502.2 requires the dryer exhaust to be independent of all other systems.

Can I combine two bathroom fans into one roof vent?

Often, where the fan makers’ instructions and your inspector allow it: size the shared duct to the combined airflow under the fan makers’ design criteria or IRC Table M1504.2, put a backdraft damper on each branch and use listed fittings. The dampers are essential; without them, running one fan pushes air backward through the other.

How long does it take to install a bathroom vent through the roof?

HomeGuide puts a new exhaust fan install at 4 to 8 or more hours and a straight replacement at 2 to 3 hours. Attic access, the length of the duct run, roof cutting and flashing, and steep or tile roofs push a job toward the long end.

For more roof and ventilation coverage, browse the full Roofing Brief guide library. Related reads: dryer vent through the roof, attic ventilation, roof flashing, and soffit vents.