Slope Calculator
Calculate the slope of a line passing through two points instantly. Find the rise over run, line equation in slope-intercept form, angle of inclination, and distance between two coordinates.
Slope Calculator
Coordinates
Enter two points (x1, y1) and (x2, y2) to calculate the slope, distance, and angle of the line connecting them.
Understanding Slope
The slope of a line is a fundamental concept in algebra and coordinate geometry that describes how steep a line is and which direction it travels. Represented by the letter m, slope is formally defined as the ratio of the vertical change to the horizontal change between any two distinct points on a line. You will often hear this described as "rise over run."
Mathematically, given two points (x₁, y₁) and (x₂, y₂), the slope formula is:
The numerator (y₂ − y₁) measures how far the line moves vertically (the rise), and the denominator (x₂ − x₁) measures how far it moves horizontally (the run). This ratio remains constant no matter which pair of points you choose on the same straight line.
Positive, Negative, Zero, and Undefined Slopes
A positive slope means the line rises from left to right, like walking uphill. A negative slope means the line falls from left to right, like walking downhill. When the slope equals zero, the line is perfectly horizontal and has no rise. When the run equals zero (a vertical line), the slope is undefined because division by zero is not possible.
Slope-Intercept Form: y = mx + b
One of the most commonly used representations of a linear equation is slope-intercept form: y = mx + b. Here, m is the slope and b is the y-intercept, the point where the line crosses the y-axis. This form is especially useful for graphing because the slope tells you the angle and direction, while the y-intercept tells you where the line starts on the vertical axis.
Point-Slope Form
Another important form is the point-slope form: y − y₁ = m(x − x₁). This is particularly useful when you know the slope and one point on the line. You can plug in the slope and the coordinates of the known point and then rearrange to get the equation in slope-intercept form.
Parallel and Perpendicular Lines
Understanding slope is essential for determining the relationship between lines. Parallel lines have exactly the same slope but different y-intercepts, meaning they never intersect. Perpendicular lines have slopes that are negative reciprocals of each other. If one line has slope m, a line perpendicular to it has slope −1/m. Their slopes multiply together to give −1.
Slope Types Reference Table
| Slope Type | Value of m | Visual Description | Example |
|---|---|---|---|
| Positive | m > 0 | Line goes uphill from left to right | y = 2x + 1 |
| Negative | m < 0 | Line goes downhill from left to right | y = −3x + 4 |
| Zero | m = 0 | Horizontal line, no rise | y = 5 |
| Undefined | m = undefined | Vertical line, no run | x = 3 |
How to Calculate Slope: 3 Worked Examples
Example 1: Positive Slope
Points: (1, 2) and (4, 8)
- Calculate rise: y₂ − y₁ = 8 − 2 = 6
- Calculate run: x₂ − x₁ = 4 − 1 = 3
- Divide: m = 6 / 3 = 2
The slope is 2. The line rises 2 units for every 1 unit to the right. Using point (1, 2): y = 2x + 0, so the equation is y = 2x.
Example 2: Negative Slope
Points: (2, 7) and (5, 1)
- Calculate rise: y₂ − y₁ = 1 − 7 = −6
- Calculate run: x₂ − x₁ = 5 − 2 = 3
- Divide: m = −6 / 3 = −2
The slope is −2. The line drops 2 units for every 1 unit to the right. Using point (2, 7): 7 = −2(2) + b, so b = 11. The equation is y = −2x + 11.
Example 3: Fractional Slope
Points: (−3, 4) and (5, 7)
- Calculate rise: y₂ − y₁ = 7 − 4 = 3
- Calculate run: x₂ − x₁ = 5 − (−3) = 8
- Divide: m = 3 / 8 = 0.375
The slope is 3/8 (or 0.375). The line rises gently, gaining 3 units of height for every 8 units of horizontal distance. Using point (5, 7): 7 = (3/8)(5) + b, so b = 41/8 = 5.125. The equation is y = (3/8)x + 5.125.
Frequently Asked Questions
Frequently Asked Questions
Was this calculator helpful?
Your rating helps other students discover this tool.
Related Calculators
Explore other calculators to help with your academic planning and success.


