Slope calculator

Enter two coordinates to calculate slope, point-slope equation, angle of inclination, distance, and the working steps.

Interactive graph of the line through two pointsThe graph shows the selected points and the line between them. Drag to pan and use the controls to zoom.xy

y = 2x

Drag the graph to pan the view or use the wheel and zoom controls to explore the line.

ABOUT THE TOOL

What does this slope mean?

Slope is the rate of change between two points. A line with slope 2 rises 2 units for every 1 unit moved to the right, while a vertical line has an undefined slope because its run is zero.

HOW TO USE IT

  1. Enter x₁, y₁, x₂, and y₂.
  2. Read the rise, run, slope, and angle.
  3. Use the graph to check the line through both points.
  4. Try a positive, negative, horizontal, or vertical example.

What is slope?

Slope measures how steep a line is: how much y changes for each unit of x. Given two points, use m = (y₂ − y₁)/(x₂ − x₁). The numerator is the rise and the denominator is the run. A positive slope rises from left to right, a negative slope falls, and a zero slope is horizontal.

Calculation steps from two points

Enter the coordinates of P₁ and P₂, subtract the y-values to find the rise, subtract the x-values to find the run, and divide. The calculator also gives the line equation, angle of inclination, distance, and a graph through the selected points.

Understand special cases

When the two x-coordinates are equal, the run is zero and the line is vertical, so its slope is undefined. A horizontal line has a slope of zero. Use the example buttons to compare positive, negative, zero, fractional, and vertical lines without retyping coordinates.

Slope theory and point-slope form

Slope is a ratio of vertical change to horizontal change: m = rise/run = (y₂ − y₁)/(x₂ − x₁). It is also the coefficient in point-slope form y − y₁ = m(x − x₁). A positive slope means y increases as x increases, a negative slope means y decreases, and a zero slope creates a horizontal line. A vertical line has no finite slope because its run is zero.

Slope calculator example

For P₁ = (1, 2) and P₂ = (4, 8), the rise is 6 and the run is 3, so m = 2. The line through the points is y = 2x, the angle of inclination is about 63.435°, and the distance is √45. Enter the points, then compare the displayed equation and segment with your hand calculation. This same workflow works for negative, fractional, horizontal, and vertical lines.

Point-slope calculator example

For points (−2, 5) and (4, −7), the rise is −12 and the run is 6, so the slope is −2. Using point-slope form with (−2, 5) gives y − 5 = −2(x + 2), which simplifies to y = −2x + 1. The graph should pass through both original points and fall two units for every unit moved right.

Slope as a real-world rate

If a line represents distance over time, slope can describe speed; if it represents cost over items, slope can describe the cost per item. The units matter: a rise of 12 dollars over a run of 3 items gives a slope of 4 dollars per item. Use the calculator’s rise, run, and angle values to connect the numerical result to the situation being modeled.

COMMON QUESTIONS

Frequently asked questions

How do I calculate slope from two points?

Subtract the first y-coordinate from the second, subtract the first x-coordinate from the second, then divide rise by run: m = (y₂ − y₁)/(x₂ − x₁).

Can slope be negative?

Yes. A negative slope means the line falls as x increases.

What is the slope of a vertical line?

It is undefined because the run is zero, so division by zero is not allowed.

What is the slope of a horizontal line?

It is zero because the y-values do not change as x changes.

Does the order of the two points matter?

No. Reversing both points changes the signs of the rise and run, so their ratio stays the same.

How do I write point-slope form?

Use y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is either known point.

What does the angle of inclination mean?

It is the angle measured counterclockwise from the positive x-axis to the line, usually reported between 0° and 180°.