Skip to content

DIY Cost Tools

Slope Calculator

MATH CALCULATOR

Enter two coordinate points to calculate slope, the line equation, distance, midpoint, and line angle.

Slope2
Line equationy = 2x
Distance8.9443
Midpoint(3, 6)
Angle from +x axis63.4349°

How it works

Slope is vertical change divided by horizontal change. The same coordinate differences determine distance and direction, while averaging the endpoints gives the midpoint.

Formulas

m = (y₂ − y₁) ÷ (x₂ − x₁)
Distance = √[(x₂ − x₁)² + (y₂ − y₁)²]
Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2)

Example

Points (1, 2) and (5, 10) have slope (10 − 2) ÷ (5 − 1) = 2 and lie on y = 2x.

Important limits

  • A vertical line has undefined slope and an equation in the form x = constant.
  • The angle is measured counterclockwise from the positive x-axis and may be negative.
  • Displayed results are rounded, but calculations use full available precision.

Frequently asked questions

What does a negative slope mean?

The line falls as x increases.

What if both points are identical?

They do not define a unique line, so the calculator requests a second distinct point.

Review notes

Results follow standard analytic geometry formulas. Last reviewed September 30, 2026.

Related calculators