Slope Calculator

A slope calculator takes two points on a line and instantly tells you how steep that line is. Whether you're working through a geometry problem, graphing a linear equation, or trying to figure out the pitch of a roof, slope is the number you need. This page walks you through everything: the formula, how to use it, worked examples, and what different slope values actually mean. If you've ever stared at a graph wondering which direction the numbers go, you're in the right place.

Enter Details

(x₁, y₁)

(x₂, y₂)

Result

Two points

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Calculate Slope

Slope measures how much a line rises or falls as you move from left to right. More specifically, it's the ratio of vertical change to horizontal change between any two points on that line.

To calculate it, you need two points. From those two points, you subtract the y-values and divide by the difference of the x-values. That's really it. The result can be a whole number, a fraction, a decimal, or even zero, depending on the line.

One thing worth keeping straight: slope is a property of the entire line, not just a segment. If you pick any two points on the same line, you'll always get the same slope value. That consistency is what makes it so useful.

Slope Formula

The slope formula is written as:

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

Here, m is the slope (mathematicians traditionally use m for this), and the subscripts just indicate which point is which. Point 1 is (x₁, y₁) and Point 2 is (x₂, y₂). The order you plug them in doesn't matter as long as you're consistent: if y₂ is the y-value from Point 2, then x₂ must be the x-value from that same point.

The numerator (y₂ − y₁) represents the vertical change, and the denominator (x₂ − x₁) is the horizontal change. Divide them and you've got your slope.

Find the Slope from Two Points

Say you have the points (2, 3) and (6, 11). Plug them into the formula:

m = (11 − 3) / (6 − 2) = 8 / 4 = 2

The slope is 2. For every one unit you move to the right along the x-axis, the line climbs two units up. Simple enough. Now try it with something a little messier, like (−1, 4) and (3, −2):

m = (−2 − 4) / (3 − (−1)) = −6 / 4 = −3/2

Negative slope, which means the line is falling as you move right. The fraction −3/2 tells you that for every 2 units you travel horizontally, you drop 3 units vertically.

Rise Over Run Explained

You'll hear slope described as rise over run a lot, and it's genuinely the easiest way to picture it. Rise is how far you move up or down (vertical), and run is how far you move left or right (horizontal).

If a line has a slope of 3/4, that means for every 4 units you run to the right, you rise 3 units. You can literally count this out on a graph: start at a point, move right 4 squares, then move up 3 squares, and you'll land right on the line.

A negative rise means you're actually moving down instead of up. So a slope of −2/5 tells you: run 5 to the right, drop 2. That's all there is to it visually.

Positive, Negative, Zero, and Undefined Slopes

Not all slopes are created equal. Here's what each type looks like and what it means:

  • Positive slope: The line goes up from left to right. The larger the value, the steeper the climb. A slope of 5 is much steeper than a slope of 0.5.
  • Negative slope: The line goes down from left to right. A slope of −3 drops faster than a slope of −0.2.
  • Zero slope: The line is perfectly horizontal. There's no rise at all, so the numerator of the slope formula equals zero. The equation looks like y = 4 or y = −7.
  • Undefined slope: The line is perfectly vertical. The run is zero, and you can't divide by zero, so the slope literally doesn't exist as a number. These lines have equations like x = 3 or x = −1.

Knowing which category a slope falls into tells you a lot about the line before you even look at a graph.

Slope-Intercept Form (y = mx + b)

Slope-intercept form is probably the most recognized way to write a linear equation: y = mx + b. The m is the slope and b is the y-intercept, which is where the line crosses the y-axis.

This form is popular because it hands you two key pieces of information immediately. You don't have to solve for anything or rearrange terms. Just look at the equation and you already know the steepness of the line and where it starts on the y-axis.

For example, in the equation y = 3x + 5, the slope is 3 and the line crosses the y-axis at (0, 5). If the equation were y = −x + 2, the slope would be −1 and the y-intercept would be at (0, 2). Graphing from this form is pretty straightforward once you've got both pieces.

Finding the Y-Intercept

The y-intercept is the point where x = 0. On a graph, it's where the line crosses the vertical axis. Algebraically, you find it by setting x to zero and solving for y.

If you already have slope-intercept form, you're done: b is the y-intercept. But if you have the slope and just one point, you can solve for b directly. Plug your known values into y = mx + b and solve.

For instance, if the slope is 2 and the line passes through (3, 7):

7 = 2(3) + b → 7 = 6 + b → b = 1

The y-intercept is 1, so the full equation is y = 2x + 1.

Writing the Equation of a Line

Once you have the slope and the y-intercept, writing the equation is just a matter of plugging values into y = mx + b. Got a slope of −4 and a y-intercept of 9? Your equation is y = −4x + 9. Done.

If you only have two points and no y-intercept, calculate the slope first using the formula, then use one of the points to find b as shown above. It's a two-step process but not a complicated one.

Keep an eye on negative signs and fractions; those are where most errors sneak in. Write each step out clearly rather than trying to do it all in your head, and you'll get it right.

Point-Slope Form

Point-slope form is another way to express a linear equation, and it's especially handy when you know the slope and one point but haven't found the y-intercept yet. The form looks like this:

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

Where (x₁, y₁) is a known point on the line and m is the slope. You're essentially describing the line by anchoring it to a specific coordinate instead of the y-axis.

For example, if the slope is 3 and the line passes through (2, 5), you'd write:

y − 5 = 3(x − 2)

From there, you can expand and rearrange it into slope-intercept form if needed: y − 5 = 3x − 6, so y = 3x − 1. Point-slope form is a great middle step when you're building toward a full equation.

Standard Form to Slope Conversion

Standard form of a linear equation looks like Ax + By = C, where A, B, and C are integers and A is typically positive. It's common in textbooks and on standardized tests, but it doesn't hand you the slope directly the way slope-intercept form does.

To find the slope from standard form, just solve for y. Rearrange the equation until it looks like y = mx + b, and the coefficient in front of x is your slope.

Example: 4x + 2y = 10

  1. Subtract 4x from both sides: 2y = −4x + 10
  2. Divide everything by 2: y = −2x + 5

The slope is −2. Converting to slope-intercept form is the cleanest approach, and once you've done it a few times it becomes pretty automatic.

Slope Calculation Examples

Working through a few concrete examples is the fastest way to get comfortable with slope. Here are several scenarios with different difficulty levels:

PointsCalculationSlope
(0, 0) and (4, 8)(8 − 0) / (4 − 0)2
(1, 5) and (4, 5)(5 − 5) / (4 − 1)0 (horizontal)
(−3, 2) and (1, −6)(−6 − 2) / (1 − (−3))−2
(2, −1) and (5, 8)(8 − (−1)) / (5 − 2)3
(3, 1) and (3, 7)(7 − 1) / (3 − 3)Undefined (vertical)

Notice how the undefined slope shows up whenever both x-values are the same. And zero slope always means the y-values are identical. Keep those patterns in mind and you'll catch errors quickly.

Horizontal and Vertical Lines

Horizontal and vertical lines are the two extremes of slope, and they come up constantly.

A horizontal line has a slope of exactly zero. It runs flat across the graph, never rising or falling. Every point on it shares the same y-value. The equation is always in the form y = some constant, like y = 3 or y = −8.

A vertical line has an undefined slope. It shoots straight up and down, meaning the x-value never changes but y can be anything. The equation takes the form x = some constant, like x = 5. Because the run (change in x) is zero, the slope formula produces a division-by-zero situation, which is why we call it undefined rather than zero.

These two cases trip people up mostly because they look similar at first glance. The key difference: if the line is flat, slope is zero; if the line is straight up-and-down, slope doesn't exist.

Distance and Midpoint vs Slope

Slope, distance, and midpoint are three separate things you can calculate from two coordinate points, and it's worth knowing how they differ.

ConceptFormulaWhat It Tells You
Slope(y₂ − y₁) / (x₂ − x₁)Steepness and direction of the line
Distance√[(x₂ − x₁)² + (y₂ − y₁)²]Length of the segment between two points
Midpoint((x₁ + x₂)/2, (y₁ + y₂)/2)Exact center point between two coordinates

Slope tells you about direction and steepness. Distance tells you how far apart two points actually are (using the Pythagorean theorem under the hood). Midpoint gives you the coordinates of the point exactly halfway between the two.

You'll often use all three together on geometry problems, especially when working with line segments, perpendicular bisectors, or coordinate proofs. They're related concepts but answer completely different questions.

Real-World Applications of Slope

Slope shows up in real life more than most people realize once you start looking for it.

  • Construction and architecture: Roof pitch, ramp grades, and staircase angles are all slope calculations. Building codes in the U.S. often specify maximum or minimum slopes for accessibility ramps and drainage systems.
  • Roads and highways: Road grade is expressed as a percentage, which is just slope multiplied by 100. A 6% grade means the road rises 6 feet for every 100 feet of horizontal distance.
  • Economics and data analysis: On a graph showing revenue over time, slope tells you the rate of growth or decline. A steeper line means faster change.
  • Physics: Velocity on a distance-time graph is literally the slope of the line. Acceleration is the slope on a velocity-time graph.
  • Landscaping and drainage: Proper water runoff requires land to be graded at a certain slope away from structures to prevent flooding.

Understanding slope isn't just an algebra exercise. It's a practical tool that engineers, architects, analysts, and scientists use regularly to describe how things change in relation to one another.

Other Maths Calculators

Explore all