UtilityBase logoUtilityBase

Calculators

Slope Calculator

Slope, equation, distance, and midpoint from two points, with the line graphed.

Updated July 10, 2026

How to use the slope calculator

  1. 1Enter two points, any values, decimals fine.
  2. 2Read the slope with rise-over-run worked out.
  3. 3Copy the y = mx + b equation.
  4. 4Check the graph. The dashed legs are the rise and run.

Common uses

  • Coordinate geometry homework with the work shown
  • Finding a line's equation from two data points
  • Ramp, driveway, and roof steepness as slope, grade, or angle
  • Distance and midpoint in the same problem

Frequently asked questions

What's the slope formula?

m = (y₂ − y₁) ÷ (x₂ − x₁), the vertical change divided by the horizontal change, rise over run. The order doesn't matter as long as it's consistent: subtracting point 1 from point 2 in both numerator and denominator gives the same m as the reverse. The classic error is mixing orders (y₂ − y₁ over x₁ − x₂), which flips the sign, if your slope's sign disagrees with the picture (line clearly going uphill, negative m), that's the bug.

How do I get the equation of the line from the slope?

Push either known point through y = mx + b to find b: with m = 2 and point (1, 5), 5 = 2·1 + b gives b = 3, so y = 2x + 3. Alternatively use point-slope form directly, y − y₁ = m(x − x₁), which some teachers require and which needs no solving step. Both describe the same line; the calculator shows slope-intercept because it's the form that reads instantly (slope and y-crossing visible at a glance).

Why is a vertical line's slope undefined rather than infinite?

Because the run is zero and division by zero has no value, not a very large value. It's also directionless: approaching vertical from the left, slopes race toward +∞; from the right, toward −∞, so no single number works. Vertical lines are the one case y = mx + b can't express; they're written x = c instead. Distinct from zero slope, which is a perfectly ordinary horizontal line. Mixing those two up is a reliable test-point loss.

How does slope relate to grade and angle?

Three languages for the same steepness. Slope is the raw ratio (0.08), grade is that ratio as a percentage (8%, what road signs use), and the angle is arctan of the slope (4.6°). The counterintuitive one: a 100% grade is only 45°, not vertical, because it means equal rise and run. The calculator's angle output does the arctan for you. Useful for ramps (ADA maximum is 1:12, about 4.8°) and roof pitch conversations.

About this tool

The slope calculator takes two points and returns everything the coordinate-geometry problem set asks for: the slope with the rise-over-run arithmetic shown, the line's equation in y = mx + b form, the distance between the points, their midpoint, and the line's angle from horizontal, plus a live auto-scaled graph plotting both points, the line through them, and the rise/run legs as a dashed guide. Vertical lines are handled honestly (undefined slope, x = c equation) instead of erroring. Instant, local, and built for showing work.

Like most tools on UtilityBase, the slope calculator runs entirely in your browser. Nothing you enter is uploaded or stored on a server. It's free to use with no account required. Browse more calculators here.

Was this tool helpful?

Related tools