Slope and roof pitch are the same rise-over-run idea applied at different scales. The slope calculator finds the slope of a line through two coordinate points — a rate of change that can be velocity, dollars per item, or a grade. The roof pitch calculator converts measured roof rise and run among pitch ratio, slope percentage, and angle. If you have coordinate points, use the slope calculator; if you have roof dimensions, use the roof pitch calculator.
What each calculator does
The slope calculator takes x1, y1, x2, and y2 and computes the rise (y2 − y1) and run (x2 − x1), then divides rise by run and displays the slope to four decimal places. Its checked example, (0, 0) to (4, 2), gives rise 2, run 4, and slope 0.5000 — interpreted as y increasing by one-half unit for each unit of x. A negative example, (1, 7) to (4, 1), gives rise −6 and slope −2, meaning the line falls as x increases. The calculator requires a nonzero run: equal x coordinates make the denominator zero and the vertical-line case is marked invalid instead of dividing by zero. Slope carries units when the axes do, such as meters per second or dollars per item.
The roof pitch calculator converts among three measurements: rise and run, an angle, or a slope percentage. From rise and run it derives the angle as the arctangent of rise divided by run, the slope percentage as 100 times rise divided by run, and a normalized pitch ratio in the x-in-12 form — its checked example of 6 over 12 yields the ratio 6:12, a 26.57° angle, and a 50.0% slope. Calculations retain full floating-point precision until the labeled display step, and a minimum rise of 0.1 applies in rise/run mode.
Side-by-side
| Slope calculator | Roof pitch calculator | |
|---|---|---|
| Question answered | What is the slope of the line through two points? | What are the pitch ratio, slope percentage, and angle for a roof? |
| Inputs | Two coordinate points (x1, y1, x2, y2) | Rise and run, or angle, or slope percentage |
| Core formula | slope = (y2 − y1) ÷ (x2 − x1) | angle = arctan(rise ÷ run); slope % = 100 × rise ÷ run; pitch = rise normalized to 12-inch run |
| Outputs | Rise, run, decimal slope (4 decimals) | Pitch ratio X:12, angle, slope percentage |
| Boundary cases | Vertical line (run = 0) marked invalid | Minimum rise 0.1; geometry only, no covering or safety verdicts |
| Typical use | Algebra, physics graphs, grades, cost lines | Roof measurements, material takeoff input |
When to use which
Use the slope calculator when the question is about a line or a rate of change: a position-versus-time graph where slope is velocity, a cost line in dollars per unit, a grade such as 6 feet of rise over 100 feet of run (slope 0.06, a 6 percent grade), or classroom algebra. Its interpretation section covers positive, negative, zero, and undefined slopes, and it pairs with the angle converter when you need degrees and radians.
Use the roof pitch calculator when the measurement is a roof: you have rise and run from the framing, an angle from a level app, or a slope percentage, and you want the other forms. The page positions the pitch as a direct input to a roof material takeoff alongside the roofing calculator, and notes the same rise-and-run geometry applies to the stair calculator.
Limits and disclaimer
The slope calculator’s only forbidden geometric case is equal x coordinates, and it cautions that very small runs can produce very large slopes, that inconsistent subtraction order changes the sign, and that a resized graph can make a line look steeper than its numeric slope. It also reminds users that slope describes change while the y-intercept describes where the line crosses the y-axis. The roof pitch calculator is geometry only: it does not determine roof-covering suitability, drainage design, structural capacity, access safety, or code compliance, and the page recommends keeping input precision consistent with the measurements you have. Neither tool should replace a qualified trade or adopted code for safety-critical work.