The slope of a line describes how steeply it rises or falls as you move from left to right on a coordinate graph. A slope calculator helps you find the gradient between two points and understand whether the line increases, decreases, or stays level.
How to calculate slope from two points
For two points (x₁, y₁) and (x₂, y₂), use:
m = (y₂ − y₁) / (x₂ − x₁)
The numerator is the vertical change, or rise. The denominator is the horizontal change, or run. You must subtract coordinates in the same order in both parts.
Worked example
Suppose a line passes through (2, 3) and (6, 11). The rise is 11 − 3 = 8, and the run is 6 − 2 = 4. Therefore, m = 8 / 4 = 2. The line rises by two vertical units for every one horizontal unit.
How to use an online slope calculator
- Open the Slope Calculator.
- Enter the coordinates of the first point.
- Enter the coordinates of the second point.
- Calculate the slope and check any equation or graph shown.
- Confirm that the points were entered in the correct x and y fields.
Types of slope
| Slope | Meaning | Example |
|---|---|---|
| Positive | Line rises left to right | m = 3 |
| Negative | Line falls left to right | m = −2 |
| Zero | Horizontal line | m = 0 |
| Undefined | Vertical line | x₁ = x₂ |
Slope-intercept form
A nonvertical straight line can be written as y = mx + b, where m is slope and b is the y-intercept. If m = 2 and the line passes through (2, 3), then 3 = 2(2) + b, giving b = −1. The equation is y = 2x − 1.
Common mistakes
- Subtracting x coordinates in one order and y coordinates in the opposite order.
- Dividing by zero for a vertical line.
- Confusing slope with the y-intercept.
- Assuming slope is always a positive number.
Frequently asked questions
What does a slope of 1 mean?
A slope of 1 means the line rises 1 unit vertically for each 1-unit increase horizontally. For example, the line y = x + 2 has slope 1 and passes through (0, 2) and (1, 3).
What is the slope of a horizontal line?
The slope of a horizontal line is 0 because the change in y is zero. For example, the points (1, 5) and (4, 5) give slope (5 − 5)/(4 − 1) = 0.
What is the slope of a vertical line?
The slope is undefined. A vertical line has no horizontal change, so the slope formula (y₂ − y₁)/(x₂ − x₁) would require division by zero.
Can two different points have the same x coordinate?
Yes. The distinct points (3, 1) and (3, 7) share x = 3. Their line is vertical (x = 3), so its slope is undefined rather than zero.
Try the free slope calculator to check your coordinates and gradient.

Moiz Ahmad is a digital marketer and SEO expert based in Dera Ismail Khan, Pakistan. With over 6 years of experience in SEO, WordPress development, and digital strategy, he has helped 30+ businesses rank on Google’s first page. He is the founder of DigiTechPak and Moiz Blogger. Connect: LinkedIn | Twitter | Moiz Blogger