Maths & numbers

Line slope calculator

Find a line’s gradient and intercept from two points.

Line slope calculator
Esc to restore

Your inputs

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded, and nothing is saved unless you choose “Save result”.

A clear answer. Here’s how.

Slope = (y₂−y₁)/(x₂−x₁), intercept = y₁−slope×x₁. Distinguishes vertical lines from repeated points. A vertical line has no finite slope or y-intercept.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

First x
1
First y
3
Second x
4
Second y
9

Example result

Slope
2
Y-intercept
1