Home / How to Find the Slope of a Line

How to Find the Slope of a Line

Slope measures how steep a line is. This guide shows you how to calculate it from two points, read it from an equation, and spot it on a graph.

Chris Terry
By Chris Terry, Editor
Published June 12, 2026

To find the slope of a line, subtract the y-values of two points on the line and divide by the difference of their x-values. That ratio, rise over run, is all slope ever is.

What Is Slope?

Slope tells you how much a line rises or falls for every unit you move to the right. A steep hill has a large slope. A flat road has a slope of zero. The letter m stands for slope in algebra, a convention borrowed from French mathematics in the 19th century.

Formally, slope is the ratio of vertical change to horizontal change between any two points on a line. Pick any two points. The ratio will be the same. That consistency is what makes a line a line.

For a thorough treatment of the concept, see Wolfram MathWorld on slope.

The Slope Formula

Given two points (x1, y1) and (x2, y2), the slope m is:

m = (y2 - y1) / (x2 - x1)

Read it as: the change in y divided by the change in x. Mathematicians often write the numerator as delta-y and the denominator as delta-x, where delta means "change in." The result is the same either way.

One thing to watch: x2 and x1 must not be equal. If they are, the denominator is zero and the slope is undefined. That situation describes a vertical line.

Use the slope calculator on this site to check your work instantly. Just enter two coordinate pairs and the tool returns the slope, the y-intercept, and the full equation of the line.

Worked Example 1: Two Points

Find the slope of the line through (2, 3) and (6, 11).

Step 1. Label the points. Let (x1, y1) = (2, 3) and (x2, y2) = (6, 11).
Step 2. Find the rise: y2 - y1 = 11 - 3 = 8.
Step 3. Find the run: x2 - x1 = 6 - 2 = 4.
Step 4. Divide: m = 8 / 4 = 2.
Result. The slope is 2. For every one unit right, the line goes two units up.

Order does not matter, as long as you keep both subtractions consistent. If you swap the points, both the numerator and the denominator change sign, and the result stays the same.

Slope from an Equation

When a line is given as an equation rather than two points, the quickest method depends on the form of the equation.

Slope-intercept form is y = mx + b. The coefficient of x is the slope. No calculation needed. Read it off.

Standard form is Ax + By = C. Rearrange to slope-intercept form by solving for y. Subtract Ax from both sides, then divide by B. The coefficient of x in the result is the slope.

Point-slope form is y - y1 = m(x - x1). The slope m is right there in front of the parentheses.

Worked Example 2: From Slope-Intercept Form

Find the slope of the line y = -3x + 7.

Step 1. Identify the form. This is y = mx + b, slope-intercept form.
Step 2. The coefficient of x is -3.
Result. The slope is -3. The line falls three units for every one unit it moves to the right.

Now from standard form. Find the slope of 4x + 2y = 10.

Step 1. Subtract 4x from both sides: 2y = -4x + 10.
Step 2. Divide everything by 2: y = -2x + 5.
Result. The slope is -2.

Positive, Negative, Zero, and Undefined Slope

Four cases cover every line you will encounter.

Positive slope. The line rises from left to right. A slope of 3 is steeper than a slope of 1.

Negative slope. The line falls from left to right. A slope of -4 is steeper than a slope of -1, just heading downward.

Zero slope. The line is horizontal. Think of a flat surface. The y-value never changes, so the rise is always zero: 0 / run = 0.

Undefined slope. The line is vertical. The x-value never changes, so the run is always zero. Division by zero is undefined, and so is the slope.

A common mistake is confusing a zero slope with an undefined slope. Zero slope means horizontal. Undefined slope means vertical. They are opposites on a graph.

Slope in the Real World

Slope is not only a classroom concept. It shows up constantly in applied problems.

In economics, slope describes how a cost changes per unit produced. A manufacturing cost that rises by $5 for every extra item has a slope of 5 on the cost curve. In physics, slope on a velocity-time graph gives acceleration. A steeper line means faster acceleration. In construction, roof pitch is slope stated as inches of rise per foot of run.

Learning to spot slope in context makes algebra feel less abstract. Once you see it as "how fast something changes," the formula clicks into place. You may also find it useful to read about how to solve quadratic equations, since quadratic curves have a slope that changes at every point, which connects directly to the study of derivatives in calculus.

Good to know

Frequently asked questions

What is the formula for slope?

The slope formula is m = (y2 - y1) / (x2 - x1), where (x1, y1) and (x2, y2) are any two points on the line. Subtract the y-values and divide by the difference of the x-values.

What does a slope of 0 mean?

A slope of 0 means the line is perfectly horizontal. The y-value stays the same no matter what x is, so there is no rise over run.

How do you find slope from a graph?

Pick two points on the line where it crosses grid intersections. Count how many units you move up or down (the rise), then how many units you move right (the run). Divide rise by run to get the slope.

What is the difference between slope and rate of change?

They mean the same thing in most contexts. Slope is the geometric term for steepness on a graph. Rate of change is the applied term used in science and economics to describe how fast one quantity changes relative to another.

Chris Terry
About the author
Chris Terry
Editor, Encore Editorial

Editor at Encore Editorial, Chris Terry sets the editorial standards here and turns dense topics into plain English. He has written widely on education, finance, and consumer markets.