Slope Calculator
Enter two points to get the slope as a fraction and a decimal, the equation of the line in every form, the angle, distance and midpoint — with a graph and every step.
Slope Calculator
How to use the slope calculator
Type the coordinates of two points on the line. You can use negative numbers, decimals and fractions — the answers stay exact, so a slope of 4/3 is shown as 4/3 rather than a rounded 1.33. Everything updates as you type: the slope, the equation of the line in slope-intercept, point-slope and standard form, the angle, the distance between the points and the midpoint. The graph draws the line with its rise-over-run triangle, and the working lists each step in the order you’d write it. The page address keeps your points, so you can share or bookmark the result.
The slope formula
m = (y₂ − y₁) / (x₂ − x₁) = rise / run
Slope measures steepness: how much y changes for each 1-unit step to the right. The rise is the vertical change and the run is the horizontal change between the two points. Once you know the slope m, the y-intercept is b = y₁ − m·x₁, which gives the line’s equation y = mx + b.
| Slope | The line… | Example |
|---|---|---|
| Positive | rises from left to right | (1, 2) to (4, 6): m = 4/3 |
| Negative | falls from left to right | (−2, 3) to (4, −1): m = −2/3 |
| Zero | is horizontal, y = constant | (1, 2) to (5, 2): y = 2 |
| Undefined | is vertical, x = constant | (3, 1) to (3, 5): x = 3 |
Worked example: the line through (1, 2) and (4, 6)
These are the points the calculator starts with.
- Slope: m = (6 − 2) / (4 − 1) = 4/3 ≈ 1.33333. The rise is 4 and the run is 3.
- y-intercept: b = 2 − (4/3)(1) = 2/3.
- Slope-intercept form: y = (4/3)x + 2/3.
- Point-slope form: y − 2 = (4/3)(x − 1).
- Standard form: multiply by 3 to get 3y = 4x + 2, then rearrange to 4x − 3y = −2.
- Angle: arctan(4/3) ≈ 53.1301°.
- Distance: √(3² + 4²) = √25 = 5 — the classic 3-4-5 right triangle.
- Midpoint: ((1 + 4)/2, (2 + 6)/2) = (5/2, 4), or (2.5, 4).
- Perpendicular slope: −3/4, the negative reciprocal of 4/3.
Common mistakes
- Run over rise. Slope is the change in y divided by the change in x — y goes on top.
- Mixing the order. If you start with point 2 on top, start with point 2 on the bottom too.
- Losing a negative. Subtracting a negative adds: 4 − (−2) = 6. Write negatives in parentheses.
- Calling a vertical line’s slope 0. Horizontal lines have slope 0; vertical lines have an undefined slope.
- Not simplifying. 4/6 should become 2/3. The calculator always reduces the fraction.
Where slope shows up
Slope is a rate of change, so it appears whenever one quantity changes steadily with another: speed on a distance–time graph, cost per item, or the grade of a road or roof. Percent grade is simply slope × 100. When the relationship curves instead of following a straight line, the quadratic formula calculator graphs parabolas and finds where they cross the x-axis. For arithmetic with the fractional answers, try the fraction calculator, and for arctan and square roots by hand, the scientific calculator.
Frequently asked questions
How do you find the slope from two points?
Subtract the y-coordinates, subtract the x-coordinates in the same order, and divide: m = (y₂ − y₁) / (x₂ − x₁). For (1, 2) and (4, 6), m = (6 − 2) / (4 − 1) = 4/3.
Does it matter which point I call point 1?
No, as long as you keep the same order on the top and bottom. (2 − 6) / (1 − 4) = −4 / −3 = 4/3, the same slope. The mistake to avoid is mixing orders, like (6 − 2) / (1 − 4), which flips the sign.
What do a zero slope and an undefined slope mean?
A slope of 0 means the line is horizontal (y = constant): the rise is 0. An undefined slope means the line is vertical (x = constant): the run is 0 and you can’t divide by zero. A vertical line has no slope-intercept form.
How do I find the slope of a perpendicular line?
Take the negative reciprocal: flip the fraction and change the sign. A line with slope 4/3 is perpendicular to lines with slope −3/4, because 4/3 × (−3/4) = −1. Parallel lines have equal slopes.
What is the difference between slope-intercept, point-slope and standard form?
They describe the same line. Slope-intercept, y = mx + b, shows the slope and where the line crosses the y-axis. Point-slope, y − y₁ = m(x − x₁), is quickest to write from a point and a slope. Standard form, Ax + By = C, uses whole numbers and also works for vertical lines.
How is slope related to angle and percent grade?
The slope is the tangent of the angle the line makes with the x-axis, so the angle is arctan(m). A slope of 1 is 45°. Percent grade is the slope times 100: a 6% road grade rises 6 feet for every 100 feet of horizontal distance, a slope of 0.06 (about 3.4°).