Slope Calculator (Two Points)
Find the slope, y-intercept, line equation y = mx + b, and angle from two points — runs 100% in your browser with no upload.
Equation: y = 2x Slope (m): 2 Y-intercept (b): 0 Angle: 63.434949°
🔒 Calculated instantly in your browser — nothing is uploaded.
What this slope calculator does
Enter the coordinates of two points, (x₁, y₁) and (x₂, y₂), and this tool instantly computes the slope of the line through them, the y-intercept, the full equation in slope-intercept form y = mx + b, and the angle the line makes with the horizontal in degrees. Everything updates live as you type, so you can experiment with different coordinates and watch the equation change immediately.
How the slope is calculated
The slope m is the rise over the run: m = (y₂ − y₁) / (x₂ − x₁). Once the slope is known, the y-intercept b comes from b = y₁ − m·x₁, giving the equation y = mx + b. The angle of inclination is atan(m) converted to degrees. When both points share the same x value the line is vertical, the slope is undefined, and the tool reports the equation as x = c instead of forcing an incorrect number.
Frequently asked questions
How do I find the slope from two points?
Divide the change in y by the change in x: slope = (y₂ − y₁) / (x₂ − x₁). Enter both points above and the tool does this for you and also shows the y-intercept, equation, and angle.
Why does it say the slope is undefined?
When the two points have the same x-coordinate the line is vertical. A vertical line has no defined slope, so the tool shows its equation as x = c and reports the angle as 90 degrees.
Is anything I type uploaded to a server?
No. Every calculation runs locally in your browser with JavaScript. The coordinates you enter are never sent, stored, or logged anywhere.