Skip to main content
Categories
Table of contents

Slope calculator

This slope calculator helps you quickly determine the steepness and direction of a line between two points.

By entering the coordinates (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), the calculator computes the slope using the formula m=y2y1x2x1m = \frac{y_2 – y_1}{x_2 – x_1}​​. The slope tells you how much the line rises or falls for each unit it moves to the right. A positive slope means the line increases, a negative slope means it decreases, zero slope indicates a horizontal line, and an undefined slope represents a vertical line. This tool is useful for algebra, geometry, physics, economics, and any situation where understanding rate of change is important.

If the 2 points are known

If 1 point and the slope are known

OR °

Related calculators:


What is slope?

Slope is a measure of both the steepness and direction of a line. In mathematics it is usually written as m and is sometimes called the gradient. Whether you’re working through a geometry problem or designing a drainage channel, slope gives you a precise, single number to describe how a line behaves.

The greater the absolute value of m, the steeper the line. The sign of m tells you which way the line leans.

How slope is defined

The slope measures how much the vertical position (up/down) changes for every unit of horizontal movement (left/right). In other words, slope is a ratio that compares the rise to the run between two points on a line.

Mathematically, the slope between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is calculated using the formula:

Slope(m)=y2y1x2x1 \text{Slope} (m) = \frac{y_2 – y_1}{x_2 – x_1}

Here’s what each part represents:

  • (y2y1)(y_2-y_1) is the change in vertical position (rise).
  • (x2x1)(x_2-x_1) is the change in horizontal position (run).

If you prefer, this can also be read as:

rise ÷ run

This ratio tells you how steep the line is and whether it goes up or down as you move from left to right.

Interpreting the slope value

Depending on the result of the formula:

  • m > 0 — the line climbs from left to right (positive slope)
  • m < 0 — the line descends from left to right (negative slope)
  • m = 0 — the line is horizontal; no rise at all (zero slope)
  • m is undefined — the line is vertical; Δx = 0, so division is impossible (undefined slope)

Additional results that the calculator provides

While the slope itself tells you the steepness of a line, this calculator also returns:

Angle of Incline

By taking the arctangent (inverse tangent) of the slope, you can find the angle θ\theta between the line and the horizontal axis. This tells you how tilted the line is in degrees.

m=tan(θ)m=tan(θ)

Distance between two points

When you know two points, you can also calculate the straight-line distance between them using the distance formula, which is derived from the Pythagorean theorem:

d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 – x_1)^2 + (y_2 – y_1)^2}

Here, the horizontal and vertical differences between the two points form the two legs of a right triangle, and d is the hypotenuse.

Example

If your two points are ((3, 4)) and ((6, 8)):

  1. Vertical change: (8 – 4 = 4)
  2. Horizontal change: (6 – 3 = 3)
  3. Slope: (4 ÷ 3 ≈ 1.33)
  4. Distance: (32+42=5\sqrt{3^2 + 4^2}=5)
  5. Angle of the incline: θ=tan1(4/3)53.13θ = tan⁻¹(4/3) ≈ 53.13

Using the slope you can also find the angle of the line relative to the horizontal.

Real-world uses of slope

Slope isn’t just a math concept — it appears all around us. Engineers use it when designing roads and ramps, ensuring safe grades for vehicles and accessibility. Architects apply it to roof pitches and drainage systems. In geography, slope describes the steepness of terrain and is used in mapping and land surveys. Even in economics and science, slope is used to represent rates of change in graphs and data models.

Slope in calculus

For straight lines, slope is constant. But for curves, the steepness changes at every point. In calculus, the derivative of a function at any given point gives the instantaneous rate of change — essentially the slope of the line tangent to the curve at that point. This extends the concept of slope far beyond straight lines into the broader world of mathematical analysis.