Skip to main content
🔢 Geometry

Slope Calculator

Enter two points to find the slope (gradient), the angle of incline, the y-intercept, the full line equation y = mx + b, and the distance between them — all the basics of a line, at once.

Slope (rise/run)
Angle of incline
Line equation
Distance
100% Free
🔢 Open All Math Calculators 📖 Read the Guide

Slope — Quick answer

Slope is rise over run between two points. From it you get the angle, intercept and line equation.

m = (y₂ − y₁) ÷ (x₂ − x₁)  ·  b = y₁ − m·x₁  ·  y = mx + b

Worked example: (1, 2) → (4, 8): slope 2, angle 63.43°, equation y = 2x, distance 6.7082.

More examples

PointsSlopeEquation
(0,0)→(3,4)1.3333y = 1.3333x
(2,3)→(5,9)2y = 2x − 1
(1,5)→(4,5)0y = 5 (flat)
(3,1)→(3,7)undefinedx = 3 (vertical)

Vertical lines (equal x) have an undefined slope.

🔢 Slope Calculator

Enter the coordinates of two points, (x₁, y₁) and (x₂, y₂).

Slope (m)
Angle of incline
Line equation
Distance

⚠️ Slope = rise ÷ run. If the two x-values are equal the line is vertical and the slope is undefined (division by zero). The angle is measured from the horizontal.

The slope of a line is its steepness and direction — rise over run, the change in y divided by the change in x between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). From the slope and one point you get everything else about the line: the angle it makes with the horizontal, its y-intercept, and its equation y = mx + b. This calculator works all of those out at once, plus the straight-line distance between your two points.

Reviewed: June 20, 2026 · Author: Naveen P N, Founder — AI Calculator · Verified against: the standard slope, intercept and distance formulas, recomputed in code.

The formulas

Slope
m = (y₂ − y₁) ÷ (x₂ − x₁)
Angle & intercept
angle = arctan(m) · b = y₁ − m·x₁ · equation y = mx + b
Distance
d = √((x₂ − x₁)² + (y₂ − y₁)²)

The slope is the heart of it: positive means the line rises left-to-right, negative means it falls, zero is flat. The angle comes from the arctangent of the slope. The y-intercept b is found by rearranging y = mx + b for the known point. And the distance — the length of the segment between the points — uses the Pythagorean-based distance formula. If x₂ = x₁, the run is zero, so the slope is undefined and the line is vertical.

Worked example — (1, 2) to (4, 8)

Scenario: find the slope and line through (1, 2) and (4, 8).

Slope
(8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2
Intercept & equation
b = 2 − 2×1 = 0 → y = 2x
Angle & distance
arctan(2) = 63.43° · √(9 + 36) = 6.7082

The line has slope 2 — it rises two units for every one across — makes a 63.43° angle with the horizontal, and its equation is y = 2x (it passes through the origin, so b = 0). The two points are 6.7082 units apart. Change the points and the calculator handles every case: a flat line gives slope 0, and equal x-values give an undefined slope (a vertical line).

Frequently Asked Questions

What is the slope formula?

m = (y₂ − y₁) ÷ (x₂ − x₁). For (1,2)→(4,8): 6 ÷ 3 = 2.

How do I find the line equation?

y = mx + b, with b = y₁ − m·x₁. For (1,2)→(4,8): y = 2x.

Negative or zero slope?

Positive rises, negative falls, zero is flat. Equal x = vertical = undefined.

How is the angle found?

angle = arctan(m). Slope 1 = 45°, slope 2 ≈ 63.43°.

What else does it give?

Angle, y-intercept, line equation, and distance √((Δx)²+(Δy)²).

Need more math tools?

Explore distance, Pythagorean, quadratic, percentage and more across the AI Calculator math suite.

🔢 Open Math Calculators — Free

No registration required · 350+ calculators · PDF report export