Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

Computing US Door & Window Rough Openings, Pocket Door 2W+1" Framing, and IRC Table R602.7 Header Sizing in TypeScript

When a US framing crew lays out walls for a bedroom remodel, ADU, or garage addition, calling out a "32-inch door" on a rough sketch leaves out the exact clearance geometry required to hang the jamb plumb and square. Fra

When a US framing crew lays out walls for a bedroom remodel, ADU, or garage addition, calling out a "32-inch door" on a rough sketch leaves out the exact clearance geometry required to hang the jamb plumb and square. Frame the opening 1/2" too narrow and the prehung jamb binds; cut a pocket door opening like a swing door and the drywall has to come back down.

In this technical breakdown, we build a deterministic TypeScript engine that computes US Door & Window Rough Opening (R.O.) dimensions for seven opening types (interior prehung, exterior prehung, pocket door, double French, closet bifold, nail-fin window, and overhead garage), calculates exact king, jack, and cripple stud counts, and looks up preliminary IRC Table R602.7(1) double-ply header sizing by span, wall bearing condition, and ground snow load.

Try the interactive tool with live SHEET S-102 framing elevation SVG here: PlanCaliber US Door & Window Rough Opening & Header Calculator.

1. Why Every Opening Type Uses Different Rough Opening Allowances

A nominal "32" x 80" US interior door slab is only the leaf itself. A standard prehung unit adds two 3/4" side jambs (1.5"), a 3/4" head jamb, shimming clearance (1/4" per side = 0.5"), and finished floor/carpet undercut (1.75"). That produces the universal carpenter rule: +2" width, +2-1/2" height.

Pocket doors obey completely different geometry because the sliding track and split-stud steel pocket frame occupy the full width of the retracted slab plus 1" of jamb/clearance: (2 x Slab Width) + 1" wide and Slab Height + 4-1/2" tall.

export type OpeningKind =
  | 'interior_prehung'
  | 'exterior_prehung'
  | 'pocket_door'
  | 'double_french'
  | 'bifold_closet'
  | 'window_egress'
  | 'overhead_garage';

export interface RoughOpeningResult {
  roWidthIn: number;
  roHeightIn: number;
  kingStuds: number;
  jackStuds: number;
  headerLengthIn: number;
  headerSpec: string;
}

export function computeRoughOpeningSize(
  kind: OpeningKind,
  nominalWidthIn: number,
  nominalHeightIn: number,
  includeSillPan = false
): { roWidthIn: number; roHeightIn: number } {
  switch (kind) {
    case 'interior_prehung':
      return { roWidthIn: nominalWidthIn + 2.0, roHeightIn: nominalHeightIn + 2.5 };
    case 'exterior_prehung':
      return {
        roWidthIn: nominalWidthIn + 2.0,
        roHeightIn: nominalHeightIn + (includeSillPan ? 3.0 : 2.5),
      };
    case 'pocket_door':
      return { roWidthIn: nominalWidthIn * 2 + 1.0, roHeightIn: nominalHeightIn + 4.5 };
    case 'double_french':
      return { roWidthIn: nominalWidthIn * 2 + 2.5, roHeightIn: nominalHeightIn + 2.5 };
    case 'bifold_closet':
      return { roWidthIn: nominalWidthIn + 2.0, roHeightIn: nominalHeightIn + 2.5 };
    case 'window_egress':
      return { roWidthIn: nominalWidthIn + 0.5, roHeightIn: nominalHeightIn + 0.5 };
    case 'overhead_garage':
      return { roWidthIn: nominalWidthIn + 3.0, roHeightIn: nominalHeightIn + 1.5 };
  }
}

Quick Reference Table (Standard US Doors)

Door Type Nominal Callout Rough Opening Width Rough Opening Height Notes
Interior Bedroom Prehung 32" x 80" (2-8 x 6-8) 34" 82-1/2" +2" W / +2-1/2" H
Exterior Front Entry 36" x 80" (3-0 x 6-8) 38" 82-1/2" (83" w/ sill pan) Check brickmold flange
Pocket Door Frame 32" x 80" (2-8 x 6-8) 65" 84-1/2" 2W + 1" width, +4-1/2" top track
Double Prehung French 2 x 30" x 80" (5-0 x 6-8) 62-1/2" 82-1/2" Includes astragal allowance
Closet Bifold (Drywalled) 48" x 80" (4-0 x 6-8) 50" 82-1/2" Allows 1/2" drywall wrap each side
2-Car Overhead Garage 16'-0" x 7'-0" 195" (16'-3") 85-1/2" (7'-1-1/2") Finished 2x6 jambs inside framing

2. Jack Studs, Header Length, and IRC Table R602.7(1) Preliminary Sizing

A frequent layout error on wide sliding doors and double garage bays is cutting the header equal to the rough opening width instead of adding the jack (trimmer) stud bearing on each side:

  • Spans < 6'-0" (72"): 1 jack stud per side (2 total), so Header Length = R.O. Width + 3.0" (2 x 1.5").
  • Spans >= 6'-0" (72"): 2 jack studs per side (4 total) under IRC Table R602.7(1), so Header Length = R.O. Width + 6.0" (4 x 1.5").
  • Flush 2x4 Wall Spacer: Two nominal 2x header plies measure 3.0" thick; sandwiching a 1/2" OSB or plywood spacer brings the assembly to 3.5" flush with 2x4 wall framing. On a 2x6 exterior wall (5.5"), use three plies (4.5") plus 1" rigid foam insulation to minimize thermal bridging.
export type WallBearingType = 'non_bearing' | 'exterior_1story' | 'exterior_2story';

export function sizeHeaderAndJacks(
  roWidthIn: number,
  wallType: WallBearingType,
  snowLoadPsf: 20 | 30 | 50 | 70
): { jackStuds: number; headerLengthIn: number; headerSpec: string } {
  const jacksPerSide = roWidthIn >= 72 ? 2 : 1;
  const jackStuds = jacksPerSide * 2;
  const headerLengthIn = roWidthIn + jackStuds * 1.5;

  if (wallType === 'non_bearing') {
    if (roWidthIn <= 48) return { jackStuds, headerLengthIn, headerSpec: 'Flat 2x4 or 2-2x4 Header (Non-Bearing)' };
    if (roWidthIn <= 96) return { jackStuds, headerLengthIn, headerSpec: '2-2x6 SPF #2 (Non-Bearing)' };
    return { jackStuds, headerLengthIn, headerSpec: '2-2x8 SPF #2 (Non-Bearing Wide Span)' };
  }

  const loadFactor = (wallType === 'exterior_2story' ? 1.45 : 1.0) * (snowLoadPsf >= 50 ? 1.25 : 1.0);
  const effSpanFt = (roWidthIn / 12) * loadFactor;

  if (effSpanFt <= 4.5) return { jackStuds, headerLengthIn, headerSpec: '2-2x6 SPF #2 (+ 1/2" OSB Spacer)' };
  if (effSpanFt <= 6.2) return { jackStuds, headerLengthIn, headerSpec: '2-2x8 SPF #2 (+ 1/2" OSB Spacer)' };
  if (effSpanFt <= 7.8) return { jackStuds, headerLengthIn, headerSpec: '2-2x10 SPF #2 (+ 1/2" OSB Spacer)' };
  if (effSpanFt <= 9.4) return { jackStuds, headerLengthIn, headerSpec: '2-2x12 SPF #2 (+ 1/2" OSB Spacer)' };
  return {
    jackStuds: Math.max(jackStuds, 4),
    headerLengthIn: roWidthIn + Math.max(jackStuds, 4) * 1.5,
    headerSpec: 'Engineered 2-Ply or 3-Ply LVL Beam (Structural Calc Required)',
  };
}

3. Place Exact Doors & Windows Directly in Your 2D/3D Floor Plan

After verifying rough opening sizes and header spans, test door swing clearances, pocket-wall stud pockets, and furniture flow directly inside PlanCaliber's free browser 2D/3D Floor Plan Studio. Pair this calculator with our IRC R310 Egress Window Calculator and US Baseboard, Crown & Door Casing Trim Calculator to finish both framing and trim takeoffs in one session.

Disclaimer: Preliminary US wood-framing rough opening and IRC Table R602.7(1) reference calculations for space planning and material estimating. Always verify exact manufacturer rough-opening sheets and consult a licensed structural engineer or local building department before cutting load-bearing walls or sizing engineered LVL headers.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.