Slope Calculator

Slope, intercept, and distance for a line through two points.

Math and PercentUpdated 2026-10-101 min read
Slope Calculator
Slope
...
Intercept...
Distance...

What it does

Slope measures a line steepness as rise over run: how far y climbs per unit of x. Two points fix a line completely, yielding slope, intercept, and the distance between them in one pass.

The tool above takes both points. It returns the slope, the y-intercept with the full equation, and the point distance, handling vertical lines gracefully.

Sign tells direction at a glance. Positive slopes climb right, negative fall, zero runs flat, and undefined stands vertical where x never changes.

Slope-intercept form rules applied math from ramps to rates. The m in y equals mx plus b is literally this slope, and b is where the story starts at zero.

How to use

  1. Enter both points with signs and decimals.
  2. Read slope first for steepness and direction.
  3. Read the equation for graphing or predicting.
  4. Read distance for length along the segment.

Formula

Slope m = (y2 - y1) / (x2 - x1). Intercept b = y1 - m·x1. Distance = sqrt((x2-x1)² + (y2-y1)²).
rise / run
y change over x change between the points.
b
y value where the line crosses x equals zero.
distance
Straight length via Pythagoras.

Vertical lines divide by zero, so slope stays undefined while distance still computes. Identical points define nothing and error out.

Worked example

Example: (0,0) to (4,3)

Points origin and (4,3).

  1. Slope: (3 - 0) / (4 - 0) = 0.75.
  2. Intercept: 0 - 0.75 x 0 = 0. Line y = 0.75x + 0.
  3. Distance: sqrt(16 + 9) = sqrt(25) = 5.
  4. Classic 3-4-5 triangle hiding in coordinates.

Reference table

Slope values and what they mean
SlopeAngleCharacter
00°Flat
145°Even climb
0.7536.9°Gentle
-1-45°Even fall
undefined90°Vertical

Limits

  • Straight lines only. Curves need calculus.
  • Identical points define nothing.
  • Floating point rounds long decimals.
  • Extrapolation past data needs judgment.

Common mistakes

  • Flipping rise and run in the division.
  • Dropping signs on differences.
  • Calling vertical slope zero instead of undefined.
  • Reading intercept off unscaled graphs.
  • Extending lines far past the data.

Try it yourself

Quick checks. Answers sit tucked under each question.

Slope through (2,1) and (6,9)?

(9-1)/(6-2) = 8/4 = 2.

Distance between those points?

sqrt(16 + 64) = sqrt(80) = 8.9443.

Questions

What is slope in plain words?

Steepness as rise over run. A slope of 2 climbs two for each one across.

What is undefined slope?

Vertical lines where x never changes. Division by zero has no answer.

How are parallel lines related?

Equal slopes. Perpendicular lines multiply to minus one.

What is the intercept for?

Starting value at x zero: base price, initial height, fixed cost.

Slope or angle?

Same story two ways: angle is arctan of slope.

Can slope use any units?

Yes, rise and run share whatever units the points carry.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.