One Calculator Logo One Calculator
Mathematics & Statistics • Formulas shown

Slope Calculator

Quick Answer

Slope = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁). Between (1, 2) and (5, 10) the slope is 8 ÷ 4 = 2, the line is y = 2x + 0, the angle is 63.43° and the distance is 8.94.

Result

The slope is 2

Equationy = 2x + 0
Angle with x-axis63.4349°
Distance8.9442719
Midpoint(3, 6)
Rise / run8 / 4
Step-by-step calculation
  1. m = (y₂ − y₁) ÷ (x₂ − x₁)
  2. = (10 − 2) ÷ (5 − 1) = 2
  3. b = y₁ − m × x₁ = 0

About the Slope Calculator

Enter two points and the calculator returns the slope, the equation of the line through them, the angle it makes with the x-axis, the distance between the points and their midpoint.

A vertical line has an undefined slope because the run is zero, and the calculator shows its equation as x = constant. Slope is used for road grades, roof pitch, rates of change in graphs and in the point-slope form of a line.

How to Use the Slope Calculator

  1. Enter the coordinates of both points.
  2. Read the slope and the line equation.
  3. Check the angle, distance and midpoint.

Formula and Method

Slope

m = (y₂ − y₁) ÷ (x₂ − x₁)

Intercept

b = y₁ − m x₁

Angle

θ = arctan(m)

Worked Example

Two points

Input: (1, 2) and (5, 10)

  • Rise = 8, run = 4
  • m = 2
  • b = 2 − 2 × 1 = 0

Result: y = 2x.

Frequently Asked Questions

What does a negative slope mean?

The line falls from left to right.

What is the slope of a horizontal line?

Zero.

How do I convert slope to a percentage grade?

Multiply by 100. A slope of 0.08 is an 8% grade.

What are parallel and perpendicular slopes?

Parallel lines share a slope; perpendicular slopes multiply to −1.

Related Calculators

All Math & Statistics Calculators →

Sources and Further Reading

Accuracy and Scope

Results use standard IEEE-754 double-precision arithmetic and are rounded for display. For exam, engineering or research work, verify critical values with a second method. See our full disclaimer.