No ads, no sign-upChecked 2026-08-24

Slope Calculator

Result

2.0000

Result: 2.0000

Slope is the change in y divided by the change in x: from (1, 2) to (3, 6) the line climbs 4 for every 2 across, so the slope is 2. It is a bare ratio with no unit, the same number in metres as in miles. A vertical line has no slope, because the change in x is zero.

The numbers at a glance

Held fixed: x of the first point (x₁) 1.0000, y of the first point (y₁) 2.0000, x of the second point (x₂) 3.0000.

y of the second point (y₂)Result
0.0000-1.0000
2.00000.0000
4.00001.0000
6.0000Your value2.0000
8.00003.0000
10.00004.0000
12.00005.0000

Worked examples

Case 1
x of the first point (x₁)
1
y of the first point (y₁)
2
x of the second point (x₂)
3
y of the second point (y₂)
6

2.0000

Open with these values
Case 2
x of the first point (x₁)
0
y of the first point (y₁)
1
x of the second point (x₂)
4
y of the second point (y₂)
3

0.5000

Open with these values
Case 3
x of the first point (x₁)
2
y of the first point (y₁)
5
x of the second point (x₂)
4
y of the second point (y₂)
1

-2.0000

Open with these values

How it's calculated

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

  1. StepEnter both points; the order is free as long as you keep it the same above and below.
  2. StepSubtract the y values, then the x values, in that same order.
  3. ResultDivide the change in y by the change in x — that ratio is the slope.

What this number means

A slope measures how steeply a straight line climbs or falls between two points. It is the rise divided by the run — the change in y divided by the change in x, or (y₂ − y₁) ÷ (x₂ − x₁). Subtract the coordinates in the same order top and bottom, second point minus first, or the sign flips. For the points (1, 2) and (3, 6) the rise is 4 over a run of 2, so the slope is 2. Read the sign for direction and the size for steepness. A positive slope rises from left to right, a negative one falls, and a slope of zero is a flat horizontal line where y never changes. A slope of 2 climbs twice as fast as a slope of 1; a slope of 0.5 is a gentle incline. It is the same quantity as a real-world grade: a five percent wheelchair ramp, a roof pitch, the rate at which one thing changes against another on a graph. The caveat that matters most is the vertical line. If the two x-values are equal the run is zero, the line stands straight up, and the slope is undefined because nothing can be divided by zero — the calculator returns no result rather than a misleading number. And a slope describes a straight line: on curved data it gives only the average rate of change between the two points you picked.

Sign for direction, size for steepness

A positive slope rises from left to right, a negative one falls, and zero is a flat line. A slope of 2 climbs twice as fast as a slope of 1.

A vertical line has no slope

If both x-values are equal the run is zero and nothing can be divided by it. The calculator returns no result rather than a misleading number.

The same quantity as a grade

A ramp gradient, a roof pitch and the rate one thing changes against another on a graph are all this number. A five percent ramp is a slope of 0.05.

Commonly misread

It does not matter which point I call the first.

It does not — as long as you subtract in the same order on top and bottom. Mixing the order flips the sign.

The slope describes my curved data.

A slope describes a straight line. Between two points on a curve it gives the average rate of change, not the rate at either point.

Reference table

x₁, y₁, x₂, y₂Line through the pointsSlope
0, 0, 1, 1y = x1
1, 2, 3, 6y = 2x2
0, 1, 4, 3y = 0.5x + 10.5
0, 3, 2, 3y = 3, horizontal0
2, 5, 4, 1y = -2x + 9, falling-2
-1, -1, 1, 1y = x, through negative ground1

Questions

How do I calculate the slope between two points?

Divide the change in y by the change in x — slope = (y₂ − y₁) ÷ (x₂ − x₁), often called rise over run. For the points (1, 2) and (3, 6) that is (6 − 2) ÷ (3 − 1) = 2. Subtract the coordinates in the same order top and bottom and you get the gradient.

Where does the line cross the y axis?

Once you have the slope m, the y-intercept is b = y₁ − m × x₁ and the line reads y = mx + b. For (1, 2) and (3, 6) the slope is 2, so b = 2 − 2 × 1 = 0 and the line is y = 2x. This page reports the slope itself; the intercept follows from it in one step.

Why is the slope of a vertical line undefined?

A vertical line has the same x value at both points, so the run x₂ − x₁ is zero, and dividing by zero is undefined. The line still exists — x = 4, for instance — it simply has no finite slope. This calculator shows no result in that case rather than a misleading number.

What do positive, negative and zero slopes mean?

A positive slope rises from left to right, a negative slope falls, and a zero slope is a flat horizontal line. The larger the absolute value, the steeper the line: a slope of 2 climbs twice as fast as a slope of 1.

Can the coordinates be negative or zero?

Yes. Any of x₁, y₁, x₂ and y₂ can be negative, zero or positive — points live anywhere on the plane. The only restriction is that the two x values must differ; if x₂ equals x₁ the line is vertical and the slope is undefined.

Sources and last check

  1. mathworld.wolfram.com

Information, not professional advice.