math

Slope Calculator

Find the slope, distance, and midpoint between two coordinate points.

retro matrix layoutHOLA-SERIES // ANALYZER
LCD OUTPUT STATUS // DEG MATH
Slope (m)2.0000
Y-Intercept (b):0.0000
Equation:y = 2.00x + 0.00
Distance:6.7082
Midpoint:(2.50, 5.00)

Recent Calculations

No calculations yet — results will appear here automatically.

About the Slope Calculator

A slope calculator finds the gradient between two points, along with the distance separating them and their midpoint. Slope measures steepness and rate of change, which makes it central to coordinate geometry, road and ramp design, and reading any graph.

The formula

m = (y₂ − y₁) / (x₂ − x₁)

m is the slope — vertical change divided by horizontal change, or rise over run. The distance between the points is √((x₂−x₁)² + (y₂−y₁)²) and the midpoint is the average of the coordinates.

How to use this calculator

  1. 1Enter your Point 1: x₁. The field starts at 1, which you can overwrite.
  2. 2Enter your Point 1: y₁. The field starts at 2, which you can overwrite.
  3. 3Enter your Point 2: x₂. The field starts at 4, which you can overwrite.
  4. 4Enter your Point 2: y₂. The field starts at 8, which you can overwrite.
  5. 5Read the result straight away — it recalculates as you type, so there is no button to press. Use Share to copy a link that reopens the page with your exact numbers filled in.

Worked example

Example inputs and the resulting output for the Slope Calculator
InputValue
Point 1: x₁1
Point 1: y₁2
Point 2: x₂4
Point 2: y₂8

Result

Slope (m): 2.0000

Y-Intercept (b): 0.0000

Equation: y = 2.00x + 0.00

Distance: 6.7082

Midpoint: (2.50, 5.00)

Those are the values the page loads with, so you can reproduce this result yourself and then change one field at a time to see what drives the outcome.

Understanding your result

Slope is a rate of change, and that is what makes it useful beyond geometry. On a distance-time graph the slope is speed; on a cost-quantity graph it is unit cost. A positive slope rises left to right, a negative one falls, zero is horizontal, and a vertical line has undefined slope because the run is zero.

Two related facts do a lot of work. Parallel lines have equal slopes, and perpendicular lines have slopes whose product is −1 — so a line of slope 2 is perpendicular to one of slope −1/2. That relationship is how you construct right angles in coordinate geometry without measuring.

Things worth knowing

  • Keep the order of subtraction consistent between numerator and denominator, or the sign will be wrong.
  • A vertical line has undefined slope, not infinite slope. The run is zero, so the division is undefined.
  • Slope as a percentage is rise over run times 100 — the form used for road gradients and accessibility ramps.
  • Perpendicular slopes are negative reciprocals of each other.
  • Once you have the slope, the line's equation follows from point-slope form: y − y₁ = m(x − x₁).

Frequently asked questions

How do I calculate slope from two points?+

Divide the change in y by the change in x. From (1, 2) to (4, 8), the slope is (8 − 2) ÷ (4 − 1) = 2, meaning the line rises 2 units for every 1 it moves right.

What does a negative slope mean?+

The line falls as it moves right — y decreases while x increases. On a graph of value over time, a negative slope means decline.

Why is the slope of a vertical line undefined?+

Because the horizontal change is zero, and dividing by zero has no defined result. A vertical line has infinite steepness in an informal sense but no numerical slope.

How do I find the midpoint between two points?+

Average the x-coordinates and average the y-coordinates. Between (1, 2) and (4, 8) the midpoint is (2.5, 5).

Related math calculators