Construction calculation utilities for building projects — measurements, materials, lumber, drywall, paint, roofing, slope, and cost estimation helpers.
Part of the www.slabcalc.co ecosystem. For concrete-specific calculations, see the concrete-calculator package or the online Concrete Slab Calculator.
npm install construction-utils
import { squareFootage, drywallSheets, paintGallons, addMarkup } from "construction-utils";
const area = squareFootage(20, 15); // 300 sq ft
const sheets = drywallSheets(area); // 11 sheets (10% waste)
const gallons = paintGallons(area, 2); // 2 gallons (2 coats)
const price = addMarkup(sheets * 12, 15); // $151.80 (15% markup)
| Function |
Description |
squareFootage(length, width) |
Area in sq ft |
perimeter(length, width) |
Perimeter in linear ft |
circleArea(diameter) |
Area of a circle |
triangleArea(base, height) |
Area of a triangle |
roofArea(length, width, pitchRise?) |
Roof area adjusted for pitch |
| Function |
Description |
gradePercent(rise, run) |
Slope as percentage |
roofPitch(rise, run?) |
Pitch string (e.g., "6:12") |
angleFromSlope(percent) |
Degrees from slope % |
slopeFromAngle(degrees) |
Slope % from degrees |
hypotenuse(rise, run) |
Rafter/stringer length |
| Function |
Description |
boardFeet(thickness, width, length) |
Board feet for pricing |
studsNeeded(wallLength, spacing?) |
Stud count (default 16″ OC) |
plateLength(wallLength, double?) |
Linear ft of plates |
| Function |
Description |
drywallSheets(sqft, waste?) |
4×8 sheets needed (default 10% waste) |
jointCompound(sqft) |
Gallons of mud |
drywallTape(sqft) |
Feet of tape |
| Function |
Description |
paintGallons(sqft, coats?, coverage?) |
Gallons needed (default 400 sqft/gal) |
primerGallons(sqft, coverage?) |
Primer gallons (default 300 sqft/gal) |
| Function |
Description |
flooringSqft(length, width, waste?) |
Material sq ft with waste factor |
tileBoxes(sqft, sqftPerBox?) |
Number of tile boxes |
| Function |
Description |
insulationBatts(sqft, sqftPerBundle?) |
Batt bundles needed |
| Function |
Description |
feetToMeters(ft) / metersToFeet(m) |
Length conversion |
inchesToCm(in) / cmToInches(cm) |
Length conversion |
sqftToSqm(sqft) / sqmToSqft(sqm) |
Area conversion |
psfToKpa(psf) / kpaToPsf(kpa) |
Pressure conversion |
| Function |
Description |
addMarkup(cost, percent) |
Apply markup |
tax(subtotal, percent) |
Tax amount |
totalWithTax(subtotal, percent) |
Subtotal + tax |
unitCost(total, qty) |
Per-unit cost |
bulkDiscount(qty, tiers, unitPrice) |
Tiered bulk pricing |
Group functions by category:
import { measurements, lumber, drywall, paint, pricing } from "construction-utils";
const area = measurements.squareFootage(20, 15);
const bf = lumber.boardFeet(2, 6, 8); // 8 board feet
const sheets = drywall.drywallSheets(area);
const gallons = paint.paintGallons(area, 2);
const total = pricing.totalWithTax(500, 8.25); // $541.25
| Project |
Functions to use |
| Frame a wall |
studsNeeded(), plateLength(), boardFeet() |
| Hang drywall |
drywallSheets(), jointCompound(), drywallTape() |
| Paint a room |
squareFootage(), paintGallons(), primerGallons() |
| Install flooring |
flooringSqft(), tileBoxes() |
| Estimate roof |
roofArea(), roofPitch(), hypotenuse() |
| Grade a driveway |
gradePercent(), angleFromSlope() |
| Bid a job |
addMarkup(), totalWithTax(), bulkDiscount() |
For concrete work — slabs, footings, cylinders, stairs — use the Concrete Slab Calculator or the concrete-calculator npm package.
Full type declarations included — zero config needed.
import { boardFeet, type BulkDiscountResult } from "construction-utils";
MIT — SlabCalc.co