Toolstia / Slope calculator

Slope calculator

Enter two points and get the slope of the line through them, its equation in y = mx + b form, the distance between the points, the midpoint, the angle with the x-axis and both intercepts.

How it works

  1. Enter x₁, y₁, x₂ and y₂.
  2. Read the slope and the equation of the line.
  3. Check the distance, midpoint, angle and intercepts.

Slope

The slope is the rise over the run: m = (y₂ − y₁) ÷ (x₂ − x₁). It is positive when the line goes up from left to right and negative when it goes down.

Special lines

A horizontal line has slope 0. A vertical line has an undefined slope and the equation x = a number.

Distance and midpoint

Distance = √((x₂ − x₁)² + (y₂ − y₁)²). The midpoint is the average of the two x values and of the two y values.

Equation

Once the slope is known, the intercept is b = y₁ − m x₁.

Questions

What if both points are the same?

No line is defined, and the tool tells you so.

Why does a vertical line have no y-intercept?

Unless it is the y-axis itself, it never crosses it.

Is anything uploaded?

No. Your input stays in your browser and is never sent anywhere.