Slope Calculator

Slope, distance, midpoint and angle between two points.

Quick answer

  • Formula: Slope m = (y₂ − y₁) ÷ (x₂ − x₁); Distance = √((x₂−x₁)² + (y₂−y₁)²)
  • Worked example — Slope (m): 1.3333 (full example below).

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

Sources & methodology

This calculator applies the formula shown on this page exactly as written, using the standard definitions for its inputs. Results are computed from the values you enter — no data is stored — and are rounded only for display.

Content last reviewed by CalcHub Editorial.

Embed this calculator on your site

Free to use with attribution — paste the snippet below and the calculator appears on your page, with a link back to CalcHub.

<iframe src="https://calculator-site-57a.pages.dev/embed/slope-calculator" width="100%" height="640" style="border:1px solid #d9e2ea;border-radius:12px" loading="lazy" title="Slope Calculator — CalcHub"></iframe>

Open the embed version →