Slope Calculator

Find the slope, intercept, rise, run, and distance between two points. Vertical lines are identified explicitly.

Live result2SlopeView results ↑

Your inputs

Find the slope, intercept, rise, run, and distance between two points. Vertical lines are identified explicitly.

Use 1,234.56 number format.

Negative coordinates are allowed.
Y coordinate of the first point.
X coordinate of the second point.
Y coordinate of the second point.

Change any input to see the result immediately. Start with your own measurements and assumptions.

Results

Live
Slope2rise 8 ÷ run 4
Line equationy = 2x + 0Cartesian line through both points
Rise / run8 / 4signed coordinate changes
Point distance8.944272same coordinate units

Display values are rounded. The calculation method and limits are explained below.

What this result includes

Cartesian coordinates in the same units. Geographic distances and earth curvature are not modeled.

Reference formulas and worked examples below keep their stated units. Monetary examples use USD; dimensional examples use US customary units unless labeled otherwise. Metric calculator inputs are converted to these reference units before calculation. Choosing another currency does not convert example amounts or exchange money.

How to use this slope calculator

Find the slope, intercept, rise, run, and distance between two points. Vertical lines are identified explicitly.

How the calculation works

Rise = y₂ − y₁ and run = x₂ − x₁. Slope = rise ÷ run.

For a nonvertical line, intercept b = y₁ − slope × x₁ and the equation is y = mx + b.

Distance = square root of (run² + rise²). A zero run produces a vertical line x = x₁; identical points do not define a unique line.

Worked example

From (1, 2) to (5, 10), rise is 8 and run is 4. The slope is 2 and the intercept is 0, so y = 2x.

Limits and assumptions

Cartesian coordinates in the same units. Geographic distances and earth curvature are not modeled.

Frequently asked questions

What does undefined slope mean?

The line is vertical: the X coordinates are identical but Y differs.

What is the slope of a horizontal line?

Zero, because the rise is zero and the run is nonzero.

Can I enter the same point twice?

No. Infinitely many lines pass through a single point.