Slope Calculator

Find the slope of a line from two points. This free slope calculator gives the slope, y-intercept, full equation (y = mx + b), angle and the distance between the points.

Two points
Point 1
x₁
y₁
Point 2
x₂
y₂

Enter the coordinates of two points. The slope is the rise over the run: (y₂ − y₁) ÷ (x₂ − x₁). A vertical line (same x) has an undefined slope.

Slope (m)
—
Enter both points
Line equation
—
y-intercept (b)
—
Angle
—
Δx (run)
—
Δy (rise)
—
Distance between points
—

Slope measures steepness: positive rises left-to-right, negative falls, zero is flat. The equation is in slope-intercept form, y = mx + b.

How the Slope Calculator Works

Given any two points on a line, this calculator finds the slope, the full line equation, the angle the line makes with the horizontal, and the straight-line distance between the points.

Formula: Slope m = (y₂ − y₁) ÷ (x₂ − x₁), i.e. rise over run. The y-intercept is b = y₁ − m × x₁, giving the line equation y = mx + b. The angle of the line is angle = atan(m) × 180 ÷ π, expressed in degrees. The distance between the two points is distance = √((x₂ − x₁)^2 + (y₂ − y₁)^2). When x₁ equals x₂ (a vertical line), the slope and angle are undefined/90°, since division by zero (run = 0) has no result.

  • x₁, y₁ — coordinates of Point 1
  • xâ‚‚, yâ‚‚ — coordinates of Point 2

Example Scenarios

Point 1 (x₁, y₁)Point 2 (x₂, y₂)Slope (m)
(1, 2)(3, 6)2
(0, 0)(4, 2)0.5
(2, 5)(2, 9)Undefined (vertical line)
(-3, 4)(5, -4)-1
(1, 1)(5, 1)0 (horizontal line)
(0, 10)(10, 0)-1

Slope Calculator FAQ

What does it mean when the slope is undefined?The slope is undefined when both points share the same x-coordinate, making the line perfectly vertical. Since slope is rise divided by run, and the run (xâ‚‚ − x₁) is zero in this case, the division has no valid result — the calculator reports it as “undefined” rather than a number.
How do I find the y-intercept from two points?Once you know the slope m, plug either point into b = y − mx. This calculator uses Point 1’s coordinates (b = y₁ − m × x₁) to solve for b, then reports the full line equation as y = mx + b.
What’s the difference between slope and angle?Slope is a ratio (rise over run) describing steepness, while angle converts that ratio into degrees using the arctangent function, angle = atan(m) × 180/Ï€. A slope of 1 corresponds to a 45° angle, but slope and angle don’t scale together linearly for other values.
Can the slope be zero, and what does that mean?Yes — a slope of zero means the line is perfectly horizontal, with no rise between the two points (y₁ equals y₂) regardless of how far apart they are on the x-axis. The line equation simplifies to y = b, a constant.
How is the distance between two points related to slope?They’re calculated from the same differences but combined differently. Slope divides the vertical change (Δy) by the horizontal change (Δx), while distance combines both changes using the Pythagorean theorem: √(Δx² + Δy²), giving the straight-line length between the points regardless of direction.
What does a negative slope tell me about a line?A negative slope means the line falls as you move left to right — as x increases, y decreases. This is the opposite of a positive slope, where the line rises left to right; the steeper the negative value, the more sharply the line descends.

Related Calculators

The distance formula here relies on square roots, so the square root calculator is a handy companion for checking that step by hand. If your two points come from a quadratic equation’s graph, the quadratic formula calculator can find its roots, and the triangle calculator extends these same coordinate-geometry ideas to angles and side lengths.

Related Calculators