CalcBrew

Slope Calculator

Enter any two points and get the slope as both a fraction and a decimal, the full line equation y = mx + b, the distance between the points, and the midpoint β€” with the rise-over-run substitution shown step by step, exactly the way you would write it on a homework page.

By Miikka Β· CalcBrew Β· Updated

Point 1 = (x₁, y₁), Point 2 = (xβ‚‚, yβ‚‚). Decimals and negative numbers are fine.

Slope (m)

2

Line equation

y = 2x

Distance

8.9443

Midpoint

(3, 6)

Step-by-step solution

  1. m = (yβ‚‚ βˆ’ y₁) / (xβ‚‚ βˆ’ x₁)
  2. m = (10 βˆ’ 2) / (5 βˆ’ 1) = 8 / 4 (rise / run)
  3. m = 2
  4. b = y₁ βˆ’ mΒ·x₁ = 2 βˆ’ 2 Β· 1 = 0
  5. Equation: y = 2x
  6. Distance = √(rise² + run²) = √(8² + 4²) = √80 = 8.9443
  7. Midpoint = ((x₁ + xβ‚‚)/2, (y₁ + yβ‚‚)/2) = (3, 6)
Share:

The slope formula, worked out

The slope measures how steep a line is: m = (yβ‚‚ βˆ’ y₁) / (xβ‚‚ βˆ’ x₁), or rise over run. Take the points (1, 2) and (5, 10). The rise is 10 βˆ’ 2 = 8 and the run is 5 βˆ’ 1 = 4, so m = 8/4 = 2. To finish the equation, plug either point into b = y₁ βˆ’ mΒ·x₁ = 2 βˆ’ 2 Β· 1 = 0, giving y = 2x.

The same two points also give you the distance β€” the rise and run are the two legs of a right triangle, so the distance is the hypotenuse from the Pythagorean theorem: √(8Β² + 4Β²) = √80 β‰ˆ 8.944. The midpoint simply averages the coordinates: (3, 6).

One special case: if both points share the same x-coordinate, the run is zero and the slope is undefined β€” the line is vertical and its equation is x = c. The calculator detects this automatically instead of dividing by zero.

Frequently asked questions

Cite this calculator
APACalcBrew. (2026). Slope Calculator. https://calcbrew.com/slope-calculator
MLAβ€œSlope Calculator.” CalcBrew, 2026, calcbrew.com/slope-calculator.

Link to https://calcbrew.com/slope-calculator. Results are estimates; cite the underlying formula or data source for academic work.

Related tools

More in Math & Statistics Β· All calculators