InfyCalculator
➗

Slope of a Line Calculator

Find the slope of the line through two points, plus its rise, run and angle of inclination — with a vertical-line guard.

x₁
y₁
x₂
y₂
Loading calculator…

How it works

m = (y₂ − y₁) / (x₂ − x₁) · angle = arctan(m)

Slope measures how steeply a line climbs: the change in y (rise) for each unit of change in x (run). A slope of 2 means the line goes up 2 units for every 1 unit to the right; a negative slope falls. When the two points share the same x-value the run is zero, division is impossible, and the slope is undefined — the line is vertical.

Worked example

For points (1, 2) and (4, 8): rise = 8 − 2 = 6, run = 4 − 1 = 3, so m = 6 ÷ 3 = 2. The line rises at arctan(2) ≈ 63.43° from horizontal.

Sources: Slope — Wikipedia

Frequently asked questions

What does an undefined slope mean?

It means the line is vertical. Both points have the same x-coordinate, so the run is zero and you would be dividing by zero. Vertical lines are written x = constant instead of y = mx + b.

What is a zero slope?

A slope of 0 is a perfectly horizontal line — the y-values never change no matter how far you move along x. Its equation is y = constant.

How is slope related to angle?

The angle a line makes with the horizontal equals arctan(m). A slope of 1 is a 45° incline; larger slopes are steeper, and the angle approaches 90° as the line nears vertical.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.