Enter the stock length, the saw kerf, and the length and quantity of each part (up to 8 kinds; rows with a blank length are ignored). The price per board can be left blank.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Enter the stock length of your lumber (8 ft, 10 ft, 12 ft and so on) and the length and quantity of each part you need (up to 8 kinds), and you get the number of boards to buy on the spot
- The saw kerf (the blade thickness, 1/8 in by default) is included, so you will not fall into traps such as "four 24 in pieces from a 96 in board" (only three actually fit)
- The layout is based on placing the longest parts first (First Fit Decreasing); if there are 60 parts or fewer in total, it also searches for the combination that uses the fewest boards. It shows a cutting layout such as "Board 1: Leg × 2, offcut 15.75 in" and a bar chart for each board
- It also shows the simple count when each kind of part is cut from its own boards, so you can see how many boards combined cutting saves. By comparing with the theoretical minimum (lower bound), it tells you whether the layout is optimal (cannot be reduced) or an approximation
- Enter a price per board (optional) to get the estimated cost and the money saved. A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are all on this page
What is this calculation used for?
For example, to build a potting bench with four 40 in legs, two 26 in aprons and two 21 in rails from 8 ft 2×4s, buying boards separately for each part takes 4 boards, but combined cutting with the longest parts first needs only 3 (board 1: legs × 2, board 2: legs × 2, board 3: aprons × 2 + rails × 2, offcut 1.5 in).
Working out the count before you go shopping avoids a second trip because you ran short, or leftovers you have no room to store. If you use the store's cutting service, the cutting layout lets you give all the cutting instructions at once.
In jobs that use "many parts of the same length", such as deck joists or fence rails, the kerfs add up and affect the count. For example, cutting 24 in rails from 96 in boards, four fit exactly without a kerf, but with a 1/8 in kerf \(4 \times 24 + 3 \times 0.125 = 96.375\) in, so the fourth is 3/8 in short and only 3 fit per board. For 40 rails you need \(\lceil 40 \div 3 \rceil = 14\) boards, not 10.
Just changing the length from 24 in to 23 7/8 in lets 4 fit per board and brings it back to 10 boards, so checking at the design stage "how many of this length fit on a board" can save a lot on materials.
PVC pipe (10 ft lengths), electrical conduit, aluminum framing, curtain rods and anything else "sold in a fixed length and cut to size" works with the same formulas as lumber. For example, cutting five 36 in, three 28.5 in and one 9 in piece from 10 ft (120 in) PVC pipe takes 3 lengths with combined cutting (4 when bought separately).
The kerf, however, is close to 0 with a pipe cutter and about 1/16 in with a hacksaw, depending on the tool, so change the kerf to match your tool.
In a factory, materials are a large part of the cost, so the share of material that becomes product is managed as the yield. The "Yield" on this page is the total length of parts divided by the total length of boards bought, and it gets closer to 100% as offcuts and kerfs shrink.
Real factories assign hundreds of kinds of parts to thousands of pieces of stock, so they use dedicated software that solves the same "bin packing problem" as this page. First Fit Decreasing, placing the longest first, is a standard method in such software for making a first plan.
Baseboard (along the bottom of walls) and crown molding (along the top) are sold in stock lengths such as 8, 12 and 16 ft and cut to fit each wall. For example, to run 16 ft (192 in) baseboard around a room whose walls are 132 in, 108 in, 132 in and 108 in (openings excluded), 132 and 108 do not fit on one board, so even combined cutting needs 4 boards (the lower bound is 3, but it cannot be reached).
Once a single wall is longer than half the stock length, the count cannot be reduced, so this helps you decide early whether to allow joints (scarf joints) or choose a different stock length.
Formulas and figures
Symbols and terms
Symbols
| \(L\) | ell | The stock length (in), the length of one board you buy. From the first letter of "length", in capitals to tell it apart from the part length \(l\). |
| \(l\), \(l_i\) | ell, ell sub i | The length of a part (a piece you want to cut, in inches). The \(i\) in \(l_i\) is the number of the \(i\)-th kind of part (there are several kinds, such as legs, aprons and rails). |
| \(k\) | kay | The saw kerf (the blade thickness, in). Each cut removes this much wood. From the first letter of "kerf". |
| \(m\), \(m_i\) | em, em sub i | The number of pieces you can cut from one board. Found with \(m = \lfloor (L + k) \div (l + k) \rfloor\). |
| \(q_i\) | cue sub i | The quantity of part \(i\) needed. From the first letter of "quantity". |
| \(B_i\), \(B_{\text{sep}}\) | bee sub i, bee sub sep | \(B_i\) is the number of boards needed for part \(i\) alone (\(\lceil q_i \div m_i \rceil\)). \(B_{\text{sep}}\) is the total when each part is bought separately (the sum of the \(B_i\)). |
| \(B\) | bee | The number of boards needed with combined cutting (placing the longest parts first). The main value on this page. |
| \(n\) | en | The number of pieces cut from one particular board. From the first letter of "number". In the offcut formula it sets how many kerfs to subtract. |
| \(w\) | double-u | The offcut from one board (the length left unused, in). From the first letter of "waste". |
| \(B_{\min}\) | bee min | The theoretical minimum number of boards (lower bound). Found with \(\lceil \sum_i q_i (l_i + k) \div (L + k) \rceil\); if the combined cutting count \(B\) equals it, the layout is optimal. "min" is short for minimum. |
| \(\Delta\) | delta | The boards saved, \(B_{\text{sep}} - B\). The Greek letter delta is often used for a difference (it matches d for "difference"). |
| \(u\) | you | The price per board ($). From the first letter of "unit price". |
| \(T\) | tee | The estimated cost ($). From the first letter of "total". Lumber only, without cutting charges or delivery. |
| \(\lfloor x \rfloor\) | floor of x | The symbol for rounding down to a whole number. (Example - \(\lfloor 2.40 \rfloor = 2\), \(\lfloor 3 \rfloor = 3\)) The pieces you can cut drop the part that does not fit, so this symbol is used. |
| \(\lceil x \rceil\) | ceiling of x | The symbol for rounding up to a whole number. (Example - \(\lceil 2.65 \rceil = 3\), \(\lceil 2 \rceil = 2\)) The boards you buy add one more for any shortfall, so this symbol is used. |
| \(\sum\) | sigma | The symbol for "add them all". \(\sum_i q_i (l_i + k)\) means calculating \(q_i (l_i + k)\) for each kind of part \(i\) and adding them all. It is the Greek letter sigma, which matches S for "sum". |
Terms
| stock length | The standard length that lumber, steel, pipe and so on are sold in. In the US, dimensional lumber such as 2×4s is usually sold in 2 ft steps, 8, 10, 12, 14 and 16 ft, and the 8 ft 2×4 is the home center standard. |
| kerf | The width of wood removed by the saw blade in each cut. A standard full-kerf circular saw blade is about 1/8 in, and a thin-kerf blade about 3/32 in. If you know your blade's kerf (it is often printed on the blade), enter that value. It adds up with every cut, so it matters most when you cut many short pieces. |
| cut list | A list of the parts to cut and their sizes, and the plan for cutting them from your boards (also called a cutting layout). This page handles one-dimensional layouts, by length only, not two-dimensional layouts cut from plywood sheets. |
| offcut | The material left after the parts are cut, the short piece at the end of a board. The fewer offcuts, the less material is wasted and the higher the yield. |
| combined cutting | Cutting different kinds of parts from the same board, fitting other parts into the leftover instead of using separate boards for "legs" and "aprons". It often uses fewer boards than buying for each kind of part, and the cutting layout on this page shows how. |
| First Fit Decreasing (FFD) | A procedure that places items "largest first (Decreasing), into the first place they fit (First Fit)". It is a classic approximation for the bin packing problem and is used for combined cutting on this page. It is simple yet gives good results and is proven to stay within about 1.22 times the minimum plus 1, but it does not always find the minimum. When it does not reach the lower bound, this calculator searches for the fewest boards with branch and bound (for 60 parts or fewer). |
| bin packing problem | The problem of packing items of various sizes into bins of a fixed size using as few bins as possible. Cutting parts from lumber (boards = bins, parts = items) is its one-dimensional version. With many items, the work needed to find the best packing grows very quickly, so in practice standard approximations such as FFD are widely used. |
| branch and bound | A search method that tries combinations by branching, and cuts off (bounds) any branch that cannot beat the best result so far, so the optimal solution is found without trying everything. On this page, each way of filling one board is a branch, and branches where "boards used + the lower bound for the remaining parts" is at least the best so far are cut off. |
| yield | The share of the material that ends up in the finished parts. On this page it is "total length of parts ÷ total length of boards bought", and it gets closer to 100% as offcuts and kerfs shrink. |
| lower bound | A value that "cannot be beaten however clever you are". The theoretical minimum on this page is a lower bound; if the layout matches it, the layout is optimal. Even if not, it cannot always be reached (three 50 in parts from 96 in boards give a lower bound of 2, but 3 are needed). |
| optimal solution | The best answer among all possible ways. On this page it is "the layout that uses the fewest boards". If combined cutting matches the lower bound, it is optimal. Even if not, it is optimal when a search of all combinations confirms that no fewer boards are possible. |
| nominal size | The name size of lumber, such as "2×4", which is larger than the actual size. The actual size of a 2×4 is 1-1/2 in × 3-1/2 in, because the board is planed smooth after sawing. Lengths, on the other hand, are sold at their full stated length (an 8 ft board is 96 in). |
| 2×4 | A two-by-four, standard lumber with an actual cross section of 1-1/2 in × 3-1/2 in (about 38 mm × 89 mm), the easiest wood to find for DIY at home centers. It is sold in lengths such as 8, 10, 12 and 16 ft, and also as precut studs (92-5/8 in) for 8 ft walls. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
| Division with remainders (Grades 3–4) |
|
| Rounding (Grades 3–4) |
|
| Dividing decimals (Grades 5–6) |
|
| Expressions and inequalities with variables (Grades 6–7) |
|
| Ratios and percents (Grade 6) |
|
How to calculate it in Excel
| Stock length (in) | 96 |
| Part length (in) | 40 |
| Kerf (in) | 0.125 |
| Pieces per board | =INT((B1+B3)/(B2+B3)) |
| Quantity of the part | 4 |
| Pieces per board | 2 |
| Boards needed | =ROUNDUP(B1/B2,0) |
| Stock length (in) | 96 |
| Total length of parts cut from it (in) | 94 |
| Pieces cut from it | 4 |
| Kerf (in) | 0.125 |
| Offcut (in) | =MAX(0,B1-B2-B3*B4) |
| Total of (length + kerf) for all parts (in) | 255 |
| Stock length + kerf (in) | 96.125 |
| Theoretical minimum | =ROUNDUP(B1/B2,0) |
| Boards if bought separately | 4 |
| Boards with combined cutting | 3 |
| Price per board ($) | 3.98 |
| Boards saved | =B1-B2 |
| Estimated cost ($) | =B3*B2 |
"INT(value)" is the function that rounds down to a whole number (⌊ ⌋ in the formulas), and "ROUNDUP(value, 0)" rounds up (⌈ ⌉).
B4 of the first table is 2, B3 of the second is 2, B5 of the third is 1.5 in, B3 of the fourth is 3, and the fifth gives 1 board saved and a cost of $11.94.
The longest-first layout itself means sorting the parts from longest to shortest and assigning them to boards one by one, which is manual work in a spreadsheet. Use the spreadsheet to check the pieces per board, offcuts and lower bound, and use this page or the Python code below for the cutting layout.
How to calculate it in Google Sheets
| Stock length (in) | 96 |
| Part length (in) | 40 |
| Kerf (in) | 0.125 |
| Pieces per board | =INT((B1+B3)/(B2+B3)) |
| Quantity of the part | 4 |
| Pieces per board | 2 |
| Boards needed | =ROUNDUP(B1/B2,0) |
| Stock length (in) | 96 |
| Total length of parts cut from it (in) | 94 |
| Pieces cut from it | 4 |
| Kerf (in) | 0.125 |
| Offcut (in) | =MAX(0,B1-B2-B3*B4) |
| Total of (length + kerf) for all parts (in) | 255 |
| Stock length + kerf (in) | 96.125 |
| Theoretical minimum | =ROUNDUP(B1/B2,0) |
| Boards if bought separately | 4 |
| Boards with combined cutting | 3 |
| Price per board ($) | 3.98 |
| Boards saved | =B1-B2 |
| Estimated cost ($) | =B3*B2 |
How to calculate it in Python
import math
stock_length = 96 # stock length (in). An 8 ft board
kerf = 0.125 # saw kerf (blade thickness, in)
unit_price = 3.98 # price per board ($)
# parts needed: (name, length in, quantity)
parts = [("Leg", 40, 4), ("Apron", 26, 2), ("Rail", 21, 2)]
# boards when each part is bought separately (divide by the pieces per board and round up)
stocks_separate = 0
for name, length, qty in parts:
per_stock = (stock_length + kerf) // (length + kerf) # round down (the ⌊ ⌋ in the formula)
stocks_separate += math.ceil(qty / per_stock) # round up (the ⌈ ⌉ in the formula)
# combined cutting: longest parts first, into the first board they fit (First Fit Decreasing)
items = sorted([(length, name) for name, length, qty in parts for _ in range(qty)], key=lambda t: -t[0])
stocks = [] # one {"parts": [...], "remaining": remaining length} per board
for length, name in items:
for stock in stocks:
if length <= stock["remaining"]:
stock["parts"].append((name, length))
stock["remaining"] = max(0, stock["remaining"] - length - kerf)
break
else:
stocks.append({"parts": [(name, length)], "remaining": max(0, stock_length - length - kerf)})
# theoretical minimum (lower bound)
lower_bound = math.ceil(sum(qty * (length + kerf) for name, length, qty in parts) / (stock_length + kerf))
print(f"Boards if each part is bought separately: {stocks_separate}")
print(f"Boards with combined cutting: {len(stocks)} (theoretical minimum {lower_bound})")
for i, stock in enumerate(stocks, 1):
names = " + ".join(f"{name} {length}" for name, length in stock["parts"])
print(f" Board {i}: {names} offcut {stock['remaining']} in")
print(f"Boards saved: {stocks_separate - len(stocks)}")
print(f"Estimated cost: ${unit_price * len(stocks):,.2f}")
How to write it in LaTeX and other math languages (copy and paste)
m = ⌊(L + k) ÷ (l + k)⌋
m = \left\lfloor \frac{L + k}{l + k} \right\rfloor
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>m</mi>
<mo>=</mo>
<mo>⌊</mo>
<mfrac>
<mrow><mi>L</mi><mo>+</mo><mi>k</mi></mrow>
<mrow><mi>l</mi><mo>+</mo><mi>k</mi></mrow>
</mfrac>
<mo>⌋</mo>
</mrow>
</math>
m = |__ (L + k) / (l + k) __|
Floor[(L + k)/(l + k)]
m := floor((L + k)/(l + k));
m = floor((L + k)/(l + k));
m = ⌊(L + k)/(l + k)⌋
Bᵢ = ⌈qᵢ ÷ mᵢ⌉, B_sep = B₁ + B₂ + …
B_i = \left\lceil \frac{q_i}{m_i} \right\rceil,\quad B_{\text{sep}} = \sum_i B_i
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>B</mi><mi>i</mi></msub>
<mo>=</mo>
<mo>⌈</mo>
<mfrac><msub><mi>q</mi><mi>i</mi></msub><msub><mi>m</mi><mi>i</mi></msub></mfrac>
<mo>⌉</mo>
<mo>,</mo>
<msub><mi>B</mi><mtext>sep</mtext></msub>
<mo>=</mo>
<munder><mo>∑</mo><mi>i</mi></munder>
<msub><mi>B</mi><mi>i</mi></msub>
</mrow>
</math>
B_i = |~ q_i / m_i ~|, B_"sep" = sum_i B_i
Total[Ceiling[q/m]]
B := add(ceil(q[i]/m[i]), i = 1 .. n);
B = sum(ceil(q ./ m));
B_i = ⌈q_i/m_i⌉, B_sep = ∑_i B_i
w = L − (l₁ + l₂ + … + lₙ) − n × k
w = L - \sum_{j=1}^{n} l_j - n k
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>w</mi>
<mo>=</mo>
<mi>L</mi>
<mo>−</mo>
<munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover>
<msub><mi>l</mi><mi>j</mi></msub>
<mo>−</mo>
<mi>n</mi><mo>⁢</mo><mi>k</mi>
</mrow>
</math>
w = L - sum_(j=1)^n l_j - n k
L - Total[l] - Length[l]*k
w := L - add(l[j], j = 1 .. n) - n*k;
w = L - sum(l) - numel(l)*k;
w = L − ∑_(j=1)^n l_j − nk
Bmin = ⌈Σ qᵢ(lᵢ + k) ÷ (L + k)⌉
B_{\min} = \left\lceil \frac{\sum_i q_i (l_i + k)}{L + k} \right\rceil
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>B</mi><mi>min</mi></msub>
<mo>=</mo>
<mo>⌈</mo>
<mfrac>
<mrow><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>q</mi><mi>i</mi></msub><mo>(</mo><msub><mi>l</mi><mi>i</mi></msub><mo>+</mo><mi>k</mi><mo>)</mo></mrow>
<mrow><mi>L</mi><mo>+</mo><mi>k</mi></mrow>
</mfrac>
<mo>⌉</mo>
</mrow>
</math>
B_min = |~ (sum_i q_i (l_i + k)) / (L + k) ~|
Ceiling[Total[q*(l + k)]/(L + k)]
Bmin := ceil(add(q[i]*(l[i] + k), i = 1 .. n)/(L + k));
Bmin = ceil(sum(q .* (l + k))/(L + k));
B_min = ⌈(∑_i q_i (l_i + k))/(L + k)⌉
Δ = B_sep − B, T = u × B
\Delta = B_{\text{sep}} - B,\quad T = u \times B
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>Δ</mi>
<mo>=</mo>
<msub><mi>B</mi><mtext>sep</mtext></msub>
<mo>−</mo>
<mi>B</mi>
<mo>,</mo>
<mi>T</mi>
<mo>=</mo>
<mi>u</mi>
<mo>×</mo>
<mi>B</mi>
</mrow>
</math>
Delta = B_"sep" - B, T = u * B
{bSep - b, u*b}
Delta := Bsep - B; T := u*B;
Delta = Bsep - B; T = u*B;
Δ = B_sep − B, T = u × B
How to have ChatGPT do the calculation
You are a calculation assistant for woodworking cut lists. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). From 96 in (8 ft) boards, with a 1/8 in (0.125 in) saw kerf, I am cutting four 40 in legs, two 26 in aprons and two 21 in rails. Find each of the following: 1. For each part, the number of pieces per board ((96 + 0.125) ÷ (part length + 0.125), rounded down) 2. The total number of boards if each part is cut from its own boards (quantity ÷ pieces per board, rounded up, added together) 3. The number of boards when placing the longest parts first, each into the first board it fits (First Fit Decreasing), and the parts and offcut of each board (each piece placed on a board reduces its remaining length by "length + kerf") 4. The theoretical minimum number of boards (the total of (length + kerf) for all parts ÷ (96 + 0.125), rounded up) Show the code you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
