Slope Calculator
Find slope, the line equation, and related measurements from two points.
Find the slope between two coordinate points, see how the rise and run produce it, and get the line equation plus related measurements.
Enter two points
Enter finite coordinates between −1 trillion and 1 trillion. Results update as you type.
Enter all four coordinates to see your results.
Try an example
How to find the slope from two points
Slope measures how much y changes for each unit of x. Find the rise by subtracting y₁ from y₂, then divide it by the run, found by subtracting x₁ from x₂:
m = (y₂ − y₁) ÷ (x₂ − x₁)
A positive slope rises from left to right, a negative slope falls, and a zero slope is horizontal. If the run is zero, the line is vertical and its slope is undefined. If both points are identical, they do not determine a unique line.
This calculator also reports the angle, percent grade, distance, and midpoint for the two points. Coordinates stay in this browser and are not added to the page URL.
Frequently asked questions
How do you calculate slope from two points?
Subtract the first y-coordinate from the second to find the rise, then divide by the change in x, called the run: m = (y₂ − y₁) / (x₂ − x₁).
What does an undefined slope mean?
An undefined slope means both points have the same x-coordinate, so the line is vertical. Its equation is x = that shared coordinate.
What if both points are the same?
One point repeated does not determine a unique line, so there is no single slope or line equation.
What is the difference between slope and percent grade?
Slope is rise divided by run. Percent grade expresses the same ratio as a percentage by multiplying slope by 100.