# Slope calculator

> Enter two coordinate points and get the slope, the line equation in slope-intercept form, the distance between points, and the midpoint.

Calculate slope, y-intercept, line equation, distance, midpoint, and angle from two coordinate points. Supports all line types.

**Interactive version:** https://onlinecalculator.me/math/slope/
**Category:** Math

## 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 |

## Frequently asked questions

### 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.

## Sources

- [Slope (rise over run)](https://en.wikipedia.org/wiki/Slope) — Wikipedia
- [Slope](https://mathworld.wolfram.com/Slope.html) — Wolfram MathWorld

## Related calculators

- [Distance formula calculator](https://onlinecalculator.me/math/distance-formula/) — Distance and midpoint between two coordinate points.
- [Right triangle calculator](https://onlinecalculator.me/math/right-triangle/) — Solve right triangles from any two known values.
- [Quadratic formula calculator](https://onlinecalculator.me/math/quadratic/) — Roots of ax squared plus bx plus c.
- [Percentage calculator](https://onlinecalculator.me/math/percentage/) — Percent of a number and other percentage problems.

---

Part of [onlinecalculator.me](https://onlinecalculator.me/) — free calculators that run entirely in your browser.
Machine-readable index: https://onlinecalculator.me/llms.txt
