What Is Slope?
Slope is a measure of how steep a line is. In coordinate geometry, it tells you how much the line rises or falls vertically for every unit it moves horizontally. Slope is often called the gradient, and it appears everywhere — from algebra class to physics, engineering, economics, and data analysis.
The larger the absolute value of the slope, the steeper the line. A slope of zero means a flat horizontal line, while an undefined slope describes a perfectly vertical line. Understanding slope is essential for graphing equations, interpreting rates of change, and comparing how two quantities relate.
The Slope Formula
Given two points on a line, P₁(x₁, y₁) and P₂(x₂, y₂), the slope m is calculated as:
m = (y₂ − y₁) / (x₂ − x₁)
The numerator (y₂ − y₁) is the vertical change, called the rise. The denominator (x₂ − x₁) is the horizontal change, called the run. This is why slope is often described as “rise over run.”
Rise Over Run
Rise over run is the simplest way to think about slope. If you move from one point to another on a line:
- Rise = how far you go up or down (positive = up, negative = down).
- Run = how far you go left or right (usually we move to the right, so run is positive).
- Slope = rise ÷ run.
A slope of 2 means the line rises 2 units for every 1 unit it runs to the right. A slope of −0.5 means it falls half a unit for every unit to the right.
Types of Slope
Positive Slope
A line with a positive slope rises from left to right. As x increases, y also increases. Example: m = 3 means the line goes up 3 units for every 1 unit right.
Negative Slope
A line with a negative slope falls from left to right. As x increases, y decreases. Example: m = −2 means the line drops 2 units for every 1 unit right.
Zero Slope
A horizontal line has a slope of zero. The rise is 0 because y₂ = y₁. The line neither rises nor falls — it stays flat.
Undefined Slope
A vertical line has an undefined slope. The run is 0 because x₂ = x₁, and division by zero is undefined. The line goes straight up and down.
How to Calculate Slope from Two Points
- Label the first point (x₁, y₁) and the second point (x₂, y₂).
- Subtract the y-values: y₂ − y₁ (this is the rise).
- Subtract the x-values: x₂ − x₁ (this is the run).
- Divide the rise by the run: m = rise / run.
- Simplify the fraction if possible, and note the sign.
Worked Examples
Example 1 — Positive slope
Points: (1, 2) and (4, 8)
Rise = 8 − 2 = 6
Run = 4 − 1 = 3
m = 6 / 3 = 2
Slope = 2 → Positive slope (line rises left to right).
Example 2 — Negative slope
Points: (−1, 5) and (3, −3)
Rise = −3 − 5 = −8
Run = 3 − (−1) = 4
m = −8 / 4 = −2
Slope = −2 → Negative slope (line falls left to right).
Example 3 — Zero slope
Points: (2, 7) and (9, 7)
Rise = 7 − 7 = 0
Run = 9 − 2 = 7
m = 0 / 7 = 0
Slope = 0 → Zero slope (horizontal line).
Example 4 — Undefined slope
Points: (5, 1) and (5, 9)
Rise = 9 − 1 = 8
Run = 5 − 5 = 0
m = 8 / 0 → undefined
Slope = Undefined → Vertical line (x = 5).
Frequently Asked Questions
What is a slope calculator?
A slope calculator is a tool that finds the slope of a line when you provide two points. It applies the slope formula m = (y₂ − y₁) / (x₂ − x₁) and also shows rise, run, classification, and the line equation.
How do I calculate slope between two points?
Subtract the y-coordinates to find the rise, subtract the x-coordinates to find the run, then divide rise by run. For example, from (1, 2) to (4, 8): rise = 6, run = 3, slope = 2.
What does a zero slope mean?
A zero slope means the line is horizontal. The y-values are the same for both points, so the rise is zero. The line does not go up or down as you move along it.
When is slope undefined?
Slope is undefined when the line is vertical, which happens when x₁ = x₂. The run is zero, and division by zero is undefined in mathematics.
What is rise over run?
Rise over run is another way to describe slope. Rise is the vertical change (y₂ − y₁), and run is the horizontal change (x₂ − x₁). Slope = rise ÷ run.
Can slope be a decimal or fraction?
Yes. Slope can be any real number — positive, negative, zero, integer, fraction, or decimal. This calculator shows both the exact fraction (when possible) and the decimal approximation.
What is the equation of a line with slope?
The slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept. This calculator finds m and calculates b using one of the points, giving you the full line equation when the slope is defined.
Does the order of points matter?
No — the slope is the same regardless of which point you call P₁ or P₂, as long as you keep the subtraction consistent. Swapping both points flips the signs of both rise and run, so the slope stays the same.