Slope From Two Points Calculator
Use this free slope from two points calculator to find the slope of the line through any two coordinate points. Enter (x₁, y₁) and (x₂, y₂) to get the slope as an exact fraction, a decimal, the rise and run, the angle of inclination, and the full equation of the line in slope-intercept form — plus an interactive graph. Vertical lines (undefined slope) and horizontal lines (slope = 0) are handled automatically.
How to Use the Slope From Two Points Calculator
- Enter the coordinates of the first point (x₁, y₁).
- Enter the coordinates of the second point (x₂, y₂).
- Click Calculate Slope. The result shows the slope as a reduced fraction, a decimal, the rise, the run, the angle of inclination, and the line equation.
- If x₁ = x₂ the line is vertical and the slope is reported as undefined.
Formula & Calculation Method
The slope of the line through two points (x₁, y₁) and (x₂, y₂) is defined as the change in y divided by the change in x:
m = (y₂ − y₁) / (x₂ − x₁) = rise / run
Where:
- rise = y₂ − y₁ (vertical change)
- run = x₂ − x₁ (horizontal change)
- m > 0 — line rises left-to-right; m < 0 — line falls
- m = 0 — horizontal line (rise = 0)
- x₁ = x₂ — vertical line; slope is undefined (run = 0)
The angle of inclination θ (in degrees) satisfies tan θ = m, so θ = arctan(m), reported in the range (0°, 180°) as the standard convention for a directed line.
The line itself can be written in slope-intercept form: y = m·x + b, where b = y₁ − m·x₁.
Worked Example
Find the slope through (1, 2) and (5, 5).
| Step | Calculation | Result |
|---|---|---|
| Rise | y₂ − y₁ = 5 − 2 | 3 |
| Run | x₂ − x₁ = 5 − 1 | 4 |
| Slope | m = 3 / 4 | 0.75 |
| Angle | arctan(0.75) | ≈ 36.87° |
| Equation | y = 0.75x + 1.25 | |
Interpreting the Result
- Positive slope (m > 0) — the line rises as x increases (e.g., m = 2 is steeper than m = 0.5).
- Negative slope (m < 0) — the line falls as x increases.
- Zero slope (m = 0) — horizontal line; y is constant, y = y₁ = y₂.
- Undefined slope — vertical line; x is constant, x = x₁ = x₂.
- Angle of inclination — 0° < θ < 90° for positive slope, 90° < θ < 180° for negative slope, 0° for horizontal, 90° for vertical.
- Steepness — |m| > 1 is steep; |m| < 1 is shallow.
Assumptions and Limits
- Both points must have distinct x-coordinates for a finite slope; x₁ = x₂ gives a vertical line with undefined slope.
- All four coordinates must be finite real numbers; blank or non-numeric inputs are rejected.
- Exact slope is expressed as a reduced fraction when both rise and run are rational; otherwise the decimal is shown to 6 significant figures.
- Angle of inclination is computed with
atan2(rise, run)so it correctly covers quadrants — the tool returns the acute angle with the horizontal for clarity, plus a note for obtuse inclinations. - Floating-point comparisons use a 1e-12 tolerance to avoid false positives when x₁ ≈ x₂ or rise ≈ 0.
Frequently Asked Questions
What is the slope formula for two points?
The slope through (x₁, y₁) and (x₂, y₂) is m = (y₂ − y₁) / (x₂ − x₁). It represents the change in y divided by the change in x — commonly called “rise over run.”
What does the slope of a line tell you?
The slope measures a line's steepness and direction: positive slopes rise left-to-right, negative slopes fall, zero slope is horizontal, and undefined slope is vertical. Its magnitude tells you how steep the line is.
What if the run is zero?
If x₂ = x₁, the run is zero, so division by zero makes the slope undefined. The line is vertical and its equation is x = x₁.
Can a slope be negative?
Yes. A negative slope means the line goes down as you move to the right. For example, the slope through (0, 5) and (5, 0) is m = (0 − 5)/(5 − 0) = −1.
How do I find the slope of a vertical line?
Vertical lines have an undefined slope because the run (horizontal change) is zero. You cannot express a vertical line as y = mx + b; instead, write it as x = c.
How is the angle of inclination related to the slope?
The angle of inclination θ satisfies tan θ = m. For a positive slope, θ is between 0° and 90°; for a negative slope, θ is between 90° and 180°. A horizontal line has θ = 0° and a vertical line has θ = 90°.
What is the difference between slope and the angle between two vectors?
Slope is the tangent of the angle a line makes with the positive x-axis. The angle between two vectors uses a different formula involving the dot product. For a single line, angle of inclination is simpler: θ = arctan(m).
Can the calculator return an exact fraction?
Yes. When both the rise and run are rational (integers or terminating decimals), the slope is shown as a fraction reduced to lowest terms, alongside its decimal approximation.