Slope Calculator

Find the slope of a straight line from two points or from rise and run. See the exact ratio, decimal slope, incline angle, line direction and equation with a transparent breakdown.

Point 1

Point 2

Your Slope Results

Rise (Δy)0
Run (Δx)0
Incline angle
Slope (m)0

Enter two points, or switch to Rise & run. The blue card shows the slope.

Calculation breakdown

Input methodTwo points
Exact rise / run0 / 0
Decimal slope0
Percent grade0%
Line type0
Line equation0

Transparent formula

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

Rise = y₂ − y₁; run = x₂ − x₁.

If run = 0, division by zero makes the slope undefined and the line is vertical.

Line preview

The preview uses your two points. In Rise & run mode, it uses a reference point at (0, 0).

What is slope?

Slope measures how much a straight line changes vertically for each unit of horizontal change. It tells you both the direction of the line and its steepness. In coordinate geometry, slope is usually written as m and calculated as change in y divided by change in x.

The most common way to find slope is from two points on the same straight line. If the points are (x₁, y₁) and (x₂, y₂), the vertical change is y₂ − y₁ and the horizontal change is x₂ − x₁. Their ratio is the slope. This is the coordinate version of the familiar idea rise over run.

Slope is not limited to school algebra. The same ratio appears in rates of change, road and ramp grades, roof pitch, trend lines, engineering drawings, economics and data analysis. The units depend on the situation. If y is measured in dollars and x in hours, the slope can mean dollars per hour. If both axes use the same distance unit, the slope itself is dimensionless.

How to use the Slope Calculator

  1. Choose an input method. Use Two points when you know coordinates on a line. Use Rise & run when you already know the vertical and horizontal changes.
  2. Enter the values exactly as given. Negative numbers and decimals are allowed. The calculator does not require the first point to be left of the second point.
  3. Calculate. The main blue result is the slope. Supporting cards show rise, run and the incline angle.
  4. Check the breakdown. It shows the exact rise/run ratio, decimal slope, percent grade, line type and—when two actual points are supplied—the corresponding line equation.
  5. Use the graph as a visual check. A positive slope should rise from left to right, a negative slope should fall, a zero slope should be horizontal, and an undefined slope should be vertical.
Useful check: If you reverse the order of both points, both the rise and the run change sign. Their ratio stays the same, so the slope does not change. A common mistake is reversing only one subtraction.

Slope formula

For two points (x₁, y₁) and (x₂, y₂), the slope formula is:

m = (y₂ − y₁) ÷ (x₂ − x₁) m = Δy ÷ Δx = rise ÷ run

The numerator measures the vertical change. The denominator measures the horizontal change. The sign of the ratio tells you the direction of the line: positive means the line rises as x increases, negative means it falls, zero means it is horizontal, and a zero denominator means the line is vertical and the slope is undefined.

Why subtract in the same order?

You can calculate y₂ − y₁ over x₂ − x₁, or you can reverse both differences and calculate y₁ − y₂ over x₁ − x₂. Both give the same slope because both numerator and denominator change sign. What does not work is mixing the orders, such as y₂ − y₁ over x₁ − x₂, because that incorrectly flips the sign.

Exact ratio versus decimal slope

A slope such as 3/5 is often more informative than 0.6 because the fraction directly shows a rise of 3 units for a run of 5 units. This calculator keeps that exact rise/run relationship in the breakdown while also providing a decimal. If your inputs are decimals, the displayed ratio is simplified from the decimal differences where practical.

Worked slope examples

Positive slope

Points (2, 3) and (7, 6): rise = 3, run = 5, so m = 3/5 = 0.6. The line rises from left to right.

Negative slope

Points (−2, 5) and (4, −1): rise = −6, run = 6, so m = −1. The line falls one unit for each unit moved right.

Zero slope

Points (1, 4) and (8, 4): rise = 0, run = 7, so m = 0. The line is horizontal.

Example with decimals

Suppose the points are (1.5, 2.25) and (4.5, 6.75). The rise is 6.75 − 2.25 = 4.5, and the run is 4.5 − 1.5 = 3. The slope is 4.5 ÷ 3 = 1.5. That means y increases by 1.5 units for each 1-unit increase in x.

Example using rise and run directly

If a line rises 8 units while moving 20 units to the right, its slope is 8/20 = 2/5 = 0.4. If the rise were −8 instead, the slope would be −0.4. The size tells you the steepness; the sign tells you the direction.

Zero slope and undefined slope

Zero and undefined slope are different special cases, and confusing them is one of the most common algebra errors.

Line typeWhat stays constant?RiseRunSlope
Horizontaly stays constant0Nonzero0
Verticalx stays constantUsually nonzero0Undefined

A horizontal line has zero vertical change, so its numerator is zero and the result is 0. A vertical line has zero horizontal change, so the denominator is zero. Division by zero is undefined, which is why the slope of a vertical line is undefined rather than “infinite.”

If both points are exactly the same, both rise and run are zero. That does not define a unique line at all: infinitely many lines can pass through one point. The calculator therefore reports that two distinct points are required.

Slope, incline angle and percent grade

Slope can also be connected to the angle a line makes with the positive x-axis. For a nonvertical line:

θ = arctan(m) percent grade = m × 100%

An m of 1 corresponds to an angle of 45°. A slope of 0 corresponds to 0°. Negative slopes produce negative angles in the usual principal-angle convention, indicating a downward direction from left to right. A vertical line is treated as a 90° line for the preview, while its slope remains undefined.

Percent grade is simply slope expressed as a percentage. A slope of 0.08 equals an 8% grade. This is useful in contexts such as ramps and roads, but practical design standards may define additional measurement rules, allowable limits or sign conventions. The calculator performs the mathematics; it does not determine compliance with a construction or accessibility code.

How slope connects to the equation of a line

When two nonvertical points are known, slope is enough to help determine the full straight-line equation. The slope-intercept form is:

y = mx + b b = y₁ − mx₁

After calculating m, substitute either known point into b = y − mx. The calculator does this automatically in Two points mode and displays the resulting equation in the breakdown. For a horizontal line, the equation simplifies to y = constant. For a vertical line, slope-intercept form is not available, so the equation is written as x = constant.

In Rise & run mode, slope alone is not enough to determine one unique line because many parallel lines can share the same slope. You also need at least one point. That is why the calculator shows the slope and direction but does not invent an intercept.

Slope versus point-slope form

Slope answers “how fast does y change relative to x?” Point-slope form answers a different question: “what is the equation of the line when one point and the slope are known?” Keeping those tasks separate makes each calculator clearer. If you later need to build an equation from one point and a known slope, a dedicated Point-Slope Form Calculator is the more direct tool.

How to interpret positive and negative slope

A positive slope means y increases as x increases. A negative slope means y decreases as x increases. The absolute value measures steepness: |2| and |−2| are equally steep, but they run in opposite directions. A slope close to zero is flatter than a slope with a large absolute value.

Be careful with the word “steep.” Comparing slopes by ordinary numeric size can be misleading because −5 is numerically less than −1 but is steeper in magnitude. When comparing steepness only, compare absolute values.

Slope as a rate of change

In a straight-line relationship, slope is a constant rate of change. If distance rises by 60 kilometers every hour, a graph of distance against time has slope 60 kilometers per hour. If account balance falls by 25 dollars each week, its slope is −25 dollars per week. The units come from “y units per x unit.”

For a nonlinear function, the slope between two selected points is the slope of the secant line joining them. That is the average rate of change over the interval, not necessarily the instantaneous slope at every point. This distinction matters when working with curves.

Common slope mistakes to avoid

When should you use rise/run instead of two points?

Use rise/run when a diagram, graph or real-world measurement already gives you the vertical and horizontal changes directly. Use two points when coordinates are known. Mathematically they are the same calculation because the coordinate differences are the rise and run.

The two-point method is usually better when you also want the line equation because actual coordinates provide the position of the line. Rise and run alone describe direction and steepness but not where the line sits on the coordinate plane.

Frequently asked questions

What is the formula for slope?

The slope between two points is m = (y₂ − y₁) ÷ (x₂ − x₁). This is the same as rise divided by run.

Can slope be negative?

Yes. A negative slope means the line moves downward as x increases. For example, a slope of −2 means y decreases by 2 units for each 1-unit move to the right.

What does a slope of 0 mean?

A slope of 0 means there is no vertical change as x changes. The line is horizontal and can be written as y = a constant.

Why is a vertical line's slope undefined?

For a vertical line, x₂ − x₁ = 0. Since the slope formula would require division by zero, the slope is undefined.

Does reversing the two points change the slope?

No. If you reverse both subtraction orders, both rise and run change sign, so their ratio remains the same.

How do I convert slope to percent grade?

Multiply the slope by 100. A slope of 0.12 corresponds to a 12% grade. A negative slope produces a negative grade.

How do I convert slope to an angle?

For a nonvertical line, use θ = arctan(m). The calculator reports the principal angle in degrees.

Can one point determine a slope?

No. One point alone does not determine a unique slope. You need a second point or an independent rise/run or slope value.