CalculatorSwitch
Calculator Switch
Math

Slope Calculator

Last updated:

How to Use This Calculator

Step 1: Enter the x and y coordinates of Point 1 (x₁, y₁).

Step 2: Enter the x and y coordinates of Point 2 (x₂, y₂).

Step 3: Click Calculate to get the slope, y-intercept, equation, angle, distance, and midpoint.

What Is Slope?

Slope measures how steep a line is — specifically, how much the line rises for each unit it runs to the right. A slope of 2 means the line goes up 2 units for every 1 unit to the right. A slope of zero means the line is horizontal, and an undefined slope means the line is vertical.

Positive slopes go up from left to right; negative slopes go down. The larger the absolute value, the steeper the line.

Slope is a foundational concept in algebra, calculus (where it becomes the derivative), and physics (velocity is the slope of a position-time graph).

The Slope Formula

m = (y₂ − y₁) / (x₂ − x₁)

The numerator is the 'rise' (change in y); the denominator is the 'run' (change in x).

Line equation (slope-intercept form): y = mx + b, where b = y₁ − m·x₁

Example: Points (1, 2) and (4, 8)
Rise = 8 − 2 = 6
Run = 4 − 1 = 3
Slope m = 6 ÷ 3 = 2
b = 2 − 2·1 = 0 → y = 2x

Slope Interpretation

Slope ValueLine TypeDirection
Positive (m > 0)RisingGoes up from left to right
Negative (m < 0)FallingGoes down from left to right
Zero (m = 0)HorizontalFlat line
UndefinedVerticalx₁ = x₂ (division by zero)
|m| > 1SteepFast rise or fall
|m| < 1GradualSlow rise or fall

Examples

Example 1: Points (1, 2) and (4, 8) → slope 2, equation y = 2x.

Example 2: Points (0, 5) and (2, 1) → slope −2, equation y = −2x + 5 (line falling).

Example 3: Points (3, 4) and (3, 9) → undefined slope (vertical line x = 3).

Tips

Order matters consistently — subtract Point 1 from Point 2 in both numerator and denominator.

Vertical line = undefined slope — the calculator flags this.

Parallel lines have the same slope.

Perpendicular lines have slopes that multiply to −1.

Frequently Asked Questions

What does a negative slope mean physically?
A negative slope means the line is going downward as you read from left to right. In practical terms: on a graph of temperature over time, a negative slope means temperature is dropping; on a graph of elevation along a road, a negative slope means you are going downhill. The steepness of the descent is proportional to the absolute value — a slope of negative 5 is five times steeper than a slope of negative 1.
Why is the slope of a vertical line undefined instead of infinity?
A vertical line has x₁ equal to x₂, which makes the denominator of the slope formula zero. Division by zero is mathematically undefined, not infinite, because the result does not approach any single value — it depends on the direction of approach. Some textbooks informally say the slope is 'infinite,' but this is imprecise. Formally, vertical lines simply have no slope in the standard real-number system.
How do I find the equation of a line given the slope and one point?
Use point-slope form: y minus y₁ equals m times (x minus x₁). Then rearrange to slope-intercept form y equals mx plus b. For example, with slope 3 and point (2, 7), the equation is y minus 7 equals 3 times (x minus 2), which simplifies to y equals 3x plus 1. You can also plug the point into y equals mx plus b and solve for b directly: 7 equals 3 times 2 plus b, giving b equals 1.
What is the relationship between slope and the angle of a line?
Slope and angle are related by the tangent function: slope equals the tangent of the angle the line makes with the positive x-axis. A slope of 1 corresponds to a 45-degree angle, a slope of 0 corresponds to 0 degrees (horizontal), and a slope approaching infinity corresponds to 90 degrees (vertical). This calculator shows the angle in degrees using the arctangent function.
How is slope used in real-world applications?
Slope appears everywhere: road grades are expressed as percent slope (a 5% grade rises 5 feet per 100 feet), roof pitches in construction, wheelchair ramp regulations (maximum 1:12 slope under ADA), graph interpretation in economics and science, and the rate of change in physics (velocity is the slope of a position-time graph). Wherever change is being measured with respect to another quantity, slope is the natural measurement.
Can two points ever give the same slope in different directions?
No — given two specific points, there is exactly one slope. However, many different pairs of points can produce the same slope — any two points on the same line have the same slope. This is the defining property of a straight line: consistent slope between any two points on it. If you calculate slopes between different point pairs and get different answers, the points are not collinear (they do not lie on a single straight line).

Related Calculators

Point 1

Point 2

Was this useful?