November 10, 2026
By Jacky Fan
10 min read

Slope of a Line Graph: How to Calculate and Read It

Slope is rise over run: how far a line goes up or down for each step across. See the formula, worked examples, positive and negative slope, and y = mx + b.

Slope is the number behind the steepness of a line. It turns "the line climbs quickly" into a precise rate that you can compare, explain, and use for forecasting.

Quick answer: The slope of a line graph is the rise divided by the run: slope = (y2 - y1) / (x2 - x1) for any two points on the line. A positive slope means the value grows as x grows, a negative slope means it shrinks, and a slope of zero means it stays flat. Slope has a unit too: it is the change in y for one step of x, such as degrees per hour or dollars per month.

This guide shows how to calculate slope from two points, how to read positive, negative, zero, and undefined slopes, and how slope connects to the equation y = mx + b. If the axes themselves are new to you, read x and y axis explained first, and for the wider picture see what is a line graph.

What does slope tell you?

Slope measures how fast one quantity changes compared with another. On a line graph, it tells you two things at once:

  • Direction. Up from left to right is positive, down is negative, and flat is zero.
  • Rate. The bigger the number, ignoring the sign, the steeper the line and the faster the change.

Because slope is a ratio, it always carries a unit made from the two axes. If y is temperature in degrees Celsius and x is time in hours, slope is in degrees per hour. Without the unit, "slope = 2" does not say much.

How to calculate slope from two points

Use this method on any straight line, or on the straight stretch between any two points of a graph.

  1. Pick two points on the line that are far apart, ideally where the line crosses the gridlines so you can read exact values. Call them (x1, y1) and (x2, y2).
  2. Find the rise: subtract the y-values, y2 - y1.
  3. Find the run: subtract the x-values in the same order, x2 - x1.
  4. Divide the rise by the run.
  5. Add the unit: y-units per x-unit.

A worked example: the temperature climbs from 12 °C at 8:00 to 24 °C at 14:00.

StepWorkingResult
Points(8, 12) and (14, 24)
Rise24 - 1212 °C
Run14 - 86 hours
Slope12 / 62 °C per hour

Subtract in the same order for both the top and the bottom. Swapping both gives the same answer, but swapping only one flips the sign and gives you the wrong direction.

Positive, negative, zero, and undefined slope

SlopeWhat the line doesWhat it meansExample
PositiveRises from left to rightThe value grows as x growsSales up 3.2 thousand dollars per month
NegativeFalls from left to rightThe value shrinks as x growsA balance falling from 500 to 380 over 4 months: (380 - 500) / 4 = -30 per month
ZeroPerfectly flatNo changeA fixed fee of 15 each month: (15 - 15) / (6 - 1) = 0
UndefinedStraight up and downx does not change, so the run is 0Division by zero has no answer

A vertical line cannot appear in a normal line graph that has one value per x, which is why you will rarely meet an undefined slope in data charts. It does come up in maths classes and on coordinate planes.

Slope as a rate of change

Slope is the everyday "rate of change" in maths form. Take the shop sales from our guide to line graphs, measured over six months (illustrative numbers, in USD thousands):

Month numberSalesChange from previous month
1 (Jan)12
2 (Feb)15+3
3 (Mar)14-1
4 (Apr)19+5
5 (May)24+5
6 (Jun)28+4

Between two neighboring months, the run is 1, so the slope of each segment equals the change shown in the last column. March to April and April to May are the steepest rises, at +5 thousand dollars per month, and February to March is the only fall, at -1.

For the whole period, use the first and last points: rise = 28 - 12 = 16, run = 6 - 1 = 5, so the average slope is 16 / 5 = 3.2 thousand dollars per month. That single number summarizes the trend: on average, sales grew by 3.2 thousand dollars each month. It hides the dip in March, so when the details matter, look at the segments too.

Month,Sales
Jan,12
Feb,15
Mar,14
Apr,19
May,24
Jun,28

Paste this into the line graph maker and compare the steepness of each segment with the numbers above.

The slope-intercept form: y = mx + b

When a relationship is a straight line, it can be written as y = mx + b.

  • m is the slope, the change in y for each step of x.
  • b is the y-intercept, the value of y when x is 0, where the line crosses the y-axis.

A taxi fare is a good example. Suppose the starting fee is 4 and each kilometer costs 2 (illustrative numbers). The fare is y = 2x + 4, where x is the distance in kilometers.

Distance in km (x)Fare (y)
04
16
28
310
412
514

The line crosses the y-axis at 4, which is the starting fee, so b = 4. From 0 km to 5 km the fare rises from 4 to 14, so m = (14 - 4) / (5 - 0) = 2, which is the price per kilometer. To read m and b from any straight-line graph, find where the line meets the y-axis for b, then calculate rise over run for m.

When the line is curved

On a curve, the slope is not the same everywhere. Between two points you can still calculate an average slope with the same rise-over-run method, which is what the 3.2 above is. At a single point, the slope of the line that just touches the curve there is the instantaneous rate of change, which calculus calls the derivative.

For most business and science graphs, the average slope between two dates is what you need. Just state the period, because a different pair of points gives a different average.

Slope and angle

Slope and the angle of a line are linked: the angle above the horizontal equals the inverse tangent of the slope.

SlopeAngle above the horizontal (equal axis scales)
00°
0.526.6°
145°
263.4°
3.272.6°
-145° downward

A slope of 1 means the line rises one unit for each unit across, which is 45° when both axes use the same scale. In engineering, slope is often quoted as a percentage grade: multiply by 100, so a slope of 0.08 is an 8% grade.

A word of caution: the angle you see on a drawn graph depends on the scales of the axes. Stretch the y-axis and the same data looks steeper; shrink it and the line looks flatter. That is why you should compare slopes as numbers, not by eye, and why scale choices matter in line graph best practices.

Slope chart or slope of a line?

Two things share the word. The slope in this guide is a property of a line: its steepness. A slope chart is a chart design: a two-point line chart that connects "before" and "after" values for many items, so you can see which rose and which fell. If that is what you are after, see the slope chart example.

Common mistakes when finding slope

  • Using run over rise. The slope is rise divided by run, not the other way around.
  • Subtracting in different orders. Take both differences in the same order.
  • Forgetting the unit. "Per month" and "per year" give very different numbers for the same data.
  • Judging steepness by eye across graphs that use different scales.
  • Using category labels instead of numbers on the x-axis. Use the numeric position, such as month 1 to 6, to calculate.
  • Treating a curved line as if it had one slope. State the pair of points you used.
  • Misreading the sign. A falling line has a negative slope even if the numbers on the axis are positive.

Frequently asked questions

What is the slope of a line graph?

It is the rate at which the line rises or falls: the change in y divided by the change in x between two points. It describes how steep the line is and in which direction it goes.

How do you find the slope of a line graph?

Pick two points on the line, subtract their y-values to get the rise, subtract their x-values in the same order to get the run, and divide rise by run. Add the unit, which is y-units per x-unit.

What does a steep slope mean?

A large slope, whether positive or negative, means the value changes quickly for each step of x. A shallow slope means it changes slowly.

What does a negative slope mean?

The value decreases as x increases. On a graph, the line falls from left to right.

What is the slope of a horizontal line?

Zero. A horizontal line has no rise, so the value does not change as x changes.

What is the slope of a vertical line?

Undefined. The run is zero, and dividing by zero has no answer.

What is the difference between slope and y-intercept?

Slope tells you how steep the line is. The y-intercept tells you where the line crosses the y-axis, which is its value when x is 0. In y = mx + b, m is the slope and b is the y-intercept.

Share this article

Help others discover this content

Published on November 10, 2026

Last updated on November 10, 2026

Written by Jacky Fan

Sponsored