Math · FREE ONLINE TOOL

Slope Calculator

Find slope and a line equation from two points, or determine endpoints from a point, distance and direction.

What would you like to calculate?

Your inputs

How it works

Two points

Slope = (y₂−y₁)/(x₂−x₁).

Vertical lines have undefined slope; coincident points do not determine a unique line.

Calculations run in your browser. No account needed.

EXAMPLE RESULTCalculated locally
Slope
2
y-intercept
0
Distance
6.71
Equation
y = 2x + 0
Inclination
63.43 °
Clear inputs. Transparent methods.
My workspace

Calculate with your inputs to save a result or compare scenarios.

How it works

Illustration for Slope Calculator: a chart; a triangle and ruler.
Two pointsSlope = (y₂−y₁)/(x₂−x₁).
A useful distinction

A percent grade is not an angle

A rise of 5 over a horizontal run of 100 gives slope 0.05, or 5% grade. Its angle is approximately 2.86°, not 5°. Keep rise and run in matching length units before converting.

Read the same ramp as a grade and an angle

Result. A (Grade) → 8.33%. B (angle) → 4.76°.
Read the same ramp as a grade and an angle
QuantityCalculationResult
A Grade1 ÷ 12 × 1008.33%
B anglearctan(1 ÷ 12) × 180 ÷ π4.76°

Reading slope from coordinate changes

Slope compares the vertical change with the horizontal change between two points. Keep the point order consistent in both differences. A vertical line has no finite slope under this ratio, while a horizontal line has zero slope. In direction-based mode, check the angle convention and distance input before comparing coordinates with a slope obtained from two known points.

Calculate rise over run in a consistent coordinate order

For two distinct points, slope is (y₂−y₁)/(x₂−x₁). Subtract coordinates in the same order in numerator and denominator. Reversing both differences leaves the slope unchanged; reversing only one changes its sign incorrectly.

Slope is a ratio of vertical units to horizontal units. It is dimensionless only when those units are comparable. On a graph of distance versus time, for example, the slope has units of speed.

Find a line from the points (2,3) and (6,11)

The rise is 11−3=8 and the run is 6−2=4, so the slope is 2. Substituting the first point into y=mx+b gives 3=2×2+b, hence b=−1 and the equation is y=2x−1. The distance between the points is √(4²+8²)=√80≈8.94427.

Two-point line calculation
QuantityWorkingValue
Slope8 ÷ 42
y-intercept3 − 2×2−1
Equationy=mx+by=2x−1
Point-to-point distance√(4²+8²)Approximately 8.94427

Distinguish vertical, horizontal and coincident points

If the x coordinates match and the y coordinates differ, the line is vertical and its slope is undefined. Its equation is x=constant, not y=mx+b. If the y coordinates match, the slope is zero and the line is horizontal.

Identical points do not specify one unique line, so they are rejected. An undefined slope for a vertical line should not be replaced with zero or an arbitrary very large number.

Use distance and direction carefully when finding an endpoint

The Point, distance & direction mode calculates an endpoint from a starting point, length and angle or slope. A slope alone specifies a line but leaves two opposite travel directions; the tool reports both endpoints in that case.

An inclination angle describes direction, while percent grade equals 100×rise/run. A slope of 0.75 corresponds to a 75% grade and an angle arctan(0.75), approximately 36.8699°, not 75°.

Two points: formula and assumptions

Slope = (y₂−y₁)/(x₂−x₁).

Vertical lines have undefined slope; coincident points do not determine a unique line.

Use Two points

Point, distance & direction: formula and assumptions

For slope m, dx=d/√(1+m²), dy=m×dx. For directed angle θ, dx=d cosθ, dy=d sinθ.

A slope alone allows two opposite directions. A directed angle is measured counterclockwise from the positive x-axis.

Use Point, distance & direction

Worked example

Using the Two points example:

Inputs
x₁
1
y₁
2
x₂
4
y₂
8
Method

Slope = (y₂−y₁)/(x₂−x₁).

Result

Example result

Slope: 2

y-intercept: 0

Distance: 6.71

Equation: y = 2x + 0

Inclination: 63.43 °

These are illustrative inputs. Change the values to explore a different scenario.

Formula references

References explain the underlying methods; they do not imply endorsement or individual professional review of Finflo.

Common questions

What does an undefined slope mean?

A vertical line has no finite slope because its horizontal change is zero. Identical points do not determine a unique line.

Does a slope and distance identify only one endpoint?

No. A slope allows two opposite directions from the starting point. A directed angle selects a particular direction.

Does switching the order of the two points change the slope?

No, provided both coordinate differences are reversed together. Both signs change and cancel in the ratio.

Is a 75% grade a 75-degree angle?

No. A 75% grade is slope 0.75, with angle arctan(0.75), about 36.87°.

What is the slope of a horizontal line?

For two distinct points with equal y coordinates, the rise is zero and the slope is 0. This differs from a vertical line, whose horizontal change is zero and slope is undefined.

See our methodology and editorial policy.