Skip to content

Slope Calculator

Find slope, angle, distance and the line's equation, with steps.

Slope (m)

2

y = 2x

Equation (slope-intercept)
y = 2x
y-intercept (b)
0
x-intercept
0
Angle (θ)1.10714872 radians
63.43494882°
Percentage grade
200%
Distance between points
6.7082039325
Δx (run)
3
Δy (rise)
6
Midpoint
(2.5, 5)

How it was calculated

  1. m = (y₂ - y₁) / (x₂ - x₁) = (8 - 2) / (4 - 1) = 6 / 3
  2. m = 2
  3. b = y₁ - m × x₁ = 2 - 2 × 1 = 0
  4. θ = arctan(m) = 63.43494882°
  5. Distance = √(Δx² + Δy²) = √(9 + 36) = 6.7082039325

Calculations run on this device and your inputs are not uploaded. A share link puts your inputs in the URL, so anyone with the link can read them.

More Math Calculators

All calculators

How the slope calculator works

Slope measures how steep a line is: rise over run, m = (y₂ - y₁) / (x₂ - x₁). A positive slope goes up to the right, a negative slope goes down, zero is horizontal, and a vertical line has an undefined slope.

Once you know the slope, the line's equation in slope-intercept form is y = mx + b, where b = y₁ - m × x₁ is where the line crosses the y-axis. The angle of the line with the x-axis is θ = arctan(m), and the grade used for roads and ramps is the slope as a percentage.

The second tab works backward: from one point, a direction (slope or angle) and a distance, it finds the two points that distance away along the line, one on each side.

Using and checking your result

Published by JustYourCalculator. Check the units and assumptions above, and compare a known example before relying on the output. Calculations use browser arithmetic and may round displayed values.

Share links may contain your input values. Anyone with the URL can read them; avoid sharing sensitive personal or financial information.

Frequently asked questions

Subtract the y-values and divide by the difference of the x-values in the same order: m = (y₂ - y₁) / (x₂ - x₁). For (1, 2) and (4, 8): (8 - 2) / (4 - 1) = 6 / 3 = 2.

Undefined, because the run (x₂ - x₁) is zero and you can't divide by zero. Its equation is x = constant.

Take the arctangent: θ = arctan(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.57°.

Yes. Every calculator is free with no sign-up. Clearly labeled ads keep it that way.

Calculations run in your browser. Share links put inputs in the URL, which can be read by anyone you send it to and is sent to the hosting server when opened. Avoid sharing sensitive numbers. Currency conversion requests public exchange rates.

Results follow the formulas and assumptions shown, with normal rounding and numerical limits. Taxes, rates and health guidance can change, so treat these as estimates and confirm important decisions with a qualified professional.