Slope Calculator
- Free
- No sign-up
- Works on phones
- Shows the working
This slope calculator finds the slope of the line through two points and writes the equation of that line three ways: point-slope form, slope-intercept form \( y = mx + b \) and standard form \( Ax + By = C \). It also gives the angle the line makes with the x-axis and handles vertical lines, whose slope is undefined.
Fractions are kept exact, so a slope of \( -\frac12 \) is shown as a fraction rather than \( -0.5 \). It’s free, runs in your browser and needs no sign-up.
How to use the slope calculator
- Enter the first point as x₁ and y₁.
- Enter the second point as x₂ and y₂. Order doesn’t matter: swapping the points gives the same slope.
- Press Find slope.
- Read the slope \( m \), then the three forms of the line. Copy whichever form your class uses.
Formula
Slope is rise over run, the change in y divided by the change in x:
$$m = \frac{y_2 - y_1}{x_2 - x_1}$$
Once you have \( m \), the point-slope form uses either point:
$$y - y_1 = m(x - x_1)$$
Solving for y gives the slope-intercept form \( y = mx + b \), where \( b \) is the y-intercept. The angle with the positive x-axis is \( \theta = \arctan m \).
| Slope | Line |
|---|---|
| \( m > 0 \) | Rises from left to right |
| \( m < 0 \) | Falls from left to right |
| \( m = 0 \) | Horizontal, \( y = \text{constant} \) |
| Undefined | Vertical, \( x = \text{constant} \) |
Worked example: positive slope
Find the line through \( (1, 2) \) and \( (4, 11) \), the points in the calculator above.
Slope. \( m = \frac{11 - 2}{4 - 1} = \frac{9}{3} = 3 \).
Point-slope form. \( y - 2 = 3(x - 1) \).
Slope-intercept form. Expand: \( y = 3x - 3 + 2 = 3x - 1 \).
Standard form. \( 3x - y = 1 \). The angle is \( \arctan 3 \approx 71.57^\circ \).
Worked example: negative fractional slope
Through \( (-2, 3) \) and \( (4, 0) \): \( m = \frac{0 - 3}{4 - (-2)} = \frac{-3}{6} = -\frac12 \). Using the first point, \( y - 3 = -\frac12(x + 2) \), so \( y = -\frac12x + 2 \). Multiply by 2 and rearrange for standard form: \( x + 2y = 4 \).
Worked example: vertical line
Through \( (3, 1) \) and \( (3, 7) \) the run is \( 3 - 3 = 0 \), and you can’t divide by zero. The slope is undefined and the line is \( x = 3 \).
Tips and common mistakes
- Mixing the order. Use the same point first on top and bottom. \( \frac{y_2 - y_1}{x_1 - x_2} \) flips the sign.
- Subtracting negatives. \( 4 - (-2) = 6 \), not 2.
- Zero slope vs no slope. A horizontal line has slope 0. A vertical line has undefined slope.
- Parallel and perpendicular lines. Parallel lines share a slope. Perpendicular slopes multiply to \( -1 \), so the perpendicular to \( m = 3 \) has \( m = -\frac13 \).
From slope to derivatives
The slope between two points on a curve is the slope of a secant line. Slide the second point toward the first and the secant becomes the tangent line; its slope is the derivative. That’s the idea behind the equation of a tangent line and the tangent line calculator, which computes \( f'(a) \) and builds \( y - f(a) = f'(a)(x - a) \) for you.
Related guides
- Slope Formula, Point-Slope and Slope-Intercept Form
- Equation of a Tangent Line
- Distance and Midpoint Formula
- Domain and Range of a Function
Further reading
- Slope (Wikipedia) — definitions, notation and the link between slope, angle and gradient.
- Lines (Paul’s Online Math Notes) — slope, the forms of a line, and parallel and perpendicular lines.
FAQ
How do you find the slope from two points?
Subtract the y-values and divide by the difference of the x-values in the same order: \( m = \frac{y_2 - y_1}{x_2 - x_1} \).
What is the slope of a vertical line?
It’s undefined, because the run \( x_2 - x_1 \) is zero. The equation of a vertical line is \( x = c \).
How do I turn point-slope form into y = mx + b?
Distribute the slope and add \( y_1 \) to both sides. \( y - 2 = 3(x - 1) \) becomes \( y = 3x - 1 \).
What does the angle output mean?
It’s the angle between the line and the positive x-axis, \( \arctan m \), in degrees. Negative angles mean the line falls from left to right.
