Skip to main content

Slope Calculator

Slope, line equation, distance, midpoint, and angle from two points

Two Points

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Quick summary

Enter two points (x₁, y₁) and (x₂, y₂) to find the slope — rise over run, (y₂−y₁)/(x₂−x₁) — plus the line's equation in y = mx + b form, the distance between the points, their midpoint, and the line's angle. For (1, 2) and (3, 6) the slope is 2, the equation is y = 2x, the distance is 4.47, and the midpoint is (2, 4). A vertical line (x₁ = x₂) has an undefined slope.

Reviewed by Simple Calculators TeamLast reviewed

How to use this calculator

  1. Enter the inputs requested by the calculator.
  2. Choose the units or options that match your situation and review the assumptions.
  3. Run or update the calculation to see the result.
  4. Review the result, breakdown, and formulas shown on the page.
  5. Check the inputs, units, dates, and limitations before saving or sharing the result.

Frequently asked questions

How do I find the slope between two points?

Divide the change in y by the change in x: slope = (y₂ − y₁) / (x₂ − x₁), often called 'rise over run.' For (1, 2) and (3, 6): (6−2)/(3−1) = 4/2 = 2. This calculator also gives the full line equation, distance, and midpoint.

What is the equation of a line through two points?

Find the slope m, then the y-intercept b using b = y − mx with either point. The line is y = mx + b. For slope 2 through (1, 2), b = 2 − 2(1) = 0, so y = 2x. The tool builds this equation for you.

Why is a vertical line's slope undefined?

A vertical line has the same x for both points, so the run (x₂ − x₁) is zero, and dividing by zero is undefined. Such a line is written x = k rather than y = mx + b. The calculator flags this case.

How do I find the midpoint and distance?

The midpoint is the average of the coordinates: ((x₁+x₂)/2, (y₁+y₂)/2). The distance uses the Pythagorean theorem: √((x₂−x₁)² + (y₂−y₁)²). This calculator returns both alongside the slope.

Key terms

Slope
Rise over run — (y₂−y₁)/(x₂−x₁); the steepness of a line.
Y-Intercept
Where the line crosses the y-axis (the b in y = mx + b).
Midpoint
The point halfway between two points.
Distance Formula
√((x₂−x₁)² + (y₂−y₁)²) — the straight-line distance.

Methodology, sources & limitations

This page shows the formula, assumptions, and limitations used for this estimate. Rates, thresholds, and other time-sensitive inputs can change, so verify them against the relevant official source before relying on a result.

For our review approach and the primary sources we consult, see the methodology and source policy. If you spot an outdated figure or formula, please contact us with a correction.