Slope & Line Equations Calculator
Enter your values
Enter your values and press Calculate — your answer, visual and step-by-step solution appear here.
What Is Slope? (The Short Answer)
Slope measures the steepness and direction of a line. It tells you how much y changes for every one-unit increase in x. A positive slope rises left to right; a negative slope falls; a zero slope is flat; an undefined slope is vertical.
The variables x₁, y₁ and x₂, y₂ are the coordinates of any two points on the line. It doesn't matter which point you call "1" or "2" — the result is always the same.
The Slope Formula
The formula m = (y₂ − y₁) / (x₂ − x₁) calculates the rise (vertical change) divided by the run (horizontal change). Rise goes in the numerator, run goes in the denominator — a detail students frequently mix up.
| Symbol | What It Means | Example (points (2,3) and (6,7)) |
|---|---|---|
| y₂ − y₁ | Rise — vertical change | 7 − 3 = 4 |
| x₂ − x₁ | Run — horizontal change | 6 − 2 = 4 |
| m | Slope | 4 / 4 = 1 |
A slope of 1 means the line rises 1 unit for every 1 unit it moves right — a 45° angle.
How to Find Slope From Two Points (Step by Step)
Use the points (1, 2) and (5, 10) as a worked example:
- Label your points. Call (1, 2) point 1 and (5, 10) point 2. So x₁ = 1, y₁ = 2, x₂ = 5, y₂ = 10.
- Find the rise. y₂ − y₁ = 10 − 2 = 8.
- Find the run. x₂ − x₁ = 5 − 1 = 4.
- Divide rise by run. m = 8 / 4 = 2.
- Interpret the result. A slope of 2 means the line rises 2 units for every 1 unit it moves to the right.
Types of Slope — Positive, Negative, Zero, and Undefined
| Type | Value | What the Line Looks Like | Example Points |
|---|---|---|---|
| Positive | m > 0 | Rises left to right | (0,0) and (3,6) → m = 2 |
| Negative | m < 0 | Falls left to right | (0,4) and (2,0) → m = −2 |
| Zero | m = 0 | Perfectly horizontal | (1,5) and (4,5) → m = 0 |
| Undefined | m = ∞ | Perfectly vertical | (3,1) and (3,7) → division by zero |
For an undefined slope, the formula produces division by zero (x₂ − x₁ = 0). This isn't a calculation error — it's telling you the line is vertical, which has no defined slope.
Slope and Line Equations
Once you have the slope, you can write the equation of the line in several forms. Each form is useful in different situations.
Slope-Intercept Form: y = mx + b
This is the most common form. m is the slope and b is the y-intercept (where the line crosses the y-axis). If you know the slope and any point on the line, you can find b by substituting: b = y − mx.
Point-Slope Form: y − y₁ = m(x − x₁)
Use this form when you have a slope and one point but haven't found the y-intercept yet. It's faster than converting to slope-intercept form first, especially on exams. Just substitute m, x₁, and y₁ directly.
Parallel and Perpendicular Lines
Parallel lines have the same slope. If one line has slope 3, any parallel line also has slope 3.
Perpendicular lines have slopes that are negative reciprocals of each other. In plain English: flip the fraction and change the sign. A line with slope 2/3 is perpendicular to a line with slope −3/2.
| Relationship | Rule | Example |
|---|---|---|
| Parallel | Same slope: m₂ = m₁ | m₁ = 4 → m₂ = 4 |
| Perpendicular | Negative reciprocal: m₂ = −1/m₁ | m₁ = 2/3 → m₂ = −3/2 |
Common Mistakes to Avoid
Frequently Asked Questions
-
Why is slope represented by the letter m?
The exact origin is debated — most historians attribute it to the French word "monter" (to climb) or simply to the fact that m was the next convenient letter after the axes were assigned x and y. Whatever the origin, m for slope is universal in algebra textbooks.
-
Can slope be a fraction or decimal?
Yes. Slope is simply a ratio of rise to run, and that ratio can be any real number — a whole number, fraction, decimal, positive, negative, or zero. A slope of 1/2 means the line rises 1 unit for every 2 units of horizontal movement.
-
What is the slope of a horizontal line?
Zero. A horizontal line has no rise — every point has the same y-value. So the numerator (y₂ − y₁) equals zero, and 0 divided by any non-zero run equals 0.
-
What is the slope of a vertical line?
Undefined. A vertical line has no run — every point has the same x-value. The denominator (x₂ − x₁) equals zero, and division by zero is undefined in mathematics.
-
How is slope used in real life?
Slope appears any time a rate of change matters: the steepness of a ramp or road grade, the pitch of a roof, speed (distance over time on a position graph), or the rate at which a quantity grows. In calculus, the derivative generalises slope to curved functions.