Slope Calculator

Find slope, line equation, intercept and inclination from two points or a point and slope, plus distance and midpoint for two points.

Solve for

Slope

2

  • Line equationy = 2x + 0
  • Y-intercept0
  • Inclination (0–180°)63.43494882°
  • Perpendicular slope-0.5
  • Distance8.94427191
  • Midpoint(3, 6)

How this was calculated

  1. The slope (m) tells you how steep the line is: how far it goes up (the rise) for each step to the right (the run). Take the change in y and divide it by the change in x.m = (y₂ − y₁) ÷ (x₂ − x₁)Put in your numbers: m = (10 − 2) ÷ (5 − 1) = 8 ÷ 4Answer: m = 2
  2. The y-intercept (b) is where the line crosses the up-and-down y-axis, at x = 0. Start at your first point and go back along the slope to x = 0.b = y₁ − m × x₁Put in your numbers: b = 2 − 2 × 1Answer: b = 0
  3. Put the slope and the y-intercept together to get the equation of the line.y = mx + bAnswer: y = 2x
  4. The distance is the straight-line length between the two points. Picture a right triangle with the run and the rise as its short sides, then use the Pythagorean theorem.d = √((Δx)² + (Δy)²)Put in your numbers: d = √(4² + 8²) = √(16 + 64) = √80Answer: d = 4√5 ≈ 8.94427191
  5. The midpoint is exactly halfway between the two points. Average the x values and average the y values.M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)Put in your numbers: M = ((1 + 5) ÷ 2, (2 + 10) ÷ 2)Answer: M = (3, 6)
  6. Two points in the same place do not make a single line. A vertical (straight up-and-down) line never crosses the y-axis, so it has no y-intercept.

Slope in simple words

The slope of a line tells you how steep it is. It is the rise (how far the line goes up) divided by the run (how far it goes to the right). A bigger slope means a steeper line. A negative slope means the line goes down as you move right.

To find the slope from two points, take away the y values to get the rise and take away the x values to get the run, then divide: m = (y₂ − y₁) ÷ (x₂ − x₁).

Example: points (1, 2) and (5, 10). The rise is 10 − 2 = 8 and the run is 5 − 1 = 4, so the slope is 8 ÷ 4 = 2. The line goes up 2 for every 1 step to the right.

A flat line has a slope of 0. A straight up-and-down line has no slope number at all, because you would have to divide by zero.

Formula and method

Slope m = (y₂−y₁)/(x₂−x₁), intercept b = y₁−mx₁ and the line is y = mx+b. For two points, distance is √((x₂−x₁)²+(y₂−y₁)²), and midpoint averages each coordinate.

Worked example

Points (1,2) and (5,10) give slope 8/4 = 2, line y = 2x and midpoint (3,6). Their distance is √80 ≈ 8.94427191; a perpendicular line has slope −1/2.

Inputs and limitations

A vertical line has undefined slope and equation x = constant. A horizontal line has slope zero and a vertical perpendicular. Two identical points do not specify a unique line. Inclination is reported between 0° and 180°, independent of point order.

Endpoint from a midpoint

If you know one endpoint (x₁, y₁) and the midpoint (xₘ, yₘ), the other endpoint is x₂ = 2xₘ − x₁ and y₂ = 2yₘ − y₁. For endpoint (1, 2) and midpoint (3, 6), the other endpoint is (2 × 3 − 1, 2 × 6 − 2) = (5, 10).

In every mode the steps show the slope substitution, Δy ÷ Δx reduced to lowest terms, and the intercept b = y₁ − m × x₁ with your numbers.

Frequently asked questions

Why does the slope show a fraction?

Rise over run is a ratio, so the calculator reduces Δy ÷ Δx to lowest terms. Points (0, 0) and (4, 6) give 6/4 = 3/2 = 1.5.

How do I find an endpoint from the midpoint?

Double the midpoint and subtract the known endpoint, coordinate by coordinate: x₂ = 2xₘ − x₁ and y₂ = 2yₘ − y₁. Choose the Endpoint from midpoint tab.

References

Last updated . Results are estimates for informational purposes only.