Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Gradient Calculator

Calculate the gradient of a line between two points. Enter x1, y1, x2, y2 and get the slope, useful for line equations and graphs.

Enter the Details

 

 


Result will appear here...


Last updated: April 11, 2026

Created by: Eon Tools Dev Team

Reviewed by: Okan Atalay



What this calculator does

So, you have two points and you want the gradient of the line through them, together with the pieces that make it up. This tool gives you the gradient, but it does not stop at the single number: it also reports the rise, the run, the straight-line distance between the two points, and the angle the line makes with the horizontal.

You enter the coordinates of both points, and it returns the whole set at once.

How to use it

  1. Enter the x and y of point 1.
  2. Enter the x and y of point 2.
  3. Press Calculate.

The two points must have different x-values. If they share an x-value the line is vertical, and a vertical line has no gradient, so the tool says so instead of giving a misleading figure.

Gradient is another word for slope

First, a point that saves a lot of confusion: gradient and slope are the same thing. Gradient is the term used more in British schooling, slope the term used more in American schooling, but both mean rise over run, the steepness of a line. So if you have met slope before, you already know what a gradient is. What makes this tool worth using is not a different quantity, it is the fuller breakdown it shows around that quantity.

Rise, run, and the gradient itself

The gradient is the rise divided by the run, where the rise is the change in y between the two points and the run is the change in x. This tool shows all three separately: the rise on its own, the run on its own, and the gradient they produce. Seeing the rise and run laid out, rather than folded into one number, makes it clear where the gradient comes from. A rise of 6 over a run of 3 is a gradient of 2, and the tool shows you each part of that rather than just the 2.

The angle and the distance it also gives

Two extra readings come with it. The first is the angle the line makes with the horizontal, in degrees. Gradient and angle are tied together, since the gradient equals the tangent of that angle, so a gradient of 1 is a line rising at exactly 45 degrees, and steeper gradients give larger angles. The tool works the angle out for you, which turns an abstract gradient into something you can picture as a tilt.

The second is the distance between the two points, the straight-line length from one to the other. That comes from the Pythagorean theorem applied to the rise and the run: the distance is the square root of the rise squared plus the run squared. So in one calculation you get not just how steep the line is, but how far apart the points sit and at what angle the line leans.

A worked example, step by step

Take the points (1, 1) and (4, 5).

  • Rise: 5 - 1 = 4. Run: 4 - 1 = 3. Gradient: 4 / 3, about 1.33.
  • Distance: square root of (4 squared + 3 squared) = square root of 25 = 5.
  • Angle: the tilt whose tangent is 4/3, about 53 degrees.

So the line has a gradient of roughly 1.33, the points are 5 units apart, and the line leans at about 53 degrees.

Vertical lines

As with slope, a vertical line has no gradient. Its two points share an x-value, so the run is zero, and gradient is rise over run. Dividing by a run of zero is undefined, which is why a vertical line cannot be given a gradient, and the tool flags that case rather than returning a number that would not mean anything.

Questions people ask

Is gradient the same as slope?

Yes. They are two names for the same quantity, rise over run. Gradient is the more common British term, slope the more common American one.

What does this give that a plain slope tool does not?

The rise and run shown separately, the straight-line distance between the points, and the angle the line makes with the horizontal, alongside the gradient itself.

How is the angle related to the gradient?

The gradient is the tangent of the angle the line makes with the horizontal. A gradient of 1 is a 45 degree line, and steeper gradients mean larger angles.

How is the distance found?

By the Pythagorean theorem on the rise and run: the distance is the square root of the rise squared plus the run squared.

Why is a vertical line undefined?

Because its run is zero, and gradient divides by the run. Dividing by zero has no value, so a vertical line has no gradient.

References

On gradient, angle, and the coordinate plane. The gradient is the rise over the run, equal to the tangent of the line's angle of inclination, all set within the coordinate system that lets points be handled as pairs of numbers.

  1. Christopher Stover and Eric W. Weisstein, "Line," from MathWorld, a Wolfram resource, on the line and its slope, or gradient, in the plane.
  2. "Cartesian coordinates," Encyclopaedia Britannica, on the coordinate plane, introduced by Descartes, in which points, distances, and angles are measured.


Okan Atalay

Okan Atalay is a results driven senior operations manager and a graduate of Industrial Engineering from Bilkent University. With over 22 years of experience in textile manufacturing and integrated operations, he has led large scale business process improvements and strategic planning initiatives. Currently, he serves as a top mathematics expert for a global ed tech platform, where he applies his analytical expertise to solve complex mathematical problems. At Eon Tools, he reviews converter and maths tools.