The slope of a line is its steepness and direction — rise over run, the change in y divided by the change in x between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). From the slope and one point you get everything else about the line: the angle it makes with the horizontal, its y-intercept, and its equation y = mx + b. This calculator works all of those out at once, plus the straight-line distance between your two points.
Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the standard slope, intercept and distance formulas, recomputed in code.
The formulas
The slope is the heart of it: positive means the line rises left-to-right, negative means it falls, zero is flat. The angle comes from the arctangent of the slope. The y-intercept b is found by rearranging y = mx + b for the known point. And the distance — the length of the segment between the points — uses the Pythagorean-based distance formula. If x₂ = x₁, the run is zero, so the slope is undefined and the line is vertical.
Worked example — (1, 2) to (4, 8)
Scenario: find the slope and line through (1, 2) and (4, 8).
The line has slope 2 — it rises two units for every one across — makes a 63.43° angle with the horizontal, and its equation is y = 2x (it passes through the origin, so b = 0). The two points are 6.7082 units apart. Change the points and the calculator handles every case: a flat line gives slope 0, and equal x-values give an undefined slope (a vertical line).
Frequently Asked Questions
m = (y₂ − y₁) ÷ (x₂ − x₁). For (1,2)→(4,8): 6 ÷ 3 = 2.
y = mx + b, with b = y₁ − m·x₁. For (1,2)→(4,8): y = 2x.
Positive rises, negative falls, zero is flat. Equal x = vertical = undefined.
angle = arctan(m). Slope 1 = 45°, slope 2 ≈ 63.43°.
Angle, y-intercept, line equation, and distance √((Δx)²+(Δy)²).