MATH CALCULATOR

Slope Calculator

Enter two points to find the slope and equation of the line through them. Vertical lines are identified separately.

Calculator

YOUR RESULTS
Slope2
Rise (Δy)
8
Run (Δx)
4
Y-intercept
0
Line equation
y = 2x
Distance between points
8.944272

Slope is rise divided by run. Coefficients are shown to ten significant digits.

Rise, run, slope, and vertical lines

Rise and run retain their signs in the order entered. Distance is nonnegative. A vertical line has no finite slope or y-intercept; identical points do not define a unique line.

The formula

m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − mx₁; y = mx + b; distance = √[(Δx)² + (Δy)²].

The numerator measures the change in the vertical coordinate and the denominator the change in the horizontal coordinate. For a nonvertical line, substituting either point gives the same intercept. Distance uses the Pythagorean theorem.

Worked example

Points (1, 2) and (5, 10) give rise 8, run 4, slope 2, intercept 0, and y = 2x. Their distance is √80, approximately 8.944272 coordinate units.

How to use this calculator

  1. Enter x and y for each point in the same coordinate system.
  2. Calculate and read the signed rise and run.
  3. Use the equation to evaluate another point on the straight line.

Reading positive and negative slopes

A positive slope means y increases as x increases. A negative slope means y decreases as x increases. Reversing the order of the two points changes both rise and run signs, so the slope stays the same. A larger absolute slope describes a steeper line only when the axis scales are comparable.

Horizontal, vertical, and repeated points

Equal y-coordinates and different x-coordinates produce a horizontal line with slope zero. Equal x-coordinates and different y-coordinates produce the equation x = constant. Two identical coordinates provide only one point, so the tool asks for a different second point instead of inventing a slope.

Choosing an appropriate next calculation

A line through two observations is an exact geometric construction. It does not establish a trend in a larger dataset. To estimate a value between measured endpoints, use linear interpolation. For a physical gradient, record coordinate units because a slope measured in meters per second differs from one measured in meters per meter.

Assumptions & limitations

What this calculation assumes

  • Both points share one Cartesian coordinate system.

What to keep in mind

  • No regression, curved fit, or measurement-uncertainty estimate; line coefficients are displayed to ten significant digits.

Common questions

Can the slope be greater than one?

Yes. A rise of 8 and a run of 4 produce slope 2. Slope has no general upper bound.

Why is a vertical slope undefined?

Its horizontal change is zero, so rise divided by run would require division by zero.

Sources & further reading