Slope Calculator

Inputs

First point (x₁, y₁)

Second point (x₂, y₂)

The line through the two points

Results

Slope m
—
Equation (slope-intercept form)
—
y-intercept b
—
x-intercept
—
Point-slope form
—
Distance between the points
—
Midpoint
—
Angle with the x-axis
—

Steps

The slope of a line says how steep it is: how much y goes up for each step of 1 in x. It’s “rise over run”, the change in y divided by the change in x between two points. From the slope and one point you get the line’s equation, which you can use to find any other point on it.

How to use it

  1. Enter the coordinates of the first point and the second point.
  2. Read the slope, the equation and the other results.
  3. Follow the steps to see how they’re worked out.

Examples: through (1, 2) and (4, 8), the slope is 2 and the line is y = 2x; the points are 6.708204 apart and the midpoint is (2.5, 5). Through (0, 1) and (3, 3), the slope is 2/3 and the line is y = (2/3)x + 1.

Questions and answers

What does a negative slope mean?

The line goes down from left to right: y gets smaller as x grows. A slope of 0 is a flat (horizontal) line.

Why is a vertical line's slope undefined?

Both points have the same x, so the run is 0, and you can’t divide by 0. Its equation is simply x = a number.

How do I get the angle from the slope?

The angle with the x-axis is the arctangent of the slope: a slope of 1 is 45°, a slope of 2 is about 63.43°.

Link with pre-filled values

Add # and these parameters to the end of this page's address to open the tool with values already filled in.

ParameterWhat it sets
x1x of the first point.
y1y of the first point.
x2x of the second point.
y2y of the second point.

Example: https://toolabelle.com/slope-calculator/#x1=0&y1=1&x2=3&y2=3

Related tools