Quick Answer
A stud calculator counts framing pieces, not just the marks on the plate. A 24 ft by 9 ft wall at 16 in on centre has 19 positions on the layout, but with one 38 in door, one 50 in window, two corners and one tee it needs 38 pieces: 14 commons, 6 king studs, 4 jacks, 8 cripples and 6 for the corners and the tee.

Stud Calculator Formula: Layout, Openings, Corners and Plates
Every stud calculator starts with the same line, and most of them stop there:
positions = ⌈ wall length in inches ÷ spacing ⌉ + 1That is the stud layout, not the stud count. It tells you where the marks go on the plate. It says nothing about what happens at a door, at a window, where this wall meets another one, or whether the spacing you picked is allowed at all. On the 24 ft wall this calculator opens with, the layout gives 19 positions and the finished wall needs 38 pieces — exactly twice as many.
The full count is five separate terms, and this calculator runs all five:
pieces = commons + kings + jacks + cripples + junction studswhere
commons = positions − ∑ ⌊ rough opening ÷ spacing ⌋Each opening removes the layout positions that land inside it — the floor of its rough width divided by the spacing — and then puts back more pieces than it took. A 38 in door removes 2 positions and adds 6. A 50 in window removes 3 and adds 12.
King Studs, Jack Studs and Cripples: What Each Piece Does
The pieces the layout formula misses are not obscure. They are the ones a framer cuts every day, and each has its own rule for how many you need.
| Piece | What it is | How many |
|---|---|---|
| Common stud | A full-height stud on the regular layout, plate to plate | Layout positions, minus the ones inside an opening |
| King stud | A full-height stud running past the header, nailed to its end | From IRC Table R602.7.5, by header span and wind speed |
| Jack stud | A shortened stud under the header that carries it down to the plate; also called a trimmer | At least one each end; the span tables set the real number |
| Cripple stud | A short stud filling above a header, or above and below a window | One layout position each, doubled under a window for the sill |
| Corner post | The built-up post where two walls meet | Two extra studs beyond the wall-end stud already counted |
| Tee / partition post | Backing where a partition lands on this wall | Two extra studs, or none with ladder blocking |
A door gets cripples above the header only. A window gets them above the header and below the sill, which is why a window of similar width costs roughly twice the cripples.
Corners and tees are the two the formula can never see, because they belong to two walls at once. A traditional three-stud corner adds two studs beyond the stud already standing at the end of the wall. Advanced framing uses a two-stud corner with drywall clips, and ladder blocking at intersections instead of a full post — the calculator switches both when you select it, and warns you that whoever hangs the board has to know before you frame it that way.
King Studs Come from the Wind Speed, Not from the Opening
This is the part no other stud calculator asks about. The number of full-height studs at each end of a header is not a matter of preference, and it is not set by the opening width alone. IRC Section R602.7.5 and Table R602.7.5 index it by maximum header span and ultimate design wind speed and exposure category.
| Maximum header span | < 140 mph Exposure B, or < 130 mph Exposure C | ≤ 115 mph Exposure B |
|---|---|---|
| 4 ft | 1 each end | 1 each end |
| 6 ft | 2 each end | 1 each end |
| 8 ft | 2 each end | 1 each end |
| 10 ft | 3 each end | 2 each end |
| 12 ft | 3 each end | 2 each end |
| 14 ft | 3 each end | 2 each end |
| 16 ft | 4 each end | 2 each end |
| 18 ft | 4 each end | 2 each end |
Table R602.7.5, minimum number of full-height studs at each end of headers in exterior walls.
Read the 16 ft row twice. A double garage header needs eight full-height studs across the two ends in a 140 mph county and four in a 115 mph one. That is the same header, the same span, the same builder — and twice the king studs. A calculator that assumes “two kings per opening” is wrong by four pieces on one opening, and it is wrong in the direction that leaves you short at the lumber yard.
Jack studs are a separate question from king studs, and this calculator does not pretend otherwise. It takes jacks per end as an input with a minimum of one, because the real number comes from the header span tables, R602.7(1) and R602.7(2), which depend on the species, the grade and the load above. Check yours there before you cut.
The Spacing You Pick May Not Be Legal
Stud spacing is usually discussed as a preference — 16 in on centre for strength, 24 in to save lumber. It is not a preference. IRC Table R602.3(5) caps it by stud size, by laterally unsupported height and by what the wall carries, and this calculator checks your combination against the table before it counts anything.
| Stud size | Bearing height | Roof & ceiling only | One floor + roof | Two floors + roof | Nonbearing |
|---|---|---|---|---|---|
| 2 × 3 | — | — | — | — | 10 ft at 16 in |
| 2 × 4 | 10 ft | 24 in | 16 in | — | 14 ft at 24 in |
| 2 × 6 | 10 ft | 24 in | 24 in | 16 in | 20 ft at 24 in |
A dash is not a large number — it means the table has no entry for that combination at any spacing. The full code table also lists 3 × 4 and 2 × 5, which this calculator does not offer.
Three consequences fall straight out of that table, and all three surprise people:
- A 2 × 4 carrying one floor and a roof is capped at 16 in on centre. Not 24. The 24 in figure everyone quotes is the roof-and-ceiling-only column.
- A 2 × 4 under two floors and a roof has no entry at all. Not at 24 in, not at 16, not at any spacing. That wall wants a 2 × 6 or a 3 × 4.
- Every bearing height in the table is 10 ft. A 12 ft bearing wall is off this table entirely and belongs to Table R602.3(6) or an engineered design.
Nonbearing walls are the generous column, and it is the one most interior partitions live in: a 2 × 4 nonbearing partition is permitted to 14 ft at 24 in on centre. That is why the same 2 × 4 can be legal at 24 in in a closet wall and illegal at 24 in in the exterior wall three feet away. Select what the wall actually carries and the calculator reads the right column for you.
Plates and Fireblocking Are Material Too
Two more things go on the truck with the studs, and neither appears in a stud count.
Plate stock is three times the wall length. IRC R602.3.2 requires a double top plate with end joints offset at least 24 in, so a wall gets one bottom plate and two top plates: 72 linear feet for a 24 ft wall. If you buy plate stock by the board and want the conversion, the square feet to linear feet calculator handles that step.
Fireblocking depends on the height. R302.11 requires fireblocking in concealed stud spaces at intervals not exceeding 10 ft, so a 9 ft wall needs none and a 12 ft wall needs one intermediate row — a block in every bay. On the worked wall below, that one row would be 19 blocks. The calculator shows the row count and the block count as soon as the height crosses 10 ft, and says “not required” below it rather than leaving the field blank.
How to Use the Stud Calculator
- Enter the wall length and height in feet. Height is floor to the underside of the double top plate. It decides both whether your stud size is legal and whether the wall needs fireblocking.
- Pick the stud size and the on-centre spacing. The chips are the sizes and spacings the code table covers.
- Choose what the wall carries. Nonbearing, roof and ceiling only, one floor plus roof, or two floors plus roof. This is the column of Table R602.3(5) that applies to you, and the verdict panel updates as soon as you change it.
- Enter the openings as rough opening widths, in inches. Not the door or window size — a 3-0 door is usually a 38 in rough opening.
- Open Advanced for corners, wind speed, framing style and price. Count the corners this wall ends at and the partitions that land on it. Set the wind speed from the IRC wind map or your building department; it is what drives the king stud count.
- Read the verdict before the count. If the panel says NOT PERMITTED, the piece count is still arithmetic but the wall is not buildable as specified — change the size, the spacing or the height first.
Worked Example: A 24 ft × 9 ft Wall
One 38 in door, one 50 in window, two corners, one tee, 2 × 4 at 16 in on centre carrying one floor and a roof, below 140 mph Exposure B. This is what the calculator opens with, so you can follow every line of it on screen.
| Step | Working | Pieces |
|---|---|---|
| Layout positions | ⌈288 in ÷ 16 in⌉ + 1 | 19 |
| Commons the openings displace | ⌊38 ÷ 16⌋ + ⌊50 ÷ 16⌋ = 2 + 3 | −5 |
| King studs | Door 3.17 ft span → 1 each end; window 4.17 ft → 2 each end | +6 |
| Jack studs | 1 each end × 2 ends × 2 openings | +4 |
| Cripples | Door 2 above; window 3 above + 3 below | +8 |
| Corners and tees | 2 corners × 2 + 1 tee × 2 | +6 |
| Framing pieces | 14 commons + 6 + 4 + 8 + 6 | 38 |
Plate stock 72 linear feet. Fireblocking not required at 9 ft. At 10% waste the calculator says to buy 33 studs — commons, kings, jacks and junction studs come out of full stock, while cripples are short enough to nest into the offcuts.
Look at what the two openings did. They displaced 5 commons and added 18 pieces: the door is a net +4 and the window a net +9, for +13 across the wall. The results panel prints that row by row under “what each opening really costs”, because it is the single most common estimating mistake in wall framing — the intuition that a hole in the wall means less lumber.
Now take the same wall to 12 ft high and two things change at once. The verdict flips to NOT PERMITTED, because every bearing height in Table R602.3(5) is 10 ft. And R302.11 adds a row of fireblocking: 19 bays, so 19 blocks that no stud count would ever have shown you. Framing stairs in the same build? The stair stringer calculator applies the IRC rise and run limits the same way.
