Slope Calculator

Slope, y-intercept, line equation, angle, distance and midpoint from two points.

Reviewed by the WorldCalcs team · Methodology · Last reviewed: June 2026

Point 1

Point 2

Slope (m)

2

y-intercept (b)

0

Equation

y = 2x

Angle

63.434949°

Distance

4.472136

Midpoint

(2, 4)

What is slope?

Slope measures how steep a straight line is — how much it rises (or falls) vertically for each step it takes horizontally. It is often called "rise over run." A positive slope climbs from left to right, a negative slope descends, a slope of zero is a flat horizontal line, and a vertical line has an undefined slope because its run is zero. This calculator finds the slope between two points and also gives the y-intercept, the full line equation, the angle of incline, the distance between the points, and their midpoint. The distance step uses the same idea as the Pythagorean theorem calculator, and once you have a line equation you can explore curves with the quadratic formula calculator.

How it's calculated

Given two points (x₁, y₁) and (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁) — the change in y divided by the change in x. The y-intercept comes from b = y₁ − m·x₁, which lets you write the line as y = mx + b. The angle the line makes with the horizontal is arctan(m), converted to degrees. The distance between the points is √((x₂ − x₁)² + (y₂ − y₁)²), and the midpoint is ((x₁ + x₂)/2, (y₁ + y₂)/2).

Example

For the points (1, 2) and (3, 6), the slope is (6 − 2) / (3 − 1) = 4 / 2 = 2. The y-intercept is 2 − 2×1 = 0, so the line is y = 2x. The line rises at an angle of about 63.43°, the two points are 4.472136 units apart, and their midpoint is (2, 4).

All calculations happen in your browser. Nothing is sent, stored, or tracked.

Results are estimates and may contain errors — for general information only, not professional advice. Always verify before relying on them. Disclaimer

How to use

Enter the coordinates of two points. The calculator returns the slope of the line through them, the y-intercept, the full line equation, the angle the line makes with the horizontal, the distance between the points and their midpoint.

Decimals and negative numbers are fine. If the two x-values are equal the line is vertical and the slope is undefined.

Frequently asked questions

What is slope?+

Slope is the steepness of a line: the vertical change divided by the horizontal change between any two points on it, written as m and described as "rise over run."

How do you find slope from two points?+

Subtract the y-values, subtract the x-values in the same order, then divide: m = (y₂ − y₁) / (x₂ − x₁). For (1, 2) and (3, 6) that is 4 / 2 = 2.

What is the slope of a vertical line?+

It is undefined. A vertical line has no horizontal change, so the formula would divide by zero. Its equation is written x = a constant.

What is the slope of a horizontal line?+

Zero. A horizontal line has no vertical change, so the rise is 0 and the slope is 0. Its equation is y = a constant.

What does a negative slope mean?+

The line falls from left to right — as x increases, y decreases. The steeper the descent, the more negative the slope.

How do I find the y-intercept?+

Once you have the slope m, use b = y₁ − m·x₁ with either point. The y-intercept is where the line crosses the y-axis, at x = 0.

What is the angle of a slope?+

The angle of incline is arctan(slope), measured from the horizontal. A slope of 1 is 45°, and a slope of 2 is about 63.43°.

What is the difference between slope and distance?+

Slope describes the line's steepness (a ratio), while distance is how far apart the two points are (a length). This tool reports both.