Skip to content
⛰️

Slope Calculator

Work out slope, gradient, distance, and the angle of a line from two points.

Runs in your browser

Updated

Slope (m)

2

Percent grade 200%
Angle 63.43°
Distance 6.7082
y-intercept (b) 1

Slope is the vertical change divided by the horizontal change. A negative slope falls left to right, and a percent grade above 100% means the climb is steeper than the ground it covers, as on a steep hill or ski slope.

Four numbers from two points

The form holds x one, y one, x two and y two, and every keystroke recalculates. Slope is vertical change over horizontal change, so m equals y two minus y one over x two minus x one, and the intercept is y one minus m times x one. Angle comes from the arctangent of m converted to degrees at two decimals, percent grade is m times one hundred at two decimals, and distance is the square root of the summed squares. Slope, intercept and distance round to four decimals.

A worked example

The shipped points 1, 3 and 4, 9 give a rise of 6 over a run of 3. Slope reads 2, percent grade 200.00%, angle 63.43 degrees, distance 6.7082 and intercept 1. The copy line under the Line form selector shows y = 2x + 1, and switching that menu to point form rewrites it as y - 3 = 2(x - 1). The sign of the intercept decides whether the line uses a plus or a minus.

How a vertical line is reported

When the two x values match the run is zero, so the tool refuses to print infinity. A red sentence states that the line is vertical and its slope is undefined, all five figures collapse to a dash, the plot clears and the copy box empties. A negative slope still plots normally, with the angle reading below zero.

Where it stops

  • An empty or unreadable field blocks the calculation with a message naming all four inputs, rather than guessing a zero.
  • Identical points get their own message, distinct from the vertical-line case, because no line exists at all.
  • Angle stays between minus 90 and 90 degrees because it comes from the slope, not the direction of travel.
  • The plot rescales to the two points and carries no axes, gridlines or units.
  • A third point cannot be added, which rules out collinearity checks.

Questions people ask

What does a grade above 100 percent mean

The climb exceeds the ground covered, which is normal on a steep hill rather than an error.

Why is distance not the run

Distance measures the hypotenuse between the points, while run is only the horizontal change.

Need the length alone

The Distance Calculator drops the gradient work and Pythagorean Theorem Calculator shows the triangle.