Ithy

Slope calculator from two points, with line equation

Find the straight line through two coordinate pairs. Keep x and y units consistent: the slope’s units are y units per x unit. The tool shows vertical and horizontal cases separately instead of hiding an undefined division.

Free to use, with no sign-in. Inputs and results stay in this page and are not sent with the form. Download a result before leaving; this tool does not save your work.

Enter your values

Worked result

Slope 2; line y = 2x − 1.

  1. Subtract matching y and x coordinates in the same order.
  2. Divide rise by run to get slope 2.
  3. Substitute a point into y = mx + b to find b = -1.

Find the line through (2, 3) and (6, 11)

The vertical change is eight and the horizontal change is four. The two points are distinct and do not share the same x coordinate.

Rise = 11 − 3 = 8
Run = 6 − 2 = 4
Slope m = 8/4 = 2
Intercept b = 3 − 2×2 = -1
Line: y = 2x − 1
Distance = √(4² + 8²) = √80 ≈ 8.94427191

Swapping both point labels changes the signs of rise and run together, leaving their ratio unchanged. Swapping only one subtraction reverses the sign incorrectly.

A rate of change and a line equation

Slope measures vertical change per unit horizontal change. A horizontal line has zero rise and slope zero. A vertical line has zero run and an undefined finite slope, so its equation is x = constant.

For a nonvertical line, substitute either supplied point into y = mx + b to obtain the intercept. Euclidean distance uses the same coordinate differences, but its geometric interpretation assumes x and y are comparable length coordinates.

m = (y₂ − y₁)/(x₂ − x₁)
b = y₁ − m×x₁
distance = √((x₂ − x₁)² + (y₂ − y₁)²)

Input limits and common mistakes

Two identical points do not determine a unique line or slope. Distinct points with equal x define a vertical line. The calculator reports both conditions explicitly.

Inputs are finite floating-point numbers, bounded to 1e100 in magnitude. Nearly coincident points can produce a numerically sensitive slope. This tool does not convert map coordinates, account for Earth curvature or infer physical units.

Questions about slope between two points

Is a vertical slope zero?

No. A horizontal line has slope zero. A vertical line has zero run, so a finite slope is undefined.

Can the line pass through either point?

It must pass through both. Substituting each pair into the reported line equation is a useful check.

Why is distance separate from slope?

Slope is a ratio of coordinate changes. Distance is the length of the connecting segment when Euclidean geometry and comparable units apply.

Sources and verification

These references explain the formulas or formats. The worked examples above were created for this tool and checked against independent calculations or format round trips. AI-assisted development does not imply a named human expert review.

Published 2026-10-23. Examples are illustrations, not measurements of a service or claims about search rankings.

Related tools

Quadratic equation solver

Solve ax² + bx + c = 0, inspect the discriminant and vertex, and handle repeated, complex and linear cases explicitly.

Pythagorean theorem

Find a hypotenuse or missing leg of a right triangle. See the squared-side equation, area and perimeter with explicit geometry assumptions.

Ratio calculator

Simplify two positive decimal quantities to an exact whole-number ratio, then scale that ratio to a new first quantity.

Further reading

All calculators and developer tools · Source-checked guides · How Ithy checks sources