How to use this calculator
Enter the x and y coordinates of two different points on a straight line. The calculator subtracts the first point from the second to find the rise and run, then divides the rise by the run. It also derives the line equation and plots both points. A vertical line has an undefined slope because its run is zero; a horizontal line has slope zero.
How to find the slope between two points
Slope measures how much y changes for each unit change in x. Choose two points on the same straight line, subtract their y-coordinates to find the rise, and subtract their x-coordinates to find the run. Divide rise by run. The order must match in both subtractions: use the second point minus the first point for both coordinates.
| Line direction | Rise | Run | Slope |
|---|---|---|---|
| Rises from left to right | Positive | Positive | Positive |
| Falls from left to right | Negative | Positive | Negative |
| Horizontal | 0 | Nonzero | 0 |
| Vertical | Nonzero | 0 | Undefined |
From slope to the equation of a line
Once the slope is known, use one of the points in point-slope form: y − y₁ = m(x − x₁). Rearranging gives slope-intercept form, y = mx + b, where b is the y-intercept. The standard form Ax + By = C is another way to describe the same line. A vertical line is the exception: it is written x = a constant and cannot be written as y = mx + b.
Why the graph uses equal axis scales
The same coordinate distance is drawn with the same screen distance on both axes. This keeps the visual angle of the line consistent with its numerical slope. The dashed guide connects the two points using a horizontal run and a vertical rise.
Slope calculator FAQs
How do I find the slope between two points?
Subtract the first y-coordinate from the second to find the rise. Subtract the first x-coordinate from the second to find the run. Divide rise by run: m = (y₂ − y₁) / (x₂ − x₁), provided the run is not zero.
What does rise over run mean?
Rise is the vertical change between the points, Δy. Run is the horizontal change, Δx. Slope tells you the vertical change for each unit of horizontal movement.
What does a positive or negative slope show?
A positive slope rises as you move from left to right. A negative slope falls. The absolute value indicates how steep the line is when x and y use the same units and scale.
Why is the slope of a vertical line undefined?
A vertical line has no horizontal movement, so its run is zero. Dividing by zero is undefined. Its equation is x = a constant.
Can slope be zero or a fraction?
Yes. A horizontal line has slope zero. A line can also have a fractional or negative fractional slope; for example, a rise of 3 and a run of 4 gives 3/4.
What is the difference between slope and the equation of a line?
Slope is one number describing the line's direction and steepness. A line equation describes every coordinate pair on the line. The slope and one point are enough to determine a non-vertical line.
For exact fraction arithmetic or ratio comparisons related to rise over run, see the fraction calculator and ratio and proportion calculator.
The formula
Worked examples
Positive slope: (1, 2) and (4, 8)
Rise = 8 − 2 = 6 and run = 4 − 1 = 3. The slope is 6 / 3 = 2.
Negative fractional slope: (0, 4) and (6, 1)
Rise = 1 − 4 = −3 and run = 6 − 0 = 6. The slope is −3 / 6 = −1/2.
Horizontal line: (−2, 3) and (5, 3)
The rise is zero and the run is 7, so the slope is 0 and the equation is y = 3.
Vertical line: (4, −1) and (4, 6)
The run is zero, so the slope is undefined. Every point on the line has x = 4.
Decimal coordinates: (0.1, 0.2) and (0.4, 0.7)
Rise = 0.5 and run = 0.3, so the exact slope is 5/3 (about 1.666667).
Special cases & input limits
Enter four coordinates using signed integers, decimals or scientific notation. Use a decimal point, not commas, units or fraction strings. Each coordinate follows the shared input limit of at most 30 significant digits and nonzero magnitudes from 1e-20 to 1e30, or zero. The two points cannot be identical because one point alone does not define a unique line. A vertical line is valid but its slope is undefined; the calculator shows x = constant rather than dividing by zero. Display precision changes the decimal presentation only; the reduced fraction and internal calculation remain exact for the entered finite-decimal coordinates.
Inputs support a decimal point and scientific notation, up to 30 significant digits and a magnitude of 10⁻²⁰ to 10³⁰, or zero. Select 0–12 display decimal places. Very small or large answers use scientific notation so a nonzero result is not displayed as zero.
A common mistake
Do not divide the y-coordinate by the x-coordinate. Slope uses the differences between the two points: (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8), use 6 ÷ 3 = 2, not 8 ÷ 4.
Content updated · Calculation methodology