Search tools

Find a tool by name or what it does.

Slope Calculator

Enter two points to get the slope, the incline angle, the y-intercept, the line equation, and the distance between them.

Point 1

Point 2

Coordinates can be decimals or negative. Everything is calculated in your browser and updates as you type.

Results

2
Slope (m), rise over run. The line rises from left to right.
y = 2x + 1
Line in slope-intercept form, y = mx + b
63.43°
Angle from horizontal
1
Y-intercept (b)
4.472136
Distance (length)
4
Rise (change in y)
2
Run (change in x)

Everything is calculated in your browser. Nothing is uploaded.

How to calculate slope from two points

  1. Enter the first point

    Type the x and y coordinates of your first point into the Point 1 fields.

  2. Enter the second point

    Type the x and y coordinates of your second point into the Point 2 fields.

  3. Read the results

    The slope, angle, y-intercept, line equation, and distance update as you type, with no button to press.

  4. Copy the answer

    Click the copy button to put the full set of results on your clipboard.

Why use this tool

Slope from two points

Enter any two points and get the slope as rise over run, so (1, 3) and (3, 7) return a slope of 2.

Angle, intercept, and equation

Alongside the slope you get the incline angle in degrees, the y-intercept, and the line in slope-intercept form, like y = 2x + 1.

Distance between the points

The length of the segment joining the two points is measured with the distance formula, so you get the straight line distance as well.

Handles vertical and equal points

A vertical line reports an undefined slope with a 90 degree angle, and two identical points are flagged instead of returning a broken result.

Decimals and negatives welcome

Every field accepts decimals and negative coordinates, so points below or left of the origin work just as well.

Runs entirely in your browser

Every calculation happens on your device. Nothing you type is uploaded.

About this tool

The slope of a line measures how steep it is: the change in y divided by the change in x, often called rise over run. Enter two points and this calculator subtracts the coordinates to get the rise and the run, divides one by the other, and reports the slope. Points of (1, 3) and (3, 7) give a rise of 4 and a run of 2, so the slope is 2. A positive slope rises from left to right, a negative slope falls, and a slope of 0 is a flat horizontal line.

From the slope you also get the incline angle in degrees, the y-intercept where the line crosses the vertical axis, and the whole line written in slope-intercept form as y = mx + b. The distance formula measures the straight line length of the segment between the two points, which is the square root of the run squared plus the rise squared. Coordinates can be whole numbers, decimals, or negative, and everything updates the moment you type with no button to press.

Two special cases are handled cleanly. When both points share the same x value the line is vertical, the run is zero, and the slope is undefined, so the calculator reports a 90 degree angle and the line x equals that value instead of dividing by zero. When both points are identical there is no line at all, and you get a short message rather than a wrong answer. For right triangle sides and angles see the triangle calculator, and for wider maths see the scientific calculator.

Frequently asked questions

How do I find the slope between two points?
Enter both points and the calculator subtracts the coordinates to get the rise (change in y) and the run (change in x), then divides the rise by the run. Points of (1, 3) and (3, 7) give a rise of 4 and a run of 2, so the slope is 2.
What is the equation of the line?
The line is shown in slope-intercept form, y = mx + b, where m is the slope and b is the y-intercept. A slope of 2 through a point that gives an intercept of 1 is written as y = 2x + 1. A horizontal line shows as y equals its constant value.
What happens with a vertical line?
When both points have the same x value the run is zero, so the slope is undefined and cannot be divided. The calculator reports an undefined slope, a 90 degree angle, and the line as x equals that value, rather than showing a broken result.
Can I use decimals and negative coordinates?
Yes. Every field accepts decimals and negative numbers, so points below or to the left of the origin work exactly like positive whole numbers. Identical points are flagged, since a line needs two distinct points.
Is my data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server.

Related tools