Slope Calculator

Get the slope, distance, midpoint and equation of the line through two points.

What slope means

Slope measures how steep a line is: the rise divided by the run, m = (y₂ − y₁) ÷ (x₂ − x₁). A positive slope goes up from left to right, a negative slope goes down, and a slope of zero is flat.

Example

Through (1, 2) and (4, 8), the slope is 6 ÷ 3 = 2. The line is y = 2x, the distance between the points is √45 ≈ 6.708, and the midpoint is (2.5, 5).

Vertical lines

If both points have the same x, the run is zero and the slope is undefined. The line is written simply as x = a number.

Frequently asked questions

What is the slope of a horizontal line?

Zero, because the rise is zero.

How do I write the equation of a line?

Use y = mx + b, where m is the slope and b is the y-intercept.

Last updated