Slope Calculator

Result

Slope (m)
2
Line equation
y = 2x
Angle
63.434949°
Grade (%)
200%
Rise / run
8 / 4
Distance between the points
8.944272
Midpoint
(3, 6)
y-intercept
(0, 0)

Slope m = (y₂ − y₁) / (x₂ − x₁). The angle is measured from the horizontal and the grade is the slope × 100.

Everything runs in your browser. Your data never leaves your device.

What this slope calculator does

Enter two points to get the slope of the line through them, both as a decimal and as a simplified fraction. You also get the equation of the line in slope-intercept form (y = mx + b), the angle from the horizontal, the grade in percent, the distance between the points and the midpoint. The rise and run mode does the same for roofs, ramps, stairs and roads, and adds the roof pitch.

How to use it

  1. Choose Two points and type x₁, y₁, x₂ and y₂, or choose Rise and run.
  2. The results update as you type.
  3. Negative numbers and decimals are fine, for example (-2, 1) and (6, 7).

Formulas

Example

For the points (-2, 1) and (6, 7) the rise is 6 and the run is 8, so the slope is 6/8 = 3/4 = 0.75. The line is y = 0.75x + 2.5, the angle is about 36.87°, the grade is 75%, the distance is 10 and the midpoint is (2, 4).

Where slope is used

Slope appears in school algebra and graphs, in physics as speed on a distance-time graph, and in engineering and building: drainage pipes, wheelchair ramps (often a maximum of 1:12, about 8.3%), roads and roof pitches.

Frequently asked questions

What is the slope formula?

Slope m = (y₂ − y₁) / (x₂ − x₁), the change in y divided by the change in x, often called rise over run. A positive slope goes up from left to right and a negative slope goes down.

How do I turn a slope into an angle or a percentage?

The angle is the arctangent of the slope, θ = tan⁻¹(m), and the grade in percent is the slope × 100. A slope of 1 is a 45° angle and a 100% grade.

What is a 6/12 roof pitch?

The roof rises 6 units for every 12 units of horizontal run, a slope of 0.5, a 50% grade and an angle of about 26.6°. Choose rise and run and type 6 and 12 to see all of these.

What happens with a vertical line?

When x₁ equals x₂ the run is 0, so the slope is undefined and the line equation is x = a number. The angle is 90°.

Last updated: · What's new

Related tools