Slope Calculator
Find the slope of the line through two points. Enter P1(x1, y1) and P2(x2, y2) to get the slope, the line equation in three forms, the angle, both intercepts, and the parallel and perpendicular slopes — with every step shown.
slope = (y2 − y1) ÷ (x2 − x1) — rise divided by run.
Example: through (2, 3) and (6, 11): (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2
📈 Find the Slope
📝 How to Use the Slope Calculator
1. Enter the two points
Type the x and y coordinates of P1 and P2. Decimals and negative numbers are fine — for example, P1(−4, 1) and P2(2, −5).
2. Read the full answer
The slope appears instantly as you type, or press Calculate. Below it you'll find the line equation in slope-intercept, point-slope and standard form, the angle of inclination, both intercepts, and the slopes of parallel and perpendicular lines.
3. Check the steps
Each result lists the working with your own numbers, so you can reproduce it by hand or spot a typing mistake.
📐 Slope Formula
The slope m of the line through P1(x1, y1) and P2(x2, y2) is the vertical change divided by the horizontal change:
The top of the fraction — how far y moves — is called the rise. The bottom — how far x moves — is the run. A positive slope climbs left to right; a negative slope falls. The steeper the line, the larger the slope's absolute value.
🔢 Slope Worked Examples
Example 1 — Positive slope: (2, 3) and (6, 11)
Step 1. Label the points: (x1, y1) = (2, 3), (x2, y2) = (6, 11).
Step 2. Rise = 11 − 3 = 8. Run = 6 − 2 = 4.
Step 3. m = 8 ÷ 4 = 2.
Step 4. Equation: y − 3 = 2(x − 2), or y = 2x − 1. Check: 2(6) − 1 = 11 ✓
Example 2 — Negative slope: (−4, 1) and (2, −5)
Step 1. (x1, y1) = (−4, 1), (x2, y2) = (2, −5).
Step 2. Rise = −5 − 1 = −6. Run = 2 − (−4) = 6.
Step 3. m = −6 ÷ 6 = −1.
Step 4. Equation: y = −x − 3. Check: −(−4) − 3 = 1 ✓ and −(2) − 3 = −5 ✓
Example 3 — Decimals: (1.5, 2) and (4.5, 8)
Step 1. (x1, y1) = (1.5, 2), (x2, y2) = (4.5, 8).
Step 2. Rise = 8 − 2 = 6. Run = 4.5 − 1.5 = 3.
Step 3. m = 6 ÷ 3 = 2.
Step 4. Equation: y = 2x − 1. Check: 2(1.5) − 1 = 2 ✓
💡 What Is Slope?
Slope measures how steep a line is — how much y changes for each unit x moves. A slope of 2 means y rises 2 for every 1 step right; a slope of −0.5 means y falls half a unit per step. Slope shows up anywhere a rate of change matters: speed (distance over time), price per item, the pitch of a roof, or the grade of a road.
Two points are all it takes to pin down a straight line's slope, because a straight line has the same steepness everywhere. That's why the formula works no matter which two points on the line you pick.
➖ Zero Slope vs. Undefined Slope
Slope = 0: a horizontal line
If both points have the same y — say (1, 4) and (5, 4) — the rise is 0, so m = 0 ÷ 4 = 0. The line is flat: y = 4 everywhere. Its angle is 0°, and it crosses the y-axis at 4.
Undefined slope: a vertical line
If both points have the same x — say (3, 1) and (3, 7) — the run is 0, so the formula asks for 6 ÷ 0. Division by zero has no meaning, so the slope is undefined — not zero, not infinite, simply not a number. The line's equation is x = 3, its angle is 90°, and it never crosses the y-axis. This calculator says so plainly instead of showing an error or a fake value.
📐 Slope Angle in Degrees
The angle of inclination is the angle between the line and the positive x-axis, measured counter-clockwise. It comes straight from the slope: angle = arctan(m), converted to degrees. A slope of 1 makes 45°; a slope of 0 makes 0°; a vertical line makes 90°.
Negative slopes give negative angles: a slope of −1 sits at −45°, i.e. 45° below the x-axis. Roofers and road builders often quote the same idea as a grade percentage instead — that's just the slope × 100, so a slope of 0.08 is an 8% grade.
🔀 Parallel and Perpendicular Slopes
Parallel lines
Parallel lines never meet, which means they climb at exactly the same rate: equal slopes. If your line has slope 2, every line parallel to it also has slope 2 — only the intercept differs.
Perpendicular lines
Perpendicular lines meet at a right angle, and their slopes are negative reciprocals: flip the fraction and change the sign. If your line has slope m, a perpendicular line has slope −1/m. So a line of slope 2 is perpendicular to a line of slope −1/2, and their product is −1. (A horizontal line's perpendicular is vertical — undefined slope — and vice versa.)
⚠️ Common Slope Calculation Mistakes
Subtracting in the wrong order
(y2 − y1) ÷ (x1 − x2) flips the sign. Keep the same point first in both the top and bottom: if you start with y2, you must divide by (x2 − x1).
Calling a vertical slope "zero" or "infinite"
A vertical line's slope is undefined — 6 ÷ 0 is not 0 and not ∞, it simply has no value. Mixing this up breaks every formula that follows.
Dropping negative signs
With points like (−4, 1) and (2, −5), write out each subtraction: −5 − 1 = −6, and 2 − (−4) = 6. Most wrong answers come from a sign slipped in this step.
Rounding the slope before finding the equation
A rounded slope carries its error into the intercept and every later value. Keep full precision while working and round only the final display.
📐 Assumptions & Limitations
This calculator assumes the two points define a straight line in a standard x–y plane — it cannot tell you whether your data is actually linear. Two identical points don't define a line at all, and the calculator refuses them rather than guessing. Results are displayed rounded to 6 decimal places (angles to 2); the underlying arithmetic keeps full precision. The standard-form equation is scaled to whole numbers where the inputs allow it.
❓ Frequently Asked Questions
Subtract the y-coordinates (the rise) and divide by the difference of the x-coordinates (the run): slope = (y2 − y1) ÷ (x2 − x1). For the points (2, 3) and (6, 11), that is (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2.
Pick any two points on the line and apply the slope formula m = (y2 − y1) ÷ (x2 − x1). For example, the line through (1, 2) and (4, 8) has slope (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
The slope formula is m = (y2 − y1) ÷ (x2 − x1), where (x1, y1) and (x2, y2) are two points on the line. The numerator is the vertical change (rise); the denominator is the horizontal change (run).
A slope of zero means the line is horizontal: y never changes, so the rise is 0. An undefined slope means the line is vertical: the run is 0, and division by zero has no meaning, so no slope value exists.
Measure the vertical rise over a horizontal run, usually 12 inches. A roof that rises 6 inches over a 12-inch run has slope 6 ÷ 12 = 0.5, called a 6-in-12 pitch. Enter the rise and run as two points, e.g. (0, 0) and (12, 6), in the calculator above.
Parallel lines have equal slopes: if one line has slope m, any parallel line also has slope m. Perpendicular lines have slopes that are negative reciprocals: if one line has slope m, a perpendicular line has slope −1/m. For example, lines of slope 2 and −1/2 are perpendicular.
Take the arctangent of the slope and convert to degrees: angle = arctan(m) × 180 ÷ π. A slope of 1 gives arctan(1) = 45 degrees. A horizontal line has angle 0 degrees; a vertical line has angle 90 degrees.