Slope Calculator

slope of a line
Modify the values and click the calculate button to use

If the 2 Points are Known

X1 Y1   X2 Y2
 

If 1 Point and the Slope are Known

X1 =
Y1 =
distance (d) =
slope (m) =   OR  angle of incline (θ) = °    


In mathematics the term slope—also called gradient—quantifies both how steep a line is and which way it points. It is typically symbolized by m. The magnitude |m| reflects the line’s steepness: the greater the magnitude, the sharper the incline. By examining the sign and magnitude of m one can infer the line’s orientation.

Conceptually, slope equals the vertical change divided by the horizontal change—commonly described as "rise over run." This notion is used in fields such as topography and civil engineering, for example when designing road grades. The mathematical expression for slope is:

m = 
y2 - y1
x2 - x1

In the formula above, y2 - y1 = Δy denotes the vertical displacement, while x2 - x1 = Δx represents the horizontal displacement, as illustrated in the accompanying diagram. The segments Δx and Δy together form a right-angled triangle whose hypotenuse d equals the distance between the points (x1, y1) and (x2, y2). Because Δx and Δy create a right triangle, the length d can be computed via the Pythagorean theorem. For a deeper explanation, consult the Triangle Calculator, which also shows how to obtain the inclination angle θ used in the calculator above.

d = √(x2 - x1)2 + (y2 - y1)2

That relation derives from the Pythagorean theorem: the hypotenuse d is known, while the remaining legs are obtained from the differences in the x and y coordinates of the two points. With those coordinates, the angle θ can be calculated with the formula below:

m = tan(θ)

Given the points (3,4) and (6,8) find the slope of the line, the distance between the two points, and the angle of incline:

m = 
8 - 4
6 - 3
 = 
4
3

d = √(6 - 3)2 + (8 - 4)2 = 5

4
3
 = tan(θ)
θ = tan-1(
4
3
) = 53.13°

Although this calculator focuses on straight-line cases, the idea of slope plays a central role in differential calculus. For curves, the instantaneous rate of change varies, and the derivative at a specific point equals the slope of the tangent line to the curve at that location.

Financial Fitness & Health Math Other