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.