Slope Calculator
Use this free slope calculator to find the slope between two points or from a rise and run. It instantly shows the slope m, the grade percentage, the angle in degrees, the line equation y = mx + b, and the distance between the two points — with vertical and horizontal lines handled cleanly.
Enter your numbers
Choose what you know — the calculator switches inputs automatically. Results update as you type.
Your results
How to use this calculator
Pick the input mode that matches what you have. Two points is the classic algebra case: type in the coordinates (x₁, y₁) and (x₂, y₂) and the calculator works out the slope and everything that follows from it. Rise & run is for when you already know the vertical and horizontal change — for example a roof that climbs 3 units over 4 units of horizontal distance.
Every output recalculates the moment you type, so feel free to experiment — drag a value up or down and watch the angle and grade change. The result panel always shows the exact substitution used (for example (5 − 2) ÷ (5 − 1) = 0.75), so nothing is a black box.
If the two points form a vertical line (same x-coordinate), the slope is undefined and the calculator says so plainly instead of dividing by zero — it still shows the equation x = constant and the distance between the points. A slope of exactly zero simply means a perfectly horizontal line.
How it works
The slope of a line measures steepness as vertical change over horizontal change. Between two points it is m = (y₂ − y₁) ÷ (x₂ − x₁): the numerator is the rise (how far the line climbs), the denominator is the run (how far it travels horizontally). A positive slope rises left to right, a negative slope falls, zero is flat, and a vertical line has no slope at all.
From the slope, three more views follow. The grade is the slope as a percentage — grade % = m × 100 — the form used on road signs and roof-pitch charts (a 45° pitch is a 100% grade). The angle is the line's tilt from horizontal, θ = atan(m), computed in radians and converted to degrees. And the line equation uses slope–intercept form: with b = y₁ − m × x₁ the line is y = mx + b — for (1, 2) and (5, 5), m = 0.75 and b = 2 − 0.75 × 1 = 1.25, so y = 0.75x + 1.25.
As a bonus, the calculator also reports the distance between the two points — the length of the line segment joining them — using the distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²), a direct application of the Pythagorean theorem. For (1, 2) and (5, 5): √(4² + 3²) = √25 = 5.
These are exact mathematical results, not estimates. Angles are in degrees; the grade is unit-free. In rise & run mode the line equation and distance are measured from the origin (0, 0) to the point (run, rise), since a single rise/run defines a direction, not a position.
Frequently asked questions
How do you find the slope between two points?
Use the slope formula m = (y2 - y1) / (x2 - x1): subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide. For points (1, 2) and (5, 5), the rise is 5 - 2 = 3, the run is 5 - 1 = 4, so the slope is 3 / 4 = 0.75. This calculator does the division and every follow-up calculation for you.
What is slope as a percentage (grade)?
Grade percent is the slope multiplied by 100. A slope of 0.75 is a 75% grade, meaning you climb 75 units vertically for every 100 units you move horizontally. Road grades work this way: a 10% grade is steep for a highway but ordinary for a hiking trail.
What does an undefined slope mean?
An undefined slope means the line is vertical: the two points have the same x-coordinate, so the run (x2 - x1) is zero and you'd be dividing by zero, which is not allowed. A vertical line has no grade, no angle, and no y = mx + b equation — but it still has an equation, x = a constant. A slope of exactly zero, by contrast, means a perfectly horizontal line.
How do you get the line equation y = mx + b from two points?
First find the slope m with m = (y2 - y1) / (x2 - x1). Then solve for the y-intercept b by plugging one point in: b = y1 - m * x1. For (1, 2) and (5, 5), m = 0.75 and b = 2 - 0.75 * 1 = 1.25, giving y = 0.75x + 1.25.
What is the angle of a slope in degrees?
The angle a line makes with the horizontal is the arctangent of the slope: angle = atan(m), converted from radians to degrees. A slope of 0.75 gives atan(0.75) ≈ 36.87°. A 45° angle means a slope of exactly 1 (a 100% grade), and a 90° line is vertical with an undefined slope.