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

Point 1 (x₁, y₁)
Point 2 (x₂, y₂)

Whole numbers, decimals or fractions, like −3, 2.5 or 1/2.

Try:

Example Line through (1, 2) and (4, 6)

m = 4/3

≈ 1.333333333 · Line: y = (4/3)x + 2/3

Slope (m)
4/3 ≈ 1.33333
Rise / run
4 / 3
Slope-intercept form
y = (4/3)x + 2/3
Point-slope form
y − 2 = (4/3)(x − 1)
Standard form
4x − 3y = −2
Angle with x-axis
53.1301°
Distance between points
5
Midpoint
(5/2, 4)
≈ (2.5, 4)
y-intercept
(0, 2/3)
x-intercept
(−1/2, 0)
Parallel slope
4/3
Perpendicular slope
−3/4
Graph of y = (4/3)x + 2/3The line y = (4/3)x + 2/3 through (1, 2) and (4, 6) rises from left to right. A right triangle marks the run of 3 and the rise of 4. The midpoint is (2.5, 4).−4−2024680246xyrun = 3rise = 4Midpoint (2.5, 4)y-intercept (0, 0.6666666667)Point 1 (1, 2)(1, 2)Point 2 (4, 6)(4, 6)
Graph of y = (4/3)x + 2/3. Both axes use the same scale, so the angle is true. The small hollow dot is the midpoint and the orange dot is the y-intercept.

Step-by-step

m = (y₂ − y₁) / (x₂ − x₁) = rise / run

  1. Slope: m = (y₂ − y₁) / (x₂ − x₁) = (6 − 2) / (4 − 1) = 4 / 3 ≈ 1.333333333.
  2. Rise over run: rise = Δy = 4, run = Δx = 3. Going from point 1 to point 2 the line moves 3 to the right and 4 up, so it rises from left to right.
  3. y-intercept: b = y₁ − m·x₁ = 2 − (4/3)(1) = 2/3 ≈ 0.6666666667.
  4. Slope-intercept form (y = mx + b): y = (4/3)x + 2/3.
  5. Point-slope form (y − y₁ = m(x − x₁), using point 1): y − 2 = (4/3)(x − 1).
  6. Standard form (Ax + By = C): start from y = (4/3)x + 2/3 and multiply both sides by 3 to clear the fractions: 3y = 4x + 2; then move the x-term to the left: −4x + 3y = 2; then multiply by −1 so the x-coefficient is positive: 4x − 3y = −2.
  7. Angle with the positive x-axis: θ = arctan(m) = arctan(4/3) ≈ 53.1301°.
  8. Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²) = √(3² + 4²) = √(9 + 16) = √25 = 5.
  9. Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2) = ((1 + 4)/2, (2 + 6)/2) = (5/2, 4) = (2.5, 4).
  10. Parallel lines have the same slope, 4/3. Perpendicular lines have the negative reciprocal, −3/4 — check: (4/3) × (−3/4) = −1.

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.

SlopeThe line…Example
Positiverises from left to right(1, 2) to (4, 6): m = 4/3
Negativefalls from left to right(−2, 3) to (4, −1): m = −2/3
Zerois horizontal, y = constant(1, 2) to (5, 2): y = 2
Undefinedis 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.

  1. Slope: m = (6 − 2) / (4 − 1) = 4/3 ≈ 1.33333. The rise is 4 and the run is 3.
  2. y-intercept: b = 2 − (4/3)(1) = 2/3.
  3. Slope-intercept form: y = (4/3)x + 2/3.
  4. Point-slope form: y − 2 = (4/3)(x − 1).
  5. Standard form: multiply by 3 to get 3y = 4x + 2, then rearrange to 4x − 3y = −2.
  6. Angle: arctan(4/3) ≈ 53.1301°.
  7. Distance: √(3² + 4²) = √25 = 5 — the classic 3-4-5 right triangle.
  8. Midpoint: ((1 + 4)/2, (2 + 6)/2) = (5/2, 4), or (2.5, 4).
  9. 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°).

Last reviewed · Built and checked by the Reeliy team · How we test our tools