Calculator and Converter

Slope calculator

Enter two points as x₁, y₁ and x₂, y₂, and this calculator finds the slope of the straight line through them.

Results

Enter your values to see the result.

About this tool

It also gives the y-intercept for the line equation y = mx + b, the angle of the line in degrees and the distance between the points. It suits graphing homework and checking the gradient of a ramp or roof from measurements.

How it is calculated
slope m = (y₂ − y₁) ÷ (x₂ − x₁); line y = m·x + b
Worked example
With x₁: 1; y₁: 2; x₂: 4; y₂: 8, the result is: Slope (m): 2; y-intercept (b): 0; Angle: 63.43 °; Distance: 6.71.
Good to know
A vertical line, where x₁ equals x₂, has an undefined slope and returns an error. The Angle is measured from the horizontal axis and is negative for lines that slope downward.

Frequently asked questions

What does the slope value mean?

Slope (m) is the rise divided by the run, the change in y for each one-unit change in x. A positive slope climbs to the right, a negative one falls, and zero is a flat horizontal line.

Why does a vertical line give an error?

Both points share the same x value, so the run is zero and the slope would require dividing by zero. A vertical line cannot be written as y = mx + b.

How do I use the y-intercept result?

It is where the line crosses the y-axis. Together with the slope it gives the full equation y = mx + b, which you can use to find y for any x along the line.

Related calculators