MyCalCute
Install
Calculators / Math / Slope of a line

Slope of a line calculator

Find slope and y-intercept from two points.

On this page

Your result

Slope2
Y-intercept0

Calculator controls

How to calculate

Find slope and y-intercept from two points.

Slope = (y2-y1)/(x2-x1); Y-intercept = y1-(y2-y1)/(x2-x1)*x1

Worked example

First x coordinate: 1; First y coordinate: 2; Second x coordinate: 4; Second y coordinate: 8.

Slope: 2 ; Y-intercept: 0 .

Assumptions and limits

A vertical line has zero horizontal change, so its slope is undefined. Its equation is x equal to the common x coordinate.

Results are rounded for display; calculations use unrounded values. Read our calculation methodology.

Understanding the result

Slope is vertical change divided by horizontal change. The intercept completes the line equation y = mx + b.

When this tool is useful

Find slope and y-intercept from two points.

Understanding your inputs

InputWhat to enter
First x coordinateEnter a number of at least -1000000000 and no more than 1000000000.
First y coordinateEnter a number of at least -1000000000 and no more than 1000000000.
Second x coordinateEnter a number of at least -1000000000 and no more than 1000000000.
Second y coordinateEnter a number of at least -1000000000 and no more than 1000000000.

Frequently asked questions

Why are vertical lines rejected?

A vertical line has zero horizontal change, so its slope is undefined. Its equation is x equal to the common x coordinate.