Skip to content
OverCalculator
  1. Home
  2. Math & Scientific
  3. Slope Calculator
Math & Scientific

Slope Calculator

Calculate the slope between two points, identify rise and run, interpret positive, negative, zero, and undefined slopes, and connect slope to linear rates of change.

Published

Slope
The slope is
0.5000
Rise (yβ‚‚ βˆ’ y₁)
2
Run (xβ‚‚ βˆ’ x₁)
4

Slope = (2 βˆ’ 0) Γ· (4 βˆ’ 0).

Results update as you type.

Slope Calculator

A slope calculator finds the slope of the line through two coordinate points. Slope is the line’s rate of change: how much the vertical coordinate changes for each unit of horizontal change. Enter x1, y1, x2, and y2 to get the rise, run, and decimal slope, then use the interpretation to identify whether the line rises, falls, stays horizontal, or is vertical.

Definition: slope as rate of change

In coordinate geometry, a line has constant steepness. Moving from one point on the line to another changes the y coordinate by a certain amount and the x coordinate by a certain amount. The ratio of those changes is the slope. It is often summarized as rise over run, where rise is vertical change and run is horizontal change.

This simple ratio carries a lot of meaning. In algebra, it is the coefficient of x in a linear equation written as y equals mx plus b. In physics, the slope of a position-versus-time graph is velocity. In business, the slope of a cost line can be dollars per unit. In construction, grade is often a rise-to-run ratio converted to a percent. The same calculation appears whenever a straight-line relationship can be described by two points.

Formula and variable definitions

For points (x1,y1)\left(x_1, y_1\right) and (x2,y2)\left(x_2, y_2\right), the slope is

slope=y2βˆ’y1x2βˆ’x1\text{slope} = \frac{y_2 - y_1}{x_2 - x_1}

where:

  • x1x_1 and y1y_1 are the coordinates of the first point.
  • x2x_2 and y2y_2 are the coordinates of the second point.
  • y2βˆ’y1y_2 - y_1 is the rise, or vertical change.
  • x2βˆ’x1x_2 - x_1 is the run, or horizontal change.

The calculator requires the run to be nonzero. If x2=x1x_2 = x_1, then the denominator is zero and no numerical slope exists. That is the vertical-line case. If y2=y1y_2 = y_1 while the run is nonzero, the slope is zero and the line is horizontal.

The formula comes directly from comparing coordinate differences. A straight line changes at a constant rate, so any two distinct points on the same nonvertical line give the same ratio. Reversing the point order does not change the result because both the numerator and denominator change sign.

Checked example

The calculator’s default points are (0,0)\left(0, 0\right) and (4,2)\left(4, 2\right). The rise is

2βˆ’0=22 - 0 = 2

The run is

4βˆ’0=44 - 0 = 4

So the slope is

24=0.5\frac{2}{4} = 0.5

The calculator displays the primary result as 0.5000 because it formats slope to four decimal places. It also lists rise as 2 and run as 4, and its note shows the substituted calculation. Interpreted in words, y increases by one-half unit for each 1-unit increase in x. If the axes were meters and seconds, the slope would be 0.5 meters per second. If they were dollars and items, it would be 0.5 dollars per item.

For a negative example, compare (1,7)\left(1, 7\right) and (4,1)\left(4, 1\right). The rise is 1βˆ’7=βˆ’61 - 7 = -6, and the run is 4βˆ’1=34 - 1 = 3, so the slope is βˆ’6Γ·3=βˆ’2-6 \div 3 = -2. The line falls as x increases.

Interpreting slope in applications

Positive slope means the dependent variable increases as the independent variable increases. Negative slope means it decreases. Zero slope means no change in y over the interval. Undefined slope means the relationship is vertical and cannot be expressed as a numerical amount of y change per one x change.

Because slope is a ratio, units matter. A road that rises 6 feet over a horizontal run of 100 feet has slope 0.06, often described as a 6 percent grade. A graph of revenue against units sold may have slope equal to price per unit. A temperature trend line may have slope measured in degrees per hour. If you want to convert an angle associated with a slope, the angle converter can help with degrees and radians. If you are comparing before-and-after quantities rather than coordinate points, the percentage change calculator focuses on relative change. For datasets where a line is only part of the story, the statistics calculator summarizes center and spread.

Domain, edge cases, and common mistakes

The inputs can be positive, negative, zero, or decimal coordinates. The only forbidden geometric case is equal x coordinates, because the run is zero. Very small runs can produce very large slopes, so interpret decimal-coordinate examples carefully: a rise of 1 over a run of 0.001 gives a slope of 1000.

A common mistake is subtracting in inconsistent order, such as using y2βˆ’y1y_2 - y_1 but x1βˆ’x2x_1 - x_2. That changes the sign. Use the same second-minus-first order for both coordinates. Another mistake is confusing steepness with the visual angle on a resized graph. If the x and y axes are not drawn with the same scale, a line can look steep or shallow while its numeric slope stays unchanged. Finally, remember that slope is not the y-intercept. The slope describes change; the intercept describes where the line crosses the y-axis.

Sources

  • Wolfram MathWorld, Slope β€” mathematical definition of line slope.
  • Khan Academy, Slope review β€” instructional explanation of rise over run.
  • OpenStax, Understand Slope of a Line β€” algebra textbook treatment of slope and graph interpretation.

Frequently asked questions

How do I find slope from two points?
Subtract the first y coordinate from the second y coordinate to get the rise. Subtract the first x coordinate from the second x coordinate to get the run. Divide rise by run. The order matters, so use the same point order in both subtractions.
What does undefined slope mean?
Undefined slope means the run is zero because both points have the same x coordinate. The line is vertical, so there is no numerical change in y for one unit of change in x. The calculator marks this case invalid instead of dividing by zero.
Does slope have units?
Slope has units when the axes have units. Its unit is the y unit divided by the x unit, such as meters per second, dollars per item, or feet of rise per foot of run. If both axes use the same unit, the slope can be interpreted as a unitless ratio.
Why does the calculator round the slope?
The calculator displays the final slope to four decimal places so repeating decimals remain readable. The rise and run are shown separately, which lets you recover the exact ratio for many integer-coordinate examples. For precise algebra, keep the fraction form before rounding.

Related calculators

Slope Calculator updated at