Slope Calculator

Calculate the slope, angle, and y-intercept of the line through two points.
Slope (m)
2

Rise over run between the two points.

Angle

63.434949°

y-intercept (b)

0

Equation

y = 2x + 0

Formula
m = (y₂ − y₁) ÷ (x₂ − x₁); angle = arctan(m); b = y₁ − m·x₁
Examples
InputResult
(1, 2) and (4, 8)m = 2, angle ≈ 63.43°, b = 0

About this calculator

The slope (or gradient) of a line measures how steeply it rises or falls. Given two points (x₁, y₁) and (x₂, y₂), the slope is the change in y divided by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁), often called "rise over run." A positive slope rises left to right, a negative slope falls, and a slope of zero is a horizontal line.

From the slope you can find the angle of inclination using the arctangent, and the y-intercept b with b = y₁ − m·x₁, which lets you write the full slope-intercept equation y = mx + b. When the two points have the same x-coordinate the line is vertical and the slope is undefined.

Frequently asked questions

Rise over run is the vertical change (rise) divided by the horizontal change (run) between two points. It is exactly the slope of the line.

A vertical line has no horizontal change, so the run is zero. Dividing the rise by zero is undefined, which is why vertical lines have no numeric slope.

Once you have the slope m, compute the y-intercept b = y₁ − m·x₁. The line is then y = mx + b in slope-intercept form.

Did this calculator help you?