Skip to content
CalculStoreCalculStore
All tools / Math

Slope calculator

Slope, line equation, distance and angle between two points.

About this calculator

This slope calculator finds the slope of the line through two points, also called the gradient or rise over run. Enter the coordinates of both points.

You also get the equation of the line in y = mx + b form, both intercepts, the distance between the points, the midpoint and the angle of the line.

How it works

Slope is rise over run: (y₂ − y₁) ÷ (x₂ − x₁). The line through both points is y = mx + b, where b = y₁ − m × x₁.

Last reviewed:

Worked example

  • x₁: 1
  • y₁: 2
  • x₂: 5
  • y₂: 10

Slope: 2

Common questions

What does a negative slope mean?

The line goes down as you move to the right. A positive slope goes up, a slope of zero is flat, and a vertical line has an undefined slope.

How do I turn a slope into an angle?

The angle is the inverse tangent of the slope. A slope of 1 is 45°, and a slope of 0.5 is about 26.6°.

What is the y-intercept?

It's where the line crosses the y-axis, the value of y when x is 0. In y = mx + b it is the number b.

The story behind it

Where the idea came from: Nobody knows for certain why m stands for slope. The letter has been used that way in textbooks since at least the 1800s.

The idea of slope is far older than its symbol: builders and surveyors have measured how steeply roads, roofs and ramps rise for thousands of years. Coordinate geometry, from René Descartes in the 1600s, turned slope into a number you can calculate from two points. That is exactly what this calculator does.

Why you can trust this calculator

  • It runs in your browser. Nothing you type into it is sent anywhere.
  • The method is explained on this page, so you can check it yourself.
  • Free to use, with no sign-up.
  • Results are estimates, so please double-check anything important.
  • Spotted a mistake? Tell us and we'll look into it.
Prof. Alexandre Laurent, founder of CalculStore
Built byProf. Alexandre Laurent

After 15 years as a mathematics educator, I built CalculStore to give students, teachers, professionals and anyone working with numbers simple, reliable tools.

Meet the founder