NumberSwift.
Global
MATH · GEOMETRY

Slope Calculator

Find the slope between two points and the line equation in slope-intercept and point-slope form, plus angle, distance and midpoint, step by step.

YOUR NUMBERS

◎ Calculations stay in your browser.

A LITTLE CLARITY

Slope

2
Line equationy = 2x + 0
Point-slope equationy - 2 = 2(x - 1)
Standard-form equation4x + -2y = 0
Inclination from positive x-axis63.43 degrees
Distance between points4.472135955
Midpoint(2, 4)
WorkingRise = 4; run = 2. Slope = rise ÷ run.

Cartesian coordinates in consistent units. The two points must differ. Angle is the signed arctangent of the slope, between −90° and 90°; a vertical line is shown at 90°. This is not a geodesic distance calculation.

Formula checked · NumberSwift · Review process

BEHIND THE NUMBERS

How this calculator works

A line through two distinct points has slope equal to its vertical change divided by its horizontal change. The same coordinates determine its equation, midpoint and point-to-point distance. Vertical lines are represented by x = constant, with an undefined slope; horizontal lines have zero slope. The working states the rise and run explicitly.

Formula

m = (y₂ − y₁) / (x₂ − x₁); b = y₁ − mx₁; distance = √((Δx)² + (Δy)²); midpoint = ((x₁+x₂)/2, (y₁+y₂)/2).

Assumptions & limitations

Cartesian coordinates in consistent units. The two points must differ. Angle is the signed arctangent of the slope, between −90° and 90°; a vertical line is shown at 90°. This is not a geodesic distance calculation.

Worked example

Points (1,2) and (3,6) give rise 4, run 2 and slope 2. The line is y = 2x, midpoint (2,4), and distance √20 ≈ 4.4721.

Useful next calculations

Choose a related task to continue with the right assumptions:

Our approach to calculations ↗
GOOD TO KNOW

Common questions

What happens when x coordinates are equal?

The line is vertical. Its slope is undefined because the run is zero, and its equation is x = that coordinate.

Can the slope be negative?

Yes. A line descending as x increases has a negative slope.

Why are identical points rejected?

One point lies on infinitely many lines. Two distinct points are required to determine a unique line.