BYTETOOLS

Slope Calculator

Find the slope, midpoint, distance, line equation and angle of incline from two points. Free slope calculator that handles vertical lines too.

Point 1

Point 2

1.333333
Slope (m)
5
Distance
(2.5, 4)
Midpoint
53.130102Β°
Angle

Line equation

y = 1.333333x + 0.666667

  • Slope from any two points
  • Midpoint and distance between the points
  • Line equation in y = mx + b form
  • Angle of incline in degrees
  • Correctly handles vertical (undefined-slope) lines
  • Instant, private, in-browser results

How to use the Slope Calculator

  1. 1

    Enter the coordinates of the first point, x₁ and y₁.

  2. 2

    Enter the coordinates of the second point, xβ‚‚ and yβ‚‚.

  3. 3

    Read the slope, midpoint, distance and angle of incline.

  4. 4

    Check the line equation shown in y = mx + b form.

About the Slope Calculator

The ByteTools Slope Calculator takes two points, (x₁, y₁) and (xβ‚‚, yβ‚‚), and returns the slope of the line through them along with its midpoint, the distance between the points, the equation in y = mx + b form, and the angle of incline in degrees.

It is ideal for algebra and geometry students, as well as anyone working with gradients, ramps or road grades. Vertical lines, where the run is zero and the slope is undefined, are handled correctly with a clear x = constant equation instead of a division error.

All calculations happen locally in your browser with JavaScript, so no coordinates are uploaded or stored. Enter your points and read every result update instantly.

Frequently asked questions

How do you calculate the slope between two points?

Slope is the change in y divided by the change in x: m = (yβ‚‚ βˆ’ y₁) / (xβ‚‚ βˆ’ x₁), often called rise over run. A positive slope rises left to right, a negative slope falls, and a slope of zero is a horizontal line.

What happens with a vertical line?

A vertical line has the same x for both points, so the run is zero and the slope is undefined β€” you cannot divide by zero. The calculator recognises this and reports the equation as x = constant instead of a numeric slope.

How do you find the midpoint of two points?

Average the x-coordinates and average the y-coordinates: midpoint = ((x₁ + xβ‚‚)/2, (y₁ + yβ‚‚)/2). It is the point exactly halfway along the segment joining the two points, and the tool computes it automatically.

How is the distance between two points calculated?

The distance uses the Pythagorean formula: √((xβ‚‚ βˆ’ x₁)Β² + (yβ‚‚ βˆ’ y₁)Β²). It measures the straight-line length of the segment between the points, regardless of the line's slope or direction.

What is the angle of incline?

The angle of incline is the angle the line makes with the horizontal, found as the arctangent of the slope. A slope of 1 gives 45 degrees, while a vertical line gives 90 degrees. The calculator reports it in degrees.

Related tools