Slope calculator
Enter two coordinate points and get the slope, the line equation in slope-intercept form, the distance between points, and the midpoint.
Slope (m)
—
y-intercept (b)
—
Equation
—
Distance
—
Midpoint
—
Angle
—
Saved to favorites
Your favorites are on the home page under “Your favorites.” They are saved only in this browser on this device, so they will not appear on another device or browser. No account, no server.
Formulas
Slope: m = (y₂ - y₁) / (x₂ - x₁)
y-intercept: b = y₁ - m × x₁
Equation: y = mx + b
Distance: d = √((x₂-x₁)² + (y₂-y₁)²)
Midpoint: M = ((x₁+x₂)/2, (y₁+y₂)/2)
Special cases
| Case | Slope | Equation |
|---|---|---|
| Horizontal line | 0 | y = b |
| Vertical line | undefined | x = a |
| Positive slope | m > 0 | rises left to right |
| Negative slope | m < 0 | falls left to right |
References
- Slope (rise over run)Wikipedia · en.wikipedia.org
- SlopeWolfram MathWorld · mathworld.wolfram.com
Frequently asked
What is slope?
Slope (m) = (y₂ - y₁) / (x₂ - x₁). It measures how steeply a line rises or falls. A positive slope goes up left to right; negative goes down; zero is horizontal; undefined (infinity) is vertical.
What is the slope-intercept form?
y = mx + b, where m is the slope and b is the y-intercept (where the line crosses the y-axis).
How do I find the y-intercept from two points?
First calculate m, then b = y₁ - m × x₁. The calculator does this automatically.
What is the distance formula?
Distance = √((x₂-x₁)² + (y₂-y₁)²). This is the Euclidean distance between the two points, which equals the hypotenuse of the right triangle formed by dx and dy.
How do I share my calculation?
Click "Share with my numbers" to copy a URL that saves all four coordinates.
Embed this calculator
Add this free calculator to your own site. Copy the snippet — it works anywhere you can paste HTML, and stays in sync with this page.