Slope Calculator

Slope is the rate at which one quantity changes with another, and on a graph it is simply how steep a line is. This slope calculator takes two coordinate points and returns the slope, the angle the line makes with the horizontal, the rise and run, the straight-line distance and the midpoint, which is everything you normally need when you have two points and want to describe the line through them.

What Is the Slope Calculator?

The slope of a line describes its steepness, and mathematically it is the change in y divided by the change in x. A slope of 2 means the line climbs two units for every unit it moves sideways, and a slope of minus 0.5 means it falls half a unit for every unit across.

Between two points this is the difference in y over the difference in x, the same rule that appears in the gradient of a road, the pitch of a roof and the rate of change of any function.

How the Slope Formula Works

Slope = (y2 − y1) ÷ (x2 − x1)

The order of the points does not matter, because swapping them changes the sign of both the numerator and the denominator and the result is unchanged. The angle of inclination is the arctangent of the slope, which converts the gradient into the direction the line points relative to the horizontal axis.

A vertical line has no slope because the horizontal change is zero, and the calculator reports that case explicitly rather than returning an infinite number.

Reading the Result

The rise and run rows tell you how far the line moves vertically and horizontally between the two points, which is useful when you need to lay out a path or check a measurement on a drawing.

The distance row applies the Pythagorean theorem to the same two changes and gives the straight-line length between the points. The midpoint row gives the centre of the segment, which is what you need when the point must be marked on a physical line.

Slope in the Real World

Road gradients are quoted as a percentage, which is the slope multiplied by 100. A road with a slope of 0.08 is an 8 percent grade, meaning it rises 8 metres for every 100 metres travelled horizontally, which is about 4.6 degrees.

The same idea applies wherever a rate is quoted per unit distance: the gradient of a roof, the inclination of a ramp for wheelchair access, and the rate of change of a cost against volume. Getting the sign right matters, because a negative slope and a positive slope describe opposite behaviours.

Frequently Asked Questions

How do I find the slope between two points?

Subtract the y values and subtract the x values, then divide the first result by the second. For (2,3) and (6,11) the change in y is 8 and the change in x is 4, giving a slope of 2.

What does a slope of zero mean?

A slope of zero means y does not change as x changes, which describes a horizontal line. It also means the two points have the same vertical coordinate.

Why is the slope undefined for a vertical line?

Because the change in x is zero and the formula divides by it. A vertical line has an angle of inclination of 90 degrees, and its rate of change in y is infinite rather than undefined in the practical sense.

What is the difference between slope and gradient?

They are the same quantity expressed differently. Slope is the ratio of rise to run, while gradient is usually the percentage form of that ratio, so a slope of 0.05 is described as a 5 percent gradient.

Does the order of the two points affect the answer?

No. Reversing the points swaps the signs of both the numerator and the denominator, so the slope is unchanged. The same is true for the distance and the midpoint.

Scroll to Top