Slope Calculator

Calculated on this device
X-coordinate of the first point
Y-coordinate of the first point
X-coordinate of the second point
Y-coordinate of the second point
SLOPE & LINE EQUATION
m = 2

Line equation: y = 2x

Angle (θ)63.43°
Distance (d)6.7082
Midpoint(2.5, 5)
Δx / Δy3 / 6

Vertical lines (Δx = 0) have undefined slope and a 90° angle of inclination.

HOW IT WORKS

Two-point slope, angle & line equation formulas

Given two distinct Cartesian points (x₁, y₁) and (x₂, y₂), the slope measures the rate of vertical change (rise) per unit of horizontal change (run).

01

Slope (m) & Angle (θ)

Divide the change in y by the change in x when Δx ≠ 0:

m = (y₂ − y₁) ÷ (x₂ − x₁) · θ = arctan(m)
02

Slope-Intercept Equation

Solve for the y-intercept b using either point:

b = y₁ − m·x₁ · y = mx + b
03

Distance & Midpoint

Segment length and center coordinate between the two points:

d = √(Δx² + Δy²) · Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2)

SLOPE & LINEAR EQUATIONS GUIDE

Interpreting positive, negative, zero, and undefined slopes

What slope tells you about a line

A positive slope rises from left to right, a negative slope falls from left to right, and a zero slope is flat (horizontal). When both points share the same x-coordinate, the run is zero—division by zero is undefined, producing a vertical line x = c. For 3D or geographic Earth distances, use our Distance Calculator.

Frequently asked questions

Why is the slope of a vertical line undefined?

Because x₂ − x₁ = 0, the slope formula requires dividing by zero, which is mathematically undefined. The line equation simplifies to x = x₁.

What is the difference between slope and angle of inclination?

Slope is the ratio rise / run, whereas the angle of inclination is arctan(m) measured in degrees from the positive x-axis (from -90° to +90°).

Does the order of Point 1 and Point 2 change the slope?

No. Swapping Point 1 and Point 2 negates both Δy and Δx, so the negative signs cancel and the slope remains identical.

How do I convert slope to percent grade?

Multiply the slope by 100. For example, a slope of 0.08 (8 ft rise per 100 ft run) equals an 8% grade.