Slope Calculator

Interpret results & try examples ↓

Find slope, a line equation, angle and distance from two points, including vertical-line handling.

Enter your values

Calculations run on your device; inputs are not sent to our server.

Read the slope in context

A slope of 0.25 means y increases by 0.25 for every one-unit increase in x. A physical grade of 25% applies only when both axes measure length in the same unit.

Examples replace the inputs above. Use Reset values to restore defaults.

Avoid three common interpretation errors

From (0,0) to (4,1), rise/run = 1/4 = 0.25. Grade is 25%, while angle is atan(0.25) ≈ 14.0362°; 25% is not 25°. The straight-line distance is √17 ≈ 4.1231 in the coordinate unit.

If x is time and y is cost, slope has units of cost per unit of time; it is not a physical gradient and the displayed angle or distance has no direct geometric meaning. Use equal length units for a physical slope.

Points (2,1) and (2,5) form the vertical line x=2: division by zero makes slope undefined. Two identical points do not define a unique line. A nearly zero horizontal difference can produce a very large slope, so check measurement precision before interpreting the number.

Measure a roof from rise and run →

Reviewed 2026-11-08 · Worked cases and input boundaries checked; not validation of every real-world situation. OpenStax — Slope of a line · Validation scope

Slope and equation

m = (y₂ − y₁)/(x₂ − x₁), and b = y₁ − mx₁ gives y = mx + b. Distance is √((Δx)²+(Δy)²). The angle uses atan(m), expressed between −90° and 90°; it is line inclination, not a directional compass bearing.

Worked example

Points (1,2) and (4,8) give Δx=3, Δy=6, slope 2 and y=2x. Distance is √45 ≈ 6.708204. Reversing the points leaves the slope and distance unchanged.

Special cases

Equal x coordinates with different y values form a vertical line x=constant; slope is undefined, not zero. Equal y values give a horizontal line with slope zero. Two identical points cannot determine one unique line and are rejected. Coordinates are limited to ±1 billion.

Unexpected result? Tell us the inputs and what you expected.