Skip to main content

Slope Calculator

From two points: slope, y-intercept, line equation, angle of inclination, and distance.

Written by Golam Rabbani, Founder & Lead Engineer

Enter two points (x₁, y₁) and (x₂, y₂) on the line.

Point 1

Point 2

How to use this slope calculator

  1. Enter the coordinates of the first point as x₁ and y₁.
  2. Enter the coordinates of the second point as x₂ and y₂.
  3. Press Calculate. The tool returns the slope, y-intercept, slope-intercept form, point-slope form, angle of inclination, and the distance between the points.
  4. Use Copy to save the full breakdown to your clipboard.
  5. Press Reset to clear all four coordinates.

About this slope calculator

The slope calculator finds the slope of the line through two points using m = (y₂ − y₁) / (x₂ − x₁), then derives the rest of the line’s identity: the y-intercept b = y₁ − m·x₁, the slope-intercept equation y = mx + b, the point-slope form y − y₁ = m(x − x₁), the angle of inclination θ = arctan(m), and the distance between the points using the Pythagorean theorem √((x₂ − x₁)² + (y₂ − y₁)²).

As a worked example, enter (1, 2) and (4, 8). Then Δx = 3, Δy = 6, so the slope m = 6 / 3 = 2. The y-intercept is b = 2 − 2·1 = 0, the slope-intercept form is y = 2x, the point-slope form is y − 2 = 2(x − 1), the angle of inclination is arctan(2) ≈ 63.43°, and the distance between the two points is √(3² + 6²) = √45 ≈ 6.708.

Vertical lines (where x₁ = x₂) produce an undefined slope; the tool handles this case explicitly and returns the line equation as x = x₁ rather than crashing or printing Infinity.

FAQ

What does a negative slope mean?
A negative slope means the line goes down from left to right. As x increases by 1, y decreases by |m|.
What does the angle of inclination tell me?
It is the angle the line makes with the positive x-axis, measured counter-clockwise. The tool reports it in degrees with the equivalent in radians shown next to it.
How do you handle a vertical line?
When x₁ = x₂ the slope is undefined. Instead of returning Infinity, the tool reports the line as x = x₁ and flags the slope as undefined.
What if both points are the same?
Two identical points do not define a unique line. The calculator detects this and asks you to enter two distinct points.
How is distance computed?
The distance is the straight-line (Euclidean) distance: √((x₂ − x₁)² + (y₂ − y₁)²). Units match whatever units you used for the coordinates.
Is the calculator free?
Yes. All arithmetic happens in your browser with no signup and no upload.