Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Baseboard, Crown Molding and Trim Calculator (Linear Feet and Pieces)

Choose the trim and how to enter the length, then enter the room size (or perimeter) and the stock length. For baseboard, enter the width and number of openings with no baseboard, such as doors and patio doors, one kind per row (leave unused rows blank).

Row Width Count
1
2
3
4
Enter lengths in meters and opening widths in the unit chosen on the right. A blank waste factor counts as 5%, a blank opening count as 1 and a blank number of corners as 0. The price and the pieces you have can be left blank.
Result and figure
Enter the room size (or perimeter), the openings and the stock length on the left and press "Calculate". The result and a floor plan will appear here.

What you can do on this page

  • Enter the room length and width (or the perimeter) and the width of openings with no baseboard, such as doors and patio doors, and see right away the length of baseboard you need (with waste) and how many stock pieces to buy, with the leftover
  • Choose "Baseboard (at the floor, minus openings)", "Crown molding (at the ceiling, no openings)" or "Transition strip / trim (any length)", so it works for any trim you buy by length
  • See the count from "length needed ÷ stock length" next to the practical count that assigns stock pieces wall by wall to cut down on seams (rounded up per wall). A floor plan shows the gaps for openings and the pieces on each wall in color
  • Add an allowance for miter cuts from the number of inside and outside corners. Enter a price ($ per piece or per foot) for a cost estimate, or the pieces you already have to see how much they cover and how many more to buy
  • A plain-language explanation of the formulas and copy-and-paste formulas for Excel, Google Sheets and Python are on this page too
The room is treated as a rectangle. To work out the perimeter itself (together with wall and ceiling area), use the wall, ceiling and floor area page. If each piece has a set length and you want to fit them into stock boards with saw kerf, use the lumber cut list page. Switch "Units" above the calculator to Metric to work in meters.

What is this calculation used for?

Buying and installing new baseboard yourself (DIY remodel)

When you replace the baseboard along with new flooring or paint, this formula tells you how many pieces to buy. For example, a 12 × 10 ft room (perimeter 44 ft) with a 40 in door and a 72 in patio door has a net length of about 34.67 ft. With a 5% waste factor you need 36.4 ft, so with 8 ft stock that is 5 pieces (4.55 before rounding up).
But if you assign stock wall by wall, the two 10 ft walls take 2 pieces each, and the two 12 ft walls (6 ft and about 8.67 ft after subtracting the openings) take 1 and 2, for 7 in total. Buy 7 if you want no seams in the middle of walls, or 5 if you are fine joining offcuts.

Ordering crown molding in stock lengths

Crown molding and other decorative molding are estimated from the perimeter without subtracting openings. For a room with a 44 ft perimeter and 5% waste, you need 46.2 ft: 4 pieces of 12 ft stock (3.85 before rounding up) or 3 pieces of 16 ft stock (2.89).
With short 8 ft stock it is 6 pieces (5.78) and more seams. Assigned wall by wall, 8 ft stock takes 2 + 2 + 2 + 2 = 8 pieces, while 12 ft stock covers each wall in one piece (4 pieces, no seams). So you can compare and choose longer stock when fewer seams matter.

Buying vinyl cove base in rolls

Vinyl cove base is often sold in 120 ft rolls or by the foot, so you buy the length needed rather than pieces. For the 12 × 10 ft room above, you need 36.4 ft, and entering the price per foot gives the cost estimate.
Some cove base can be bent around corners (no miter cuts), so a smaller waste factor (for example 3%) is fine. For 4 ft pieces, enter 4 as the stock length to get the count (10 pieces for 36.4 ft).

Checking the quantities on a contractor's estimate

Contractor estimates often list trim in linear feet, such as "baseboard 40 LF" or "crown 48 LF", and this formula lets you check them against the room perimeter. If a room with a net length of about 34.7 ft (44 ft minus 9.33 ft of openings) shows "baseboard 52 LF", that is a waste factor of about 50%, a good reason to ask why.
On the other hand, an exact "34.7 LF" may leave you short of material. A quantity with 5–10% waste is typical.

Working backward to see if leftover material is enough

If you have three 12 ft pieces of baseboard left from an earlier job, with a 5% waste factor they cover a net length of 3 × 12 ÷ 1.05 ≈ 34.29 ft. A room with a 44 ft perimeter minus a 40 in door (about 40.67 ft) is about 6.38 ft short, so you need to buy one more piece.
Enter the pieces you have to see the length they cover and the shortfall, which helps you decide what to buy.

Estimating from a floor plan in feet and inches

Even before you can measure, a floor plan gives a rough estimate. A bedroom marked 12' 6" × 10' 3" is 12.5 ft × 10.25 ft (divide the inches by 12), for a perimeter of 45.5 ft.
Plans often show dimensions to the center of the walls, so inside dimensions are a little smaller. Confirm the final quantities by measuring the room once you can.

Formulas and figures

Room perimeter (total wall length)
Figure
Standard notation (the usual math form)
\(P\) \(=\) \(2\) \(\times\) \((\) \(L\) \(+\) \(W\) \()\)
In words (symbols replaced with words)
③ \(P\): perimeter \(=\) \(2\) \(\times\) \((\) ① \(L\): room length \(+\) ② \(W\): room width \()\)
The formula in words
① Add the \(L\): room length
② and the \(W\): room width and double it (there are two walls of each length)
③ and you get the \(P\): perimeter
Quick example
The perimeter of a 12 × 10 ft bedroom is
perimeter \(P\) \(=\) \(2\) \(\times\) \((\) length (12 ft) \(+\) width (10 ft) \()\)
\(2 \times (12 + 10) = 2 \times 22 = 44\,\mathrm{ft}\)
Key idea
Baseboard and crown molding both run all the way around the room along the walls. So the starting point for the length you need is not the area but the distance around the room, the perimeter. As in the figure, opposite walls of a rectangular room are the same length, so adding the length and the width and doubling it gives the total of all four walls. Measure the inside dimensions (wall surface to wall surface). For an L-shaped room, a hallway or any shape that is not a rectangle, measure each wall, add them up and enter the total with "Perimeter entered directly". If you also want the wall and ceiling area, the wall, ceiling and floor area page is a good place to start.
Total width of openings (subtracted for baseboard only)
Standard notation (the usual math form)
\(D\) \(=\) \(\sum\) \((\) \(w_i\) \(\times\) \(n_i\) \()\)
In words (symbols replaced with words)
④ \(D\): total opening width \(=\) ③ \(\sum\) \((\) ① \(w_i\): opening width \(\times\) ② \(n_i\): number of that width \()\)
The formula in words
① Multiply each \(w_i\): opening width
② by the \(n_i\): number of that width to get the total for that kind,
③ add them up for every row you entered (\(\sum\) stands for "add them all up")
④ and you get the \(D\): total opening width
Quick example
In a room with one door (40 in including casing) and one patio door (72 in), the total width with no baseboard is
total opening width \(D\) \(=\) door width (40 in) \(\times\) count (1) \(+\) patio door width (72 in) \(\times\) count (1)
\(40 \times 1 + 72 \times 1 = 112\,\mathrm{in} = 112 \div 12 \approx 9.33\,\mathrm{ft}\)
Key idea
Baseboard runs along the bottom of the wall at the floor, so it does not go across openings that reach the floor, such as doors, sliding doors, patio doors and closet doors. The perimeter minus their widths is the net length that gets baseboard. The subscript \(i\) is the row number (row 1, row 2 …), and if you have two doors of the same width, enter 2 as \(n_i\) instead of using two rows. Widths are usually measured in inches, so convert to feet for the calculation (40 in ÷ 12 ≈ 3.33 ft). Subtract the width from the outside of the door casing to the outside of the casing, because the baseboard stops at the casing (about 40 in for a 36 in door). Windows above the floor are not subtracted. Crown molding runs where the wall meets the ceiling, and few openings reach the ceiling, so this calculator does not subtract openings for crown molding or transition strips. (If a tall door or a full-height closet door reaches the ceiling, enter the perimeter minus its width with "Perimeter entered directly".) Also subtract spots where kitchen cabinets or built-ins sit against the wall, since they get no baseboard either.
Corner allowance (extra for each miter cut)
Standard notation (the usual math form)
\(C\) \(=\) \(n_c\) \(\times\) \(c\)
In words (symbols replaced with words)
③ \(C\): corner allowance \(=\) ① \(n_c\): number of corners \(\times\) ② \(c\): allowance per corner
The formula in words
① Multiply the \(n_c\): number of inside and outside corners
② by the \(c\): allowance per corner
③ and you get the \(C\): corner allowance
Quick example
Adding 2 in for each of the 4 inside corners of a rectangular room gives
corner allowance \(C\) \(=\) corners (4) \(\times\) per corner (2 in)
\(4 \times 2 = 8\,\mathrm{in} = 8 \div 12 \approx 0.67\,\mathrm{ft}\)
Key idea
At the corners of a room, baseboard and crown molding are cut at 45° and joined (a miter cut; inside corners are often coped instead). At an outside corner (one that sticks out), the tip runs longer than the wall by the trim's thickness, and inside corners also tend to need recuts and fine adjustments. So some people estimate by adding a couple of inches per corner. In this calculator, leaving the number of corners blank adds nothing, and only the waste factor in the next formula covers the extra. If you enter both the corner allowance and a waste factor, the estimate grows by both.
Length needed (with waste)
Standard notation (the usual math form)
\(Q\) \(=\) \((\) \(P\) \(-\) \(D\) \(+\) \(C\) \()\) \(\times\) \((\) \(1\) \(+\) \(r\) \()\)
In words (symbols replaced with words)
⑤ \(Q\): length needed \(=\) \((\) ① \(P\): perimeter \(-\) ② \(D\): total opening width \(+\) ③ \(C\): corner allowance \()\) \(\times\) \((\) \(1\) \(+\) ④ \(r\): waste factor \()\)
The formula in words
① From the \(P\): perimeter
② subtract the \(D\): total opening width (for baseboard),
③ add the \(C\): corner allowance to get the net length,
④ then multiply by 1 + \(r\): waste factor
⑤ and you get the \(Q\): length needed
Quick example
For a room with a 44 ft perimeter and one door (40 in), with no corner allowance and a 5% (0.05) waste factor, the baseboard needed is
length needed \(Q\) \(=\) \((\) perimeter (44 ft) \(-\) door (40 in ≈ 3.33 ft) \()\) \(\times\) \((\) \(1\) \(+\) waste (0.05) \()\)
\((44 - 3.333) \times 1.05 = 40.667 \times 1.05 = 42.7\,\mathrm{ft}\)
Key idea
The exact net length is not enough material. Miter cuts at corners, joints, mistakes and cutting around dents or warped sections all use extra. This extra, as a share, is the waste factor \(r\). For long, narrow trim like baseboard and crown molding, 5–10% is common (less than for wallpaper or flooring, which you buy by area, but more for rooms with many corners and joints). Use it as "1 + waste factor": 1.05 times for 5%, 1.1 times for 10%. The waste factor is a share, so the extra grows with the perimeter. The corner allowance \(C\) in the previous formula is a fixed length, "a couple of inches per corner". Some people estimate with one of them and some add both. In this calculator, leave the number of corners blank to use the waste factor only.
Stock pieces and leftover
Figure
Standard notation (the usual math form)
\(N\) \(=\) \(\lceil\) \(Q\) \(\div\) \(S\) \(\rceil\)
\(R\) \(=\) \(N\) \(\times\) \(S\) \(-\) \(Q\)
In words (symbols replaced with words)
④ \(N\): stock pieces \(=\) \(\lceil\) ① \(Q\): length needed \(\div\) ② \(S\): stock length ③ \(\rceil\)
⑤ \(R\): leftover \(=\) \(N\): stock pieces \(\times\) \(S\): stock length \(-\) \(Q\): length needed
The formula in words
① Divide the \(Q\): length needed
② by the \(S\): stock length
③ and round up to a whole number if it does not divide evenly (\(\lceil\ \rceil\) stands for "round up")
④ to get the \(N\): stock pieces
⑤ The \(R\): leftover is "pieces × stock length" minus the length needed
Quick example
Covering 42.7 ft of baseboard with 12 ft stock takes
stock pieces \(N\) \(=\) \(\lceil\) length needed (42.7 ft) \(\div\) stock (12 ft) \(\rceil\)
\(42.7 \div 12 \approx 3.558 \ \rightarrow\ 4\)
\(R = 4 \times 12 - 42.7 = 5.3\,\mathrm{ft}\)
Key idea
The stock length is the fixed length a piece of trim is sold in. If the length needed ÷ stock length is 3.558 pieces, 3 pieces are not enough, so you buy 4. That is rounding up, the same idea as counting rolls, cans or bags. It helps to look at the value before rounding (3.558) too: it tells you whether you almost fit in 3 pieces or have plenty of room with 4. As in the figure, when you lay the stock pieces end to end, the part that runs past the length needed is the leftover \(R\). This count treats the whole length needed as one long piece divided by the stock length, so it is the smallest possible count. In real work you cut the stock wall by wall, so assigning pieces to each wall (next formula) can take more.
Pieces assigned wall by wall (the practical count with fewer seams)
Figure
Standard notation (the usual math form)
\(N_w\) \(=\) \(\sum\) \(\lceil\) \(\ell_i\) \(\div\) \(S\) \(\rceil\)
In words (symbols replaced with words)
④ \(N_w\): pieces wall by wall \(=\) ③ \(\sum\) \(\lceil\) ① \(\ell_i\): net length of wall \(i\) \(\div\) \(S\): stock length ② \(\rceil\)
The formula in words
① Divide the \(\ell_i\): net length of wall \(i\) (that wall's length minus any openings on it) by the stock length,
② round up for each wall (\(\lceil\ \rceil\) stands for "round up"),
③ add them up for all four walls (\(\sum\) stands for "add them all up")
④ and you get the \(N_w\): pieces wall by wall
Quick example
In a 12 × 10 ft room with a door (40 in) on one 12 ft wall, assigning 8 ft baseboard wall by wall takes
pieces wall by wall \(N_w\) \(=\) \(\lceil\) wall 1 (10 ft) \(\div\) 8 ft \(\rceil\) \(+\) \(\lceil\) wall 2 (12 − 3.33 = 8.67 ft) \(\div\) 8 ft \(\rceil\) \(+\) \(\cdots\)
\(\lceil 10 \div 8 \rceil + \lceil 8.67 \div 8 \rceil + \lceil 10 \div 8 \rceil + \lceil 12 \div 8 \rceil = 2 + 2 + 2 + 2 = 8\)
Key idea
The previous formula gives the smallest count, "length needed ÷ stock length". In real work, the trim is mitered and joined at each corner, so one piece cannot wrap around a corner. So in practice you count, wall by wall, how many stock pieces cover that wall, which also keeps seams in the middle of walls to a minimum. In the example above, length needed ÷ stock length is \((44 - 3.33) \times 1.05 \div 8 \approx 5.34\), so 6 pieces, but wall by wall it takes 8, two more. That is because each wall (10 ft and 8.67 ft) is just a little longer than the 8 ft stock and needs a second piece. With 12 ft stock, every wall fits in one piece: 4 pieces and no seams. In the wall-by-wall count, the extra at the end of each wall covers miter cuts and mistakes, so the waste factor and corner allowance are not applied. This calculator shows this count only when you enter the length × width. It places openings widest first on the wall with the most length left to find each wall's net length. If you know where the doors really are, work out each wall's length yourself and use the lumber cut list page to fit the pieces with saw kerf for an even more precise plan.
Estimated cost (price per piece or per foot)
Standard notation (the usual math form)
\(T\) \(=\) \(N\) \(\times\) \(p\)
\(T\) \(=\) \(Q\) \(\times\) \(p_m\)
In words (symbols replaced with words)
③ \(T\): estimated cost \(=\) ① \(N\): stock pieces \(\times\) ② \(p\): price per piece
\(T\): estimated cost \(=\) ④ \(Q\): length needed \(\times\) ⑤ \(p_m\): price per foot
The formula in words
① Multiply the \(N\): stock pieces
② by the \(p\): price per piece
③ and you get the \(T\): estimated cost If the trim is sold by length or in rolls and you only know the price per foot, multiply the
④ \(Q\): length needed
⑤ by the \(p_m\): price per foot
Quick example
If 12 ft baseboard costs $12.50 a piece, 4 pieces cost
estimated cost \(T\) \(=\) pieces (4) \(\times\) price ($12.50 per piece)
\(4 \times 12.50 = 50.00\)
Key idea
Wood and MDF baseboard and crown molding are usually priced per piece, so multiply the rounded-up piece count by the price. For trim priced per linear foot, such as vinyl cove base in rolls or molding cut to length, multiply the length needed (with waste) by the price per foot. Both are estimates for materials only and do not include corner blocks, adhesive, nails, caulk or labor. Prices vary a lot by store and product, so enter the actual price tag or catalog price. (In this calculator, "$/ft" appears when "Units" is US customary, and "$/m" when it is Metric.)
Length the pieces you have can cover (working backward)
Standard notation (the usual math form)
\(Q_h\) \(=\) \(n_h\) \(\times\) \(S\) \(\div\) \((\) \(1\) \(+\) \(r\) \()\)
In words (symbols replaced with words)
④ \(Q_h\): length covered \(=\) ① \(n_h\): pieces you have \(\times\) ② \(S\): stock length \(\div\) \((\) \(1\) \(+\) ③ \(r\): waste factor \()\)
The formula in words
① Multiply the \(n_h\): pieces you have
② by the \(S\): stock length to get the total length you have,
③ divide it by 1 + \(r\): waste factor
④ and you get the \(Q_h\): length covered
Quick example
With three 12 ft pieces of baseboard on hand and a 5% waste factor, the net length they cover is
length covered \(Q_h\) \(=\) pieces (3) \(\times\) stock (12 ft) \(\div\) \((\) \(1\) \(+\) waste (0.05) \()\)
\(3 \times 12 \div 1.05 = 36 \div 1.05 \approx 34.29\,\mathrm{ft}\)
Key idea
This works backward to answer "is my leftover baseboard enough for this room?". Run the length-needed formula (net length × (1 + waste factor) = length needed) in reverse: divide the total length you have by (1 + waste factor) to get the net length it can cover with waste allowed for (the equivalent of perimeter − openings + corner allowance). In the example above, 3 pieces cover a room whose perimeter minus openings is 34.29 ft or less. The calculator also shows the shortfall, "pieces needed − pieces you have".
Perimeter from feet-and-inches measurements
Standard notation (the usual math form)
\(L\) \(=\) \(L_{ft}\) \(+\) \(L_{in}\) \(\div\) \(12\)
\(W\) \(=\) \(W_{ft}\) \(+\) \(W_{in}\) \(\div\) \(12\)
\(P\) \(=\) \(2\) \(\times\) \(L\) \(+\) \(2 \times\) \(W\)
In words (symbols replaced with words)
③ \(L\): room length (ft) \(=\) ① \(L_{ft}\): the feet part \(+\) ② \(L_{in}\): the inches part \(\div\) \(12\)
⑤ \(W\): room width (ft) \(=\) \(W_{ft}\): the feet part \(+\) ④ \(W_{in}\): the inches part \(\div\) \(12\)
⑥ \(P\): perimeter \(=\) \(2\) \(\times\) \(L\): room length \(+\) \(2 \times\) \(W\): room width
The formula in words
① Take the \(L_{ft}\): feet part of the length
② and add the \(L_{in}\): inches part divided by 12 (12 inches in a foot)
③ to get the \(L\): room length in feet
④ Do the same with the \(W_{in}\): inches part of the width
⑤ to get the \(W\): room width in feet Then, as in the first formula, double the length and the width and add them to get the
⑥ \(P\): perimeter
Quick example
For a room measured as 12 ft 6 in × 10 ft 3 in, the perimeter is
perimeter \(P\) \(=\) \(2\) \(\times\) length (12 + 6 ÷ 12 = 12.5 ft) \(+\) \(2 \times\) width (10 + 3 ÷ 12 = 10.25 ft)
\(L = 12 + 6 \div 12 = 12.5\,\mathrm{ft},\quad W = 10 + 3 \div 12 = 10.25\,\mathrm{ft}\)
\(2 \times 12.5 + 2 \times 10.25 = 25 + 20.5 = 45.5\,\mathrm{ft}\)
Key idea
US floor plans and tape measures give lengths in feet and inches, such as 12' 6" (12 ft 6 in). The calculator takes feet as a decimal, so divide the inches by 12 and add them to the feet: 6 in is 0.5 ft and 3 in is 0.25 ft. Handy values: 1 in ≈ 0.083 ft, 3 in = 0.25 ft, 4 in ≈ 0.333 ft, 6 in = 0.5 ft, 9 in = 0.75 ft. Once the length and width are in feet, the perimeter works exactly as in the first formula. You can also enter opening widths in inches with the "Width unit" menu, and the calculator converts them to feet for you (40 in ≈ 3.33 ft).
For trim you buy by length, such as baseboard and crown molding, take the room perimeter (2 × (length + width)), subtract the width of openings that get no baseboard to get the net length, multiply by 1 + the waste factor (5–10% is common) to get the length needed, divide by the stock length and round up to get the pieces to buy. In practice, stock is assigned wall by wall to keep seams down, so check that count too (round up for each wall and add) and plan on the larger one.

Symbols and terms

Symbols

\(L\) ell The room length (ft), from "length". Use the inside dimensions (wall surface to wall surface).
\(W\) double-u The room width (ft), from "width". It does not matter which side you call the length and which the width.
\(P\) pee The room perimeter (ft), from "perimeter". For a rectangular room \(P = 2(L + W)\); for other shapes it is the total of the wall lengths.
\(w_i\) double-u sub i The width of the opening in row \(i\) (ft), from "width". The subscript \(i\) is the row number (row 1, row 2 …).
\(n_i\) en sub i The number of openings in row \(i\), from "number". It is 2 if you have two doors of the same width.
\(\sum\) sigma The Greek letter sigma (the Greek S), standing for "sum": add them all up. \(\sum (w_i \times n_i)\) is "width × count of each row, all added together".
\(D\) dee The total width of openings (ft), from "deduction". It is subtracted from the perimeter for baseboard, and taken as 0 for crown molding and transition strips.
\(n_c\) en sub cee The number of inside and outside corners: n for "number" with c for "corner". A rectangular room has 4 inside corners.
\(c\) cee The allowance per corner, from "corner". In the calculator you enter it in inches, and it is converted to feet (2 in ≈ 0.167 ft).
\(C\) capital cee The corner allowance (ft). \(C = n_c \times c\), the length added for the miter cuts at all the corners.
\(r\) ar The waste factor, from "rate". For 5%, \(r = 0.05\), and you multiply by \(1 + r = 1.05\).
\(Q\) cue The length needed (ft), from "quantity". \(Q = (P - D + C)(1 + r)\), the length to buy with waste allowed for.
\(S\) ess The stock length (ft), from "stock" - the length one piece of trim is sold in (8 ft, 12 ft, 16 ft and so on).
\(\lceil\ \rceil\) ceiling (round up) The ceiling function: round the number inside up to a whole number. \(\lceil 3.558 \rceil = 4\) and \(\lceil 3 \rceil = 3\). It stands for "if it does not divide evenly, buy one more piece".
\(N\) en The number of stock pieces needed, from "number". It is found with \(N = \lceil Q \div S \rceil\).
\(R\) capital ar The leftover (ft), from "remainder". \(R = N \times S - Q\), the total stock bought minus the length needed.
\(\ell_i\) script ell sub i The net length of wall \(i\) (walls 1 to 4, ft): that wall's length minus the openings on it. \(\ell\) is a cursive l for "length", used to tell it apart from the room length \(L\).
\(N_w\) en sub double-u The number of pieces when stock is assigned wall by wall. The subscript w stands for "wall". It is found with \(N_w = \sum \lceil \ell_i \div S \rceil\).
\(p\) pee The price of one stock piece ($ per piece), from "price".
\(p_m\) pee sub em The price per unit of length ($ per ft in US units; the m comes from "meter" in metric). Used for trim sold by length or in rolls.
\(T\) tee The estimated cost ($), from "total". It is found with \(T = N \times p\) or \(T = Q \times p_m\).
\(n_h\) en sub aitch The number of stock pieces you have: n for "number" with h for "have".
\(Q_h\) cue sub aitch The net length the pieces you have can cover (ft). It is found with \(Q_h = n_h \times S \div (1 + r)\).
\(L_{ft},\ W_{ft}\) ell sub f t, double-u sub f t The feet part of a length measured in feet and inches. For 12 ft 6 in, \(L_{ft} = 12\).
\(L_{in},\ W_{in}\) ell sub i n, double-u sub i n The inches part of a length measured in feet and inches. For 12 ft 6 in, \(L_{in} = 6\). Divide by 12 to change it to feet.
\(12\) twelve The number of inches in a foot (1 ft = 12 in). Dividing inches by 12 gives feet.
\(\mathrm{ft},\ \mathrm{in}\) feet, inches US units of length. Plans write them as 12' 6" (12 ft 6 in). 1 ft = 12 in = 0.3048 m.

Terms

Baseboard The long, narrow board along the bottom of the wall where it meets the floor (often about 3 to 5 in tall). It protects the wall from vacuum cleaners and feet and hides the gap at the edge of the flooring. It stops at doors and patio doors, so estimate it from "perimeter − opening widths".
Crown molding The trim where the wall meets the ceiling. It finishes the edges of the wall and ceiling surfaces and hides the gap between them. Openings rarely reach the ceiling, so the room perimeter is the starting point as is.
Transition strip A narrow strip where two floorings meet (such as hardwood and vinyl) or where a finish changes. Its length to cover is the starting point for the length needed.
Stock length The fixed length trim and lumber are sold in, such as 8, 12 or 16 ft. Divide the length needed by the stock length and round up to get the pieces to buy.
Perimeter The distance all the way around a shape. For a room it is the total length of the four walls, 2 × (length + width) for a rectangle.
Opening Any gap in a wall, such as a door, sliding door, patio door or closet door. This page subtracts the width of openings that reach the floor and get no baseboard.
Inside corner A corner where two walls meet and point into the room, like the four corners of a room. Baseboard and crown molding are mitered or coped and joined here.
Outside corner A corner that sticks out, like a column or the end of a wall. A mitered piece runs longer at the tip by the trim's thickness, and corner blocks are sometimes used instead.
Miter cut Cutting two pieces at 45° each so they meet at a corner. The cut-off ends and recuts after mistakes are part of the waste.
Waste factor The extra you need beyond the net length, as a share, for miter cuts, joints, mistakes and cutting around damaged sections. 5–10% is common for baseboard and crown molding.
Net length The length you actually need, with nothing extra. For baseboard it is the perimeter minus the width of the openings, where the baseboard really goes.
Rounding up Raising a value that does not divide evenly to the next whole number. You cannot buy 3.558 pieces of stock, so you round up to 4.
Seam (joint) The spot where two pieces are joined partway along a wall. It happens when one stock piece is shorter than the wall. To hide seams, cover each wall with one piece or put the seam where it shows less (a scarf joint is common).
Vinyl cove base Soft vinyl (or rubber) baseboard, sold in 4 ft pieces or 120 ft rolls and glued to the wall. In rolls you buy the length needed, not pieces, so use a price per foot.
Casing The trim around a door or window frame. Baseboard stops at the casing, so subtract the opening width from the outside of the casing to the outside of the casing.
MDF Medium-density fiberboard, a board made of pressed wood fibers. It is widely used for baseboard and crown molding, warps little and is sold in stock lengths like wood (often pre-primed).
Molding Decorative strips of trim for where walls meet the ceiling, chair height and so on. Crown molding is one kind; estimate it from the perimeter without subtracting openings.
Inside dimensions Measurements from wall surface to wall surface - the space you can actually use. Estimate baseboard, wallpaper and flooring with these. They are a little smaller than measurements to the center of the walls on some plans.
Patio door A large glass door that reaches the floor, often sliding (a sliding glass door), leading to a deck, patio or yard. It goes down to the floor, so it gets no baseboard and its width is subtracted. 6 ft (72 in) wide is standard.
Linear foot A length of 1 ft along the trim, no matter its height or width. Baseboard and trim estimates and prices are often given in linear feet (LF).

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.

Perimeter of a rectangle (Grade 3)
  • The perimeter of a rectangle is 2 × (length + width), since opposite sides are the same length
  • Perimeter (ft) and area (ft²) are different quantities, and trim you buy by length, like baseboard, uses the perimeter
Converting units of length (Grade 4)
  • 1 ft = 12 in, so 6 in is 0.5 ft and 40 in is about 3.33 ft
Percents (Grade 6)
  • 5% is 0.05, and "5% more" is "1.05 times"
  • Going backward from "\(x\) times 1.05 is \(y\)" gives "\(y \div 1.05 = x\)"
Rounding up (Grade 4)
  • Why a value like 3.558 is rounded up to the next whole number, 4 (you buy pieces and boxes by rounding up)
Multiplying and dividing decimals (Grades 5–6)
  • What calculations like \(40.667 \times 1.05\) and \(42.7 \div 12\) stand for (a calculator is fine for the arithmetic)
Subtracting the parts you do not cover (Grades 2–3)
  • Subtracting the parts you do not use, such as door widths, from the total length to find only what you need

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the room perimeter
Room length (ft) 12
Room width (ft) 10
Perimeter (ft) =2*(B1+B2)
Table to find the total opening width
Opening 1 width (in) 40
Opening 1 count 1
Opening 2 width (in) 72
Opening 2 count 1
Total opening width (ft) =(B1*B2+B3*B4)/12
Table to find the corner allowance
Number of corners 4
Allowance per corner (in) 2
Corner allowance (ft) =B1*B2/12
Table to find the length needed (with waste)
Perimeter (ft) 44
Total opening width (ft) =40/12
Corner allowance (ft) 0
Waste factor (%) 5
Length needed (ft) =(B1-B2+B3)*(1+B4/100)
Table to find the stock pieces and leftover
Length needed (ft) 42.7
Stock length (ft) 12
Stock pieces (before rounding up) =B1/B2
Stock pieces =ROUNDUP(B1/B2,0)
Leftover (ft) =B4*B2-B1
Table to find the pieces assigned wall by wall
Wall 1 net length (ft) 10
Wall 2 net length (ft) =12-40/12
Wall 3 net length (ft) 10
Wall 4 net length (ft) 12
Stock length (ft) 8
Pieces wall by wall =ROUNDUP(B1/B5,0)+ROUNDUP(B2/B5,0)+ROUNDUP(B3/B5,0)+ROUNDUP(B4/B5,0)
Table to find the estimated cost
Stock pieces 4
Price per piece ($) 12.50
Estimated cost ($) =B1*B2
Table to find the length the pieces you have can cover
Pieces you have 3
Stock length (ft) 12
Waste factor (%) 5
Length covered (ft) =B1*B2/(1+B3/100)
Table to find the perimeter from feet and inches
Length, feet part 12
Length, inches part 6
Width, feet part 10
Width, inches part 3
Room length (ft) =B1+B2/12
Room width (ft) =B3+B4/12
Perimeter (ft) =2*B5+2*B6
After pasting, the upper rows of column B are the inputs and the last rows are calculated automatically.
The first table gives a perimeter of 44 ft. The second gives a total opening width of about 9.3333 ft (door 40 in + patio door 72 in; for more kinds, add width and count rows and extend the formula, such as "+B5*B6"). The third gives a corner allowance of about 0.6667 ft.
The fourth table gives a length needed of 42.7 ft (perimeter 44 ft − door 40 in, no corner allowance, 5% waste). The fifth uses ROUNDUP to give 4 pieces and 5.3 ft leftover, with 3.5583 before rounding up in B3.
The sixth is the wall-by-wall count: 2 + 2 + 2 + 2 = 8 pieces in the example. The seventh gives a cost of $50.00, the eighth a length of about 34.2857 ft covered by 3 pieces, and the ninth turns 12 ft 6 in × 10 ft 3 in into 12.5 ft × 10.25 ft with a perimeter of 45.5 ft.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the room perimeter
Room length (ft) 12
Room width (ft) 10
Perimeter (ft) =2*(B1+B2)
Table to find the total opening width
Opening 1 width (in) 40
Opening 1 count 1
Opening 2 width (in) 72
Opening 2 count 1
Total opening width (ft) =(B1*B2+B3*B4)/12
Table to find the corner allowance
Number of corners 4
Allowance per corner (in) 2
Corner allowance (ft) =B1*B2/12
Table to find the length needed (with waste)
Perimeter (ft) 44
Total opening width (ft) =40/12
Corner allowance (ft) 0
Waste factor (%) 5
Length needed (ft) =(B1-B2+B3)*(1+B4/100)
Table to find the stock pieces and leftover
Length needed (ft) 42.7
Stock length (ft) 12
Stock pieces (before rounding up) =B1/B2
Stock pieces =ROUNDUP(B1/B2,0)
Leftover (ft) =B4*B2-B1
Table to find the pieces assigned wall by wall
Wall 1 net length (ft) 10
Wall 2 net length (ft) =12-40/12
Wall 3 net length (ft) 10
Wall 4 net length (ft) 12
Stock length (ft) 8
Pieces wall by wall =ROUNDUP(B1/B5,0)+ROUNDUP(B2/B5,0)+ROUNDUP(B3/B5,0)+ROUNDUP(B4/B5,0)
Table to find the estimated cost
Stock pieces 4
Price per piece ($) 12.50
Estimated cost ($) =B1*B2
Table to find the length the pieces you have can cover
Pieces you have 3
Stock length (ft) 12
Waste factor (%) 5
Length covered (ft) =B1*B2/(1+B3/100)
Table to find the perimeter from feet and inches
Length, feet part 12
Length, inches part 6
Width, feet part 10
Width, inches part 3
Room length (ft) =B1+B2/12
Room width (ft) =B3+B4/12
Perimeter (ft) =2*B5+2*B6
The same formulas as Excel (basic arithmetic and ROUNDUP) work as is. Copy the whole table, paste it into cell A1 and change column B to your own numbers. ROUNDUP(value, 0) rounds up to a whole number.

How to calculate it in Python

import math

room_length_ft = 12      # room length (ft)
room_width_ft = 10       # room width (ft)
# Openings with no baseboard as (width in inches, count). Use an empty list [] for crown molding or trim
openings = [
    (40, 1),             # door (including casing)
    (72, 1),             # patio door
]
stock_length_ft = 8      # stock length (ft)
loss_rate = 0.05         # waste factor (5% -> 0.05)
corner_count = 0         # number of inside and outside corners (0 to add nothing)
corner_allow_in = 2      # allowance per corner (in)
price_per_piece = 9.25   # price of one stock piece ($). None if unknown
have_count = 3           # pieces you have. None if none

perimeter = 2 * (room_length_ft + room_width_ft)                        # perimeter (ft)
opening_total = sum(w * n for (w, n) in openings) / 12                  # total opening width (ft)
corner_add = corner_count * corner_allow_in / 12                        # corner allowance (ft)
required = (perimeter - opening_total + corner_add) * (1 + loss_rate)   # length needed (ft)
pieces_raw = required / stock_length_ft                                 # pieces before rounding up
pieces = math.ceil(pieces_raw)                                          # stock pieces
leftover = pieces * stock_length_ft - required                          # leftover (ft)

print(f"Perimeter: {perimeter:.4g} ft")
print(f"Total opening width: {opening_total:.4g} ft")
print(f"Length needed (with waste): {required:.5g} ft")
print(f"Stock pieces: {pieces_raw:.4f} -> {pieces}, leftover {leftover:.4g} ft")
if price_per_piece is not None:
    print(f"Estimated cost: ${pieces * price_per_piece:,.2f}")
if have_count is not None:
    coverable = have_count * stock_length_ft / (1 + loss_rate)          # length the pieces cover (ft)
    print(f"{have_count} pieces cover: {coverable:.4g} ft, short by {max(0, pieces - have_count)}")

# Pieces assigned wall by wall (openings placed widest first on the wall with the most length left)
walls = [room_width_ft, room_length_ft, room_width_ft, room_length_ft]   # walls 1 to 4
for (w, n) in sorted(openings, reverse=True):
    for _ in range(n):
        idx = walls.index(max(walls))
        walls[idx] -= w / 12
wall_pieces = sum(math.ceil(l / stock_length_ft) for l in walls)
print(f"Net length of each wall: {[round(l, 4) for l in walls]} -> {wall_pieces} pieces wall by wall")
It runs with the standard library only (math.ceil rounds up). Add (width, count) pairs to the openings list for any number of kinds, or use an empty list for trim that subtracts nothing, like crown molding. If you measured the perimeter directly, change it to something like perimeter = 46.5, and for the wall-by-wall count set the walls list to your own wall lengths. Change the sizes at the top to your own numbers and run it.

How to write it in LaTeX and other math languages (copy and paste)

Room perimeter (total wall length)
P = 2 × (L + W)
P = 2(L + W)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>P</mi>
    <mo>=</mo>
    <mn>2</mn>
    <mo>&#x2062;</mo>
    <mrow><mo>(</mo><mi>L</mi><mo>+</mo><mi>W</mi><mo>)</mo></mrow>
  </mrow>
</math>
P = 2(L + W)
2*(L + W)
P := 2*(L + W);
P = 2*(L + W);
P = 2(L + W)
Total width of openings (subtracted for baseboard only)
D = Σ (wᵢ × nᵢ)
D = \sum_{i} \left( w_i \times n_i \right)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>D</mi>
    <mo>=</mo>
    <munder><mo>&#x2211;</mo><mi>i</mi></munder>
    <mrow>
      <mo>(</mo>
      <msub><mi>w</mi><mi>i</mi></msub>
      <mo>&#xD7;</mo>
      <msub><mi>n</mi><mi>i</mi></msub>
      <mo>)</mo>
    </mrow>
  </mrow>
</math>
D = sum_i (w_i xx n_i)
Dopen = Total[w*n]
Dopen := add(w[i]*n[i], i = 1 .. k);
D = sum(w .* n);
D = ∑_i (w_i × n_i)
Corner allowance (extra for each miter cut)
C = n_c × c
C = n_c \times c
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>C</mi>
    <mo>=</mo>
    <msub><mi>n</mi><mi>c</mi></msub>
    <mo>&#xD7;</mo>
    <mi>c</mi>
  </mrow>
</math>
C = n_c xx c
Ccorner = nc*c
C := nc*c;
C = nc*c;
C = n_c × c
Length needed (with waste)
Q = (P − D + C) × (1 + r)
Q = (P - D + C)(1 + r)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>Q</mi>
    <mo>=</mo>
    <mrow><mo>(</mo><mi>P</mi><mo>&#x2212;</mo><mi>D</mi><mo>+</mo><mi>C</mi><mo>)</mo></mrow>
    <mo>&#x2062;</mo>
    <mrow><mo>(</mo><mn>1</mn><mo>+</mo><mi>r</mi><mo>)</mo></mrow>
  </mrow>
</math>
Q = (P - D + C)(1 + r)
Q = (P - Dopen + Ccorner)*(1 + r)
Q := (P - Dopen + C)*(1 + r);
Q = (P - D + C)*(1 + r);
Q = (P − D + C)(1 + r)
Stock pieces and leftover
N = ⌈Q ÷ S⌉,  R = N × S − Q
N = \left\lceil \frac{Q}{S} \right\rceil,\quad R = N S - Q
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <mo>&#x2308;</mo>
    <mfrac><mi>Q</mi><mi>S</mi></mfrac>
    <mo>&#x2309;</mo>
    <mo>,</mo>
    <mi>R</mi>
    <mo>=</mo>
    <mi>N</mi><mo>&#x2062;</mo><mi>S</mi>
    <mo>&#x2212;</mo>
    <mi>Q</mi>
  </mrow>
</math>
N = |~ Q / S ~|,  R = N S - Q
Npieces = Ceiling[Q/S]; R = Npieces*S - Q
N := ceil(Q/S);  R := N*S - Q;
N = ceil(Q/S); R = N*S - Q;
N = ⌈Q/S⌉, R = NS − Q
Pieces assigned wall by wall (the practical count with fewer seams)
N_w = Σ ⌈ℓᵢ ÷ S⌉
N_w = \sum_{i=1}^{4} \left\lceil \frac{\ell_i}{S} \right\rceil
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>N</mi><mi>w</mi></msub>
    <mo>=</mo>
    <munderover><mo>&#x2211;</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mn>4</mn></munderover>
    <mo>&#x2308;</mo>
    <mfrac><msub><mi>&#x2113;</mi><mi>i</mi></msub><mi>S</mi></mfrac>
    <mo>&#x2309;</mo>
  </mrow>
</math>
N_w = sum_(i=1)^4 |~ l_i / S ~|
Nw = Total[Ceiling[l/S]]
Nw := add(ceil(l[i]/S), i = 1 .. 4);
Nw = sum(ceil(l ./ S));
N_w = ∑_(i=1)^4 ⌈ℓ_i/S⌉
Estimated cost (price per piece or per foot)
T = N × p  or  T = Q × p_m
T = N \times p \quad\text{or}\quad T = Q \times p_m
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>T</mi><mo>=</mo><mi>N</mi><mo>&#xD7;</mo><mi>p</mi>
    <mtext>&#x2003;or&#x2003;</mtext>
    <mi>T</mi><mo>=</mo><mi>Q</mi><mo>&#xD7;</mo><msub><mi>p</mi><mi>m</mi></msub>
  </mrow>
</math>
T = N xx p  or  T = Q xx p_m
T = Npieces*p  (* or T = Q*pm *)
T := N*p;  # or T := Q*pm;
T = N*p;  % or T = Q*pm;
T = N × p  or  T = Q × p_m
Length the pieces you have can cover (working backward)
Q_h = n_h × S ÷ (1 + r)
Q_h = \dfrac{n_h S}{1 + r}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <msub><mi>Q</mi><mi>h</mi></msub>
    <mo>=</mo>
    <mfrac>
      <mrow><msub><mi>n</mi><mi>h</mi></msub><mo>&#x2062;</mo><mi>S</mi></mrow>
      <mrow><mn>1</mn><mo>+</mo><mi>r</mi></mrow>
    </mfrac>
  </mrow>
</math>
Q_h = (n_h S) / (1 + r)
Qh = nh*S/(1 + r)
Qh := nh*S/(1 + r);
Qh = nh*S/(1 + r);
Q_h = (n_h S)/(1 + r)
Perimeter from feet-and-inches measurements
L = L_ft + L_in ÷ 12,  W = W_ft + W_in ÷ 12,  P = 2L + 2W
L = L_{ft} + \frac{L_{in}}{12},\quad W = W_{ft} + \frac{W_{in}}{12},\quad P = 2L + 2W
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>L</mi><mo>=</mo><msub><mi>L</mi><mi>ft</mi></msub><mo>+</mo><mfrac><msub><mi>L</mi><mi>in</mi></msub><mn>12</mn></mfrac>
    <mo>,</mo>
    <mi>W</mi><mo>=</mo><msub><mi>W</mi><mi>ft</mi></msub><mo>+</mo><mfrac><msub><mi>W</mi><mi>in</mi></msub><mn>12</mn></mfrac>
    <mo>,</mo>
    <mi>P</mi><mo>=</mo><mn>2</mn><mi>L</mi><mo>+</mo><mn>2</mn><mi>W</mi>
  </mrow>
</math>
L = L_(ft) + L_(in)/12,  W = W_(ft) + W_(in)/12,  P = 2L + 2W
L = Lft + Lin/12; W = Wft + Win/12; P = 2*L + 2*W
L := Lft + Lin/12;  W := Wft + Win/12;  P := 2*L + 2*W;
L = Lft + Lin/12; W = Wft + Win/12; P = 2*L + 2*W;
L = L_ft + L_in/12, W = W_ft + W_in/12, P = 2L + 2W

How to have ChatGPT  do the calculation

You are an assistant for interior trim quantity calculations. Do the calculations below by actually running Python code, and base your answer only on the numbers from the output (do not calculate in your head or guess).

I am installing baseboard in a rectangular room 12 ft long and 10 ft wide. There is one door (40 in wide including casing) and one patio door (72 in wide), and no baseboard goes under them. The stock length is 8 ft, the waste factor is 5%, and one stock piece costs $9.25.
Find each of the following.
1. The room perimeter (ft)
2. The total opening width (ft) and the net length that gets baseboard (ft)
3. The length needed with waste (ft)
4. The number of stock pieces needed (the value before rounding up and the rounded-up count) and the leftover (ft)
5. The estimated cost ($)
6. The number of pieces when stock is assigned wall by wall (place openings widest first on the wall with the most length left; round up each wall's net length ÷ stock length and add them)

Show the formulas you used and the numbers from the output.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.