Home › Math › Slope Calculator

Slope Calculator

Find the slope between two points, with the line equation, intercepts, angle, grade and distance.

Enter the x value in the left box and the y value in the right box. Negative numbers and decimals are fine.

Slope (m)

-

Slope as a fraction-
Rise (y₂ − y₁)-
Run (x₂ − x₁)-
Grade (slope as a percentage)-
Angle with the x-axis-
Distance between the points-
Midpoint-
Equation of the line-
y-intercept-
x-intercept-

What is slope?

Slope tells you how steep a line is and which way it leans. It is the change in height (rise) divided by the change in horizontal distance (run) between any two points on the line. This calculator takes two points, finds the slope, and also gives the equation of the line, its intercepts, the angle, the grade and the distance between the points.

Slope formula

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

Once you have the slope, the line equation is y = mx + b, where b = y₁ − m × x₁ is the y-intercept (where the line crosses the y-axis).

Example

Take the points (1, 2) and (4, 8). The rise is 8 − 2 = 6 and the run is 4 − 1 = 3, so m = 6 ÷ 3 = 2. Then b = 2 − 2 × 1 = 0, so the line is y = 2x. The grade is 200%, the angle with the x-axis is about 63.43°, and the distance between the points is about 6.71.

Types of slope

  • Positive slope: the line rises from left to right.
  • Negative slope: the line falls from left to right.
  • Zero slope: a flat, horizontal line (y stays the same).
  • Undefined slope: a vertical line (x stays the same), because the run is 0 and you cannot divide by zero.

Grade and angle

Grade is the slope written as a percentage: grade = slope × 100. A road with a 6% grade rises 6 units for every 100 units along the ground. The angle with the x-axis is the inverse tangent of the slope, so a slope of 1 is 45°.

Good to know

  • The order of the points does not matter. Swapping them gives the same slope.
  • Parallel lines have equal slopes.
  • Perpendicular lines have slopes whose product is −1 (for example 2 and −1/2).
  • The distance between the points uses the Pythagorean theorem. You can explore it with the Pythagorean Theorem Calculator.

Related tools: Pythagorean Theorem Calculator, Triangle Area Calculator and Area Calculator.

Need another calculator?

Browse all calculators
Scroll to Top