All calculators

Education

Slope Calculator

Enter two points and we compute the slope of the line through them. The result shows the rise, the run, the slope value, and the line type, with a step-by-step breakdown that uses your numbers.

Coordinates

Enter two points (x₁, y₁) and (x₂, y₂).

e.g. 1

e.g. 2

e.g. 3

e.g. 6

Step by step

  1. 1. Identify the coordinates. x₁ = 1, y₁ = 2, x₂ = 3, y₂ = 6.
  2. 2. Compute the rise. y₂ − y₁ = 62 = 4.
  3. 3. Compute the run. x₂ − x₁ = 31 = 2.
  4. 4. Divide rise by run. m = 4 / 2 = 2.
  5. 5. Interpret. Line rises from left to right.
Slope (positive)

m =

2

Line rises from left to right

Point 1(1, 2)
Point 2(3, 6)
Rise (y₂ − y₁)4
Run (x₂ − x₁)2
Slope (m)2

The slope formula m = (y₂ − y₁) / (x₂ − x₁) measures how steep a line is and which way it tilts. The sign of m tells you direction; the size of |m| tells you steepness.

Was this helpful?

Examples

(1, 2) and (3, 6)

m = 2 (positive)

(1, 5) and (3, 1)

m = −2 (negative)

(1, 5) and (4, 5)

m = 0 (horizontal)

(3, 1) and (3, 5)

m = undefined (vertical)

How it works

For any two points (x₁, y₁) and (x₂, y₂) on a coordinate plane, the slope of the line through them is:

Slope · m = (y₂ − y₁) / (x₂ − x₁)

The numerator y₂ − y₁ is the rise (the vertical change). The denominator x₂ − x₁ is the run (the horizontal change). When the run is zero, the slope is undefined and the line is vertical. For the related calculations on the same two points, see the distance formula calculator for the line's length and the midpoint formula calculator for its center.

Read the guide: Slope Formula explains rise over run, walks through positive, negative, zero, and undefined cases, and shows how slope fits with distance and midpoint as the three main coordinate-geometry calculations.

Frequently asked questions

The slope formula is m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide. The result is the slope of the straight line connecting the two points.

Pick any two points on the line. Subtract their y-coordinates for the rise (the vertical change). Subtract their x-coordinates in the same order for the run (the horizontal change). Divide rise by run. That ratio is the slope.

Slope describes how steep a line is and which way it tilts. A positive slope rises from left to right; a negative slope falls. A slope of zero is a horizontal line. The larger the absolute value of the slope, the steeper the line.

When two points have the same x-coordinate (so x₂ − x₁ = 0), the slope formula divides by zero, which is undefined. The line is vertical. Vertical lines have no slope value in the usual sense; they are described as having undefined or infinite slope.

Zero slope means the line is horizontal. The two points have the same y-coordinate, so the rise (y₂ − y₁) is zero. The line does not go up or down as you move along it.

Yes. A negative slope means the line falls from left to right: as x increases, y decreases. The negative sign comes from the rise: if y₂ is smaller than y₁, the difference (y₂ − y₁) is negative.

Yes. The four coordinate fields accept decimals and negative numbers. The calculator handles vertical lines (undefined slope) explicitly and reports the slope, the rise, and the run side by side so you can see how the answer was constructed.