How the cut list optimizer works
A plain-language description of what the calculators on this site do with your numbers, how they pick a layout, and where they can fall short.
The short version
For sheet goods, the optimizer builds dozens of complete cutting plans with different, well-studied packing rules, using only straight edge-to-edge cuts, and keeps the best plan by a fixed list of priorities. For boards it does the same with one-dimensional methods, including a search for the combination of pieces that fills each board best. Everything runs in your browser, and the same input always gives the same result.
Why it can't simply try every layout
Cutting rectangles from sheets is a version of the bin packing problem, a classic hard problem in computer science: there is no known method that finds a provably best answer quickly for every job, and the number of possible arrangements grows explosively with the number of parts. Practical optimizers, including this one, use heuristics: fast rules that produce good layouts without proving that nothing better exists. That is why this site calls its layouts near-optimal, not optimal.
Sheet goods: guillotine packing
Every layout is a guillotine layout: each cut runs straight through the piece being cut, from one edge to the opposite edge. That matches how table saws, track saws, circular saws and panel saws work, so every diagram can be cut in an ordinary shop.
The optimizer builds a sheet like this:
- Start with the usable part of the sheet (the sheet minus the edge trim) as one free rectangle.
- Take the next part and choose a free rectangle for it, using one of the placement rules below.
- Put the part in that rectangle's top-left corner and split the rest of the rectangle with one straight cut into at most two smaller free rectangles, leaving one kerf between the part and each of them.
- Repeat until no remaining part fits, then start a new sheet.
Free rectangles are never merged, because every free rectangle is a real piece of plywood you can pick up: the offcuts listed in your result are exactly these rectangles.
The rules it tries
- Where to put the next part (3 rules): the free rectangle that leaves the least area unused (best area fit), the one whose shorter leftover side is smallest (best short side fit), or the one whose longer leftover side is smallest (best long side fit). Ties go to the topmost, then leftmost, rectangle.
- How to split the space left beside a part (6 rules): cut along the shorter or the longer leftover side; cut so as to keep one large leftover or two more evenly sized ones; or always cut crosswise first, or always lengthwise first.
- Which parts to place first (4 orders): largest area, longest side, largest perimeter, or widest first.
That makes 3 × 6 × 4 = 72 strategies. These rules are described in Jukka Jylänki's survey "A Thousand Ways to Pack the Bin" (2010), a practical reference on rectangle packing.
Several stock sizes
When you list more than one sheet size, each strategy decides sheet by sheet: it fills one sheet of every available size with the remaining parts and keeps the one that places the most part area per dollar, or per unit of sheet area if any size has no price. Sheet quantities you enter are respected; parts that don't fit on the stock you have are reported as out of stock.
More than one plan per strategy
Each of the 72 strategies builds a complete plan on its own. The optimizer also builds a combined plan that, sheet by sheet, keeps the best fill any strategy found, including fills that start with a different first part, since the first piece on a sheet shapes every cut after it. For jobs of up to about 170 parts it then retries that combined plan with the part order lightly shuffled: up to 24 times for small jobs, fewer as the job grows. The shuffles come from a generator with a fixed seed, so they are the same every time, and the retries stop early once a plan provably can't be beaten: one sheet size and no more sheets than the total part area requires.
How the best plan is chosen
Plans are compared in this order:
- Fewest parts left unplaced.
- Lowest total cost, when every sheet used has a price.
- Least total sheet area.
- Fewest sheets.
- Largest single offcut, because one big leftover is more useful than several small ones.
Plans that tie on all five keep the earlier one in a fixed order, so results never change from one run to the next. A tidy-up pass then tries to re-cut the contents of two sheets, or of the three or more emptiest sheets, onto a single cheaper or smaller sheet, and to move each sheet's parts onto a smaller or cheaper stock size where they all still fit. If that frees up stock, it tries again to place any parts that had run out of stock.
Boards: one-dimensional cutting
For lumber and other material cut to length, each piece uses its length plus one kerf, and each board can hold its usable length plus one kerf, because the last piece doesn't need a cut after it. The calculator runs several methods and keeps the best plan:
- First-fit decreasing: longest pieces first, each into the first board with room.
- Best-fit decreasing: longest first, each into the board where it leaves the least room.
- Best fill per board: board by board, a search for the combination of remaining pieces that fills the board most completely, with a variant that always includes the longest remaining piece. The search stops after a fixed amount of work on very large jobs.
With several board lengths, the methods are run with different ways of picking the length of each new board: the longest available, the one that holds the most piece length for its price, or the one that looks cheapest for finishing the whole job. Each plan is then "downsized": every board is switched to a cheaper or shorter length that still holds its pieces. Plans are compared by fewest unplaced pieces, then lowest cost (or, unless every board length has a price, least total board length), then fewest boards, then the longest single offcut.
Kerf, trim and grain
- Kerf is left between every pair of neighboring parts and between a part and an offcut, but not at the trimmed edge of a sheet or the end of a board.
- Trim is removed from all four edges of every sheet, and from both ends of every board, before anything is placed. Parts can sit right against a trimmed edge, so the trim should include the kerf of the trimming cut. A part is too large if it doesn't fit inside the trimmed area in any allowed orientation.
- Grain: a sheet has grain along its length, or none. A grain-locked part keeps its length along a grained sheet's length. Parts that aren't locked, and all parts on sheets without grain, may be turned 90°.
- Waste percentage is the share of the full area (or length) of the stock used that doesn't end up in a part, so it includes trim, kerf and offcuts.
Units and rounding
The engine works in whatever unit you choose, inches or millimetres, and does its arithmetic in full precision. Lengths are compared with a tolerance of one millionth of a unit, so a part that fits exactly is treated as fitting despite floating-point noise. Inputs can be decimals, fractions (23 1/2, 23-1/2, ½), feet and inches (4' 6") or values with their own unit (600 mm, 60 cm). Results in inches are shown as fractions rounded to the nearest 1/16 in., and millimetre results are rounded to 0.1 mm. The rounding only affects what is displayed: the layout itself uses the sizes you entered, unrounded.
Limits
- Layouts are heuristic. They are good, but on some jobs a person can find a better one.
- Only guillotine layouts are produced. A CNC router can cut denser nested layouts that no table saw can, and this site doesn't model them.
- Parts are rectangles. Curves, angles and defects in the material aren't modeled; plan around a defect by entering the clear piece as separate stock.
- The optimizer lays out the sizes it is given. Allowances such as edge banding or parts cut oversize for later trimming need to be included in the part sizes.
- It doesn't plan the order of cuts or check your saw's capacity, such as how wide a rip your fence allows.
- Any part can go on any stock in a job, so plan different materials or thicknesses as separate jobs.
- Jobs are capped at 5,000 parts or pieces. To keep the page responsive on big sheet jobs, the shuffled retries are skipped beyond about 170 parts, and beyond about 1,000 parts only an evenly spread subset of the 72 strategies is run. Both limits come sooner when you list more than three sheet sizes.
Cut order
The optimizer keeps where parts and offcuts sit, so the cut order is rebuilt from the layout. Every layout is guillotine, so any piece holding more than one part or offcut has a straight cut, edge to edge, with one kerf that nothing crosses. Rips, the cuts along the sheet's length (along the grain on plywood, or along the longer side of stock with no grain), are taken first wherever a full-length rip crosses no part, so a sheet becomes full-length strips that are then crosscut; an offcut in the way comes off in two pieces. Each piece's run of parallel cuts is listed together, then each resulting piece in turn, with every measurement taken from the edge or end named on the step. Boards list their cuts from one end with cumulative marks, kerf included. A test replays the steps for real jobs and checks they produce exactly the planned parts.
Edge banding
Long edges are a part's larger dimension. Every copy in the parts list is counted, placed or not. The total adds 2 in. (50 mm) to every banded edge for trimming flush, and rounds up to whole feet or metres. Banding never changes the layout. Guides suggest cutting banding an inch or two longer than the edge (Popular Woodworking); the closet planner, whose parts are mostly short shelf fronts, allows the lower 1 in. (25 mm).
The PDF cut sheet
The cut sheet is built in your browser with pdf-lib and the built-in Helvetica fonts. Those cover the Windows-1252 character set, so a label in another script is refused with a message naming the character; the Print button handles any language. There is no date on it, and the same job always gives the same file.
Board feet and the rough lumber planner
A board foot is 144 cubic inches: thickness × width × length in inches, divided by 144. Because an inch is exactly 25.4 mm, one board foot is 0.002359737216 m³ and a cubic metre is about 423.776 board feet. Hardwood is counted on its nominal rough thickness, so 4/4 lumber surfaced to 13/16 in. still counts as 1 in.; the NHLA standard surfaced (S2S) thickness is the rough thickness less 3/16 in. up to 1 1/2 in., and less 1/4 in. from 1 3/4 to 4 in. Softwood is counted on nominal sizes under PS 20, so a 2x4 counts as 2 by 4. The optional yard tally rounds each board's surface measure to the nearest whole foot, as the NHLA rules do.
The planner gives each finished part the thinnest stocked thickness (4/4, 5/4, 6/4, 8/4, 10/4, 12/4 or 16/4) that still covers it after a milling allowance of 1/4 in. (6 mm), adds 1 in. (25 mm) of length and 1/4 in. (6 mm) of width per part, and divides the board feet by the grade's minimum clear-cutting yield under the NHLA rules: FAS 83 1/3%, No. 1 Common 66 2/3% and No. 2A Common 50%. It then adds an offcut allowance (15% by default) and rounds up to whole board feet. Every default can be changed, and the result is a planning estimate: real yield depends on the boards you pick.
Sources: National Hardwood Lumber Association, Rules for the Measurement and Inspection of Hardwood and Cypress; American Hardwood Export Council, measurement of sawn lumber; NIST, PS 20-25, American Softwood Lumber Standard.
Stair stringer calculator
The stair stringer calculator divides the total rise into the fewest equal risers that stay under your maximum: risers = total rise ÷ maximum riser, rounded up, and each riser is the total rise divided by that count, kept exact and shown rounded to 1/16 in. or 0.1 mm. The bottom of the stringer is dropped by the tread thickness, less any flooring still to be laid at the foot, so the first and last steps come out the same height as the rest. A stair that ends one step below the top floor gets one tread cut fewer than it has risers; a stair flush with the top gets one per riser.
The notch depth is measured square to the board's edge: riser × run ÷ √(riser² + run²). The throat is the stock depth minus that, so a 2x12 (11 1/4 in. actual) has more wood left under the notches than a 2x10 (9 1/4 in.). Framing square settings are rounded to 1/16 in. (1 mm), and because that rounding adds up over a long flight, the layout marks are measured from the first notch rather than stepped off one by one. The board is the shortest stock length, from 8 to 20 ft in 2 ft steps (2.4 to 6.0 m in 0.3 m steps), that holds the stringer and its last layout mark, which sits about riser × sin θ past the head cut. The stringer count is the stair width less 1 1/2 in. divided by the maximum spacing, rounded up, plus one, and never fewer than two. Treads are filled with the fewest boards that cover the run and nosing, and a rip narrower than 1 1/2 in. (38 mm) is never suggested.
The printable template is drawn at exactly 72 points per inch with a 1/2 in. overlap between pages and 3/8 in. page margins, in whichever orientation needs fewer pages, and a page is printed only if a cut crosses it. The same input always gives the same PDF.
The checks follow the 2021 International Residential Code, section R311.7: risers no taller than 7 3/4 in. and treads at least 10 in. deep, each varying by no more than 3/8 in. within a flight; nosings of 3/4 to 1 1/4 in. where treads are under 11 in. deep; at most 151 in. of rise in one flight; 6 ft 8 in. of headroom; a 36 in. landing on straight runs; a handrail on each flight of four or more risers; and guards where the top tread is more than 30 in. above the floor or ground below. Deck stairs also follow AWC's DCA 6 deck guide: 2x12 stringers at least, a throat of at least 5 in., cut stringers at most 18 in. apart under 2x or 5/4 treads, at least three of them, and footings below the frost line. The calculator reports these as checks, not approval: local codes adopt different editions and amendments, so confirm with your building department. DCA 6 does not cover composite treads; the composite preset uses 12 in. spacing and points you to the maker's stair chart.
Sources: International Code Council, 2021 IRC chapter 3; American Wood Council, DCA 6, Prescriptive Residential Wood Deck Construction Guide; actual lumber sizes from PS 20, as cited in the board cut calculator.
Closet planner
The closet planner builds a run of sections from full-height panels that stand on the floor, with one shared panel between neighbouring sections, so n sections take n + 1 panels. Section widths are clear openings, and the run is the openings plus the panel thicknesses; whatever is left of the wall is shown so you can scribe or add a filler. With a top shelf across the run, panels stop under it and the shelf is split over a panel where it would be longer than a sheet.
Fixed shelves are the opening when screwed in, or the opening plus both dado depths when dadoed (a dado must be less than half the panel thickness). Adjustable shelves are the opening less 1/16 in. (1.5 mm) so they drop onto the pins. Rails are 3 1/2 in. (90 mm) tall, at the top back of every section and at the floor in hanging sections. Closet rods are the opening less 1/4 in. (6 mm), with sockets 12 in. (300 mm) from the back wall, at least 2 in. (50 mm) between the top of the rod and the shelf above, and a centre support for every 48 in. (1220 mm) of rod. Hanging needs about 24 in. (600 mm) of depth. Sizes are rounded to 1/16 in. or 0.1 mm, and the sheet count is the optimizer's own result for the parts it hands over.
Shelf sag warnings use WoodBin's shelf span table, which allows about 32 in. for 3/4 in. plywood and 26 in. for particleboard and melamine under a typical load, scaled with thickness; MDF is treated like particleboard, which errs on the safe side. Rod heights are common practice rather than code: about 66 in. for a single rod and about 80 and 40 in. for a double hang.
Sources: WoodBin, shelf span table and Sagulator; NFPA 70 (National Electrical Code) section 410.16 and IRC section E4003.12 on light fixtures in clothes closets; drawer-slide clearances from the slide makers' drawings, which you should check for your slides.
How the engine is tested
The optimizer has automated tests. Hand-worked layouts check kerf gaps, trim, grain, stock limits and cost choices against numbers worked out on paper. Hundreds of randomly generated jobs are checked for parts that overlap, parts outside the trimmed sheet, gaps narrower than the kerf, grain violations, parts that go missing from both the layout and the unplaced list, and results that change between runs.
Accuracy and corrections
Figures in the guides are checked against the standards and manufacturer specs they link to, and the engine's behavior is checked by the tests described above. If you find an error, please report it; corrections are listed in the changelog.