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. Also, 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. As a result, 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. However, 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.

From slope to the equation of a line
Once you have the slope \( m \) and one point \( (x_1, y_1) \), use the point-slope form
$$y - y_1 = m(x - x_1)$$
Through \( (2, 3) \) with slope 4: \( y - 3 = 4(x - 2) \), so \( y = 4x - 5 \). Through \( (1, 2) \) and \( (4, 11) \): the slope is \( 9/3 = 3 \), so \( y - 2 = 3(x - 1) \), or \( y = 3x - 1 \).
Parallel and perpendicular lines
- Parallel lines have equal slopes.
- Perpendicular lines have slopes that multiply to −1. For example, a line perpendicular to slope 2 has slope \( -\frac{1}{2} \).
- A horizontal line (slope 0) is perpendicular to a vertical line (undefined slope).
Slope as a rate of change
Slope is “change in output per unit of input”, so it carries units:
- A price that went from $50 in 2010 to $80 in 2020 rose at \( 30/10 = \$3 \) per year.
- A road with an 8% grade rises 8 m for every 100 m horizontally; its angle is \( \arctan(0.08) \approx 4.57° \).
- On a distance–time graph, slope is speed.
For curves, the slope changes from point to point, and the derivative gives the slope at each point.
Slope from an equation
Rewrite the equation as \( y = mx + b \). For \( 3x + 2y = 12 \): \( y = -\frac{3}{2}x + 6 \), so the slope is \( -\frac{3}{2} \) and the y-intercept 6. In general, \( Ax + By = C \) has slope \( -A/B \).
Common mistakes
- Subtracting in different orders for \( x \) and \( y \).
- Calling a vertical line’s slope 0 (it is undefined) or a horizontal line’s slope undefined (it is 0).
Slope in statistics
A line of best fit through data points has a slope that tells you how much \( y \) changes, on average, for each unit of \( x \).
Practice problems
- Slope through \( (-3, 4) \) and \( (5, -2) \).
- Equation of the line through \( (0, -1) \) perpendicular to \( y = 3x + 7 \).
- A tank drains from 900 L to 300 L in 12 minutes. What is the rate?
Answers: 1. \( -6/8 = -\frac{3}{4} \). 2. \( y = -\frac{1}{3}x - 1 \). 3. −50 L per minute.
Step-by-Step Guide for the Slope Calculator
First, identify your two distinct points. Each point has an x-coordinate and a y-coordinate. For instance, you might have point A (2, 5) and point B (8, 17).
Next, locate the input fields on the slope calculator. These are usually labeled 'x1', 'y1', 'x2', and 'y2'. Enter the coordinates of your first point into the 'x1' and 'y1' fields. So, for point A (2, 5), you would enter 2 for x1 and 5 for y1.
Then, input the coordinates of your second point into the 'x2' and 'y2' fields. For point B (8, 17), you would enter 8 for x2 and 17 for y2. Remember, the order of the points does not affect the final slope calculation. However, maintaining consistency for each point is important.
Finally, activate the calculation. This is typically done by clicking a button labeled 'Calculate Slope' or 'Find Slope'. The calculator will then display the slope and potentially other related information, such as the line's equation.
Checking Your Result: A Simple Test
After using the slope calculator, it is wise to quickly check if your answer makes sense. For example, visually imagine the two points on a graph. Does the line between them go up, down, or stay flat? This visual check helps confirm the sign of your calculated slope.
For example, if your line rises from left to right, the slope should be positive. If it falls, the slope must be negative. A horizontal line will have a slope of zero. Conversely, a vertical line results in an undefined slope.
Consider substituting one of your original points back into the equation of the line provided by the calculator. If the equation holds true, your slope and equation are consistent. This method offers a strong verification of accuracy.
When a Numerical Slope Is Not Enough
Sometimes, simply knowing the numerical value of the slope is insufficient. You might need to understand its real-world implication. For instance, slope often represents a rate of change in physics, economics, or engineering.
If the context involves time and distance, the slope could signify speed. In financial analysis, for example, it might show a trend in prices over time. Always consider the units of your x and y values. The slope's units will be 'units of y per unit of x'.
Furthermore, if you are analyzing a curve rather than a straight line, the slope between two distant points is only an average. For precise analysis of curves, calculus and derivatives are necessary. These tools provide the instantaneous rate of change at any single point on the curve.
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.
