Slope Calculator

Slope, distance, midpoint and angle between two points.

Slope Calculator

Worked example result
Slope (m)1.3333
Distance between the points5.0000
Midpoint(1.5, 2)
Angle to the horizontal53.13 °

From (0, 0) to (3, 4): the slope is 4/3 ≈ 1.3333, the distance is exactly 5 (a 3-4-5 triangle), the midpoint is (1.5, 2), and the angle is about 53.13°.

The slope of a line through two points measures its steepness: rise over run, the change in y divided by the change in x. A slope of 2 climbs twice as fast as it advances; a negative slope falls as x increases.

Enter the coordinates of two points. As well as the slope you get the straight-line distance between the points, their midpoint, and the angle the line makes with the horizontal in degrees.

The formula

Slope m = (y₂ − y₁) ÷ (x₂ − x₁); Distance = √((x₂−x₁)² + (y₂−y₁)²)

Worked example

From (0, 0) to (3, 4): the slope is 4/3 ≈ 1.3333, the distance is exactly 5 (a 3-4-5 triangle), the midpoint is (1.5, 2), and the angle is about 53.13°.

The example is pre-loaded in the result panel — press Calculate with your own numbers to replace it.

Frequently asked questions

Why is the slope of a vertical line undefined?

A vertical line has run = 0, and slope divides by the run — division by zero is undefined. Its angle, however, is a clean 90°.

What does a slope of 0 mean?

A perfectly horizontal line: y does not change as x increases. In real terms, a road with gradient 0 is flat, while a gradient quoted as 10% is a slope of 0.1.

Category: Math calculators