SolutionsCase StudiesAI ToolsResourcesAboutContact
Get Your Free AI Automation Audit Book a Free 30-Minute Strategy Call

How to find the slope between two points

By Taimur Hassan SiddiquiPublished 7 October 2026

From two points you can find the slope of the line through them, the distance between them, their midpoint and the equation of the line. This guide gives the formulas with one worked example and the special cases.

The short version

  1. Find the changes. Δx = x₂ − x₁ and Δy = y₂ − y₁.
  2. Slope: m = Δy ÷ Δx (rise over run).
  3. Distance: √(Δx² + Δy²).
  4. Line equation: y = mx + b, where b = y₁ − m·x₁.

Skip the arithmetic. The free Slope Calculator does this for you, shows the formula and the working with your own numbers, and runs in your browser - nothing you type is uploaded. Also useful: System of Equations Solver, Quadratic Formula Calculator.

Open the Slope Calculator →

A worked example: (1, 2) and (4, 6)

Δx = 4 − 1 = 3, Δy = 6 − 2 = 4 slope m = 4/3 distance = √(3² + 4²) = √25 = 5 midpoint = ((1+4)/2, (2+6)/2) = (2.5, 4) b = 2 − (4/3)(1) = 2/3 → y = 4/3 x + 2/3 standard form (multiply by 3): 4x − 3y = −2

What the slope tells you

Slope is rise over run: how much y changes for each 1 step in x. A slope of 4/3 climbs 4 units for every 3 to the right. Positive slopes rise from left to right, negative slopes fall, zero is a flat line and an undefined slope is a vertical line.

Horizontal and vertical lines

  • Horizontal (same y): Δy = 0, so the slope is 0 and the line is y = a number.
  • Vertical (same x): Δx = 0, so the slope formula would divide by zero. The slope is undefined and the line is x = a number.

Parallel and perpendicular lines

Parallel lines have equal slopes. Perpendicular lines have slopes whose product is −1: the negative reciprocal. A line with slope 4/3 has perpendiculars with slope −3/4.

A second example: a negative slope and a vertical line

Points (−2, 5) and (4, −1):

Δx = 4 − (−2) = 6, Δy = −1 − 5 = −6 slope = −6 ÷ 6 = −1 (the line falls) distance = √(6² + 6²) = √72 = 6√2 ≈ 8.485 midpoint = ((−2+4)/2, (5+(−1))/2) = (1, 2) b = 5 − (−1)(−2) = 3 → y = −x + 3

Points (3, 1) and (3, 7) have the same x, so Δx = 0: the slope is undefined, the distance is 6 and the line is x = 3. Mind the double negative when you subtract a negative coordinate.

Mistakes to avoid

  • Subtracting in a different order on top and bottom. Use (y₂ − y₁) ÷ (x₂ − x₁) or reverse both, never one of each.
  • Forgetting that distance uses the squares, so it is never negative.
  • Calling a vertical line's slope 0 instead of undefined.

Frequently asked questions

Does it matter which point I call point 1?
No, as long as you subtract in the same order for x and y. The slope, distance and midpoint come out the same.
What is the slope of a vertical line?
Undefined. The change in x is zero, so the slope formula would divide by zero.
How is the distance formula related to Pythagoras?
Δx and Δy are the two legs of a right triangle and the distance is its hypotenuse.
How do I write the equation if I only have the slope and one point?
Use y − y₁ = m(x − x₁) and tidy it into y = mx + b.
What is the angle of a line?
The angle with the positive x-axis is the inverse tangent of the slope, measured from 0° to 180°.