I built a free roof pitch and rafter calculator that runs in your browser
Most online roof pitch calculators feel like they were built in 2008. You type in two numbers, get a single ratio back, and have to open three other pages just to find the rafter length, slope multiplier, or whether shin
Most online roof pitch calculators feel like they were built in 2008. You type in two numbers, get a single ratio back, and have to open three other pages just to find the rafter length, slope multiplier, or whether shingles are even allowed on that pitch.
I wanted something faster and cleaner for basic framing and estimating checks, so I built RoofPitchHub. It is free and needs no sign-up.
What it does
You enter vertical rise and horizontal run (in ft, ft + in, in, m, or cm), and it updates everything on one screen:
- Roof pitch (
X:12), slope angle in degrees, and slope percentage - Common rafter length and roof area pitch multiplier
- A live SVG gable cross-section that redraws as you change the slope
- Quick material compatibility notes based on 2021/2024 IRC R905 minimums (asphalt shingles, standing seam metal, lapped metal with/without lap sealant, low-slope membranes) and OSHA 1926.500(b) slope classes
For example, a 6 ft rise over a 12 ft run gives 6:12, 26.57°, 50% slope, 13.42 ft (13' 5") rafter line length, and a 1.1180x area multiplier.
There are also a few focused pages around the main tool: a 1:12 to 24:12 roof pitch chart with reverse angle/percent lookup, a rafter calculator with eave overhang tails, roof square footage, metal roof cost, and a truss spacing estimator.
What it is not
It is a framing and estimating reference, not structural engineering software. It does not calculate snow loads, wind uplift, rafter span sizing, or local code amendments. If a project needs stamped drawings or permit sign-off, you still need a licensed engineer or your local building department.
The tech, briefly
It runs on TanStack Start and React, deployed to Cloudflare Workers. There is no database or user auth. All calculations happen client-side in TypeScript, and the roof diagrams are plain inline SVG.
One small bug that caught me off guard: JavaScript floating-point math breaks exact building code cutoffs when users switch units. Converting 0.5 in rise to meters and back gave 0.49999999999999994, which silently failed the >= 0.5:12 metal roof check. Keeping the internal state in exact unrounded inches separately from the text inputs (plus a 1e-9 epsilon on threshold checks) fixed it cleanly.
Try it
It is live at roofpitchhub.com.
If you do roofing or carpentry and spot a framing edge case or unit quirk I missed, let me know in the comments.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes ā full credit and traffic to the original publisher.