How to Use the Slope Calculator
This slope calculator finds the slope, y-intercept, and full line equation between any two points — enter the coordinates (x₁, y₁) and (x₂, y₂) and it instantly returns the slope, y-intercept, full line equation, distance between the points, angle of inclination, rise, and run. Vertical lines (where x₁ = x₂) are handled gracefully — the calculator shows "undefined slope" and the equation x = constant. For finding the center of a line segment, see our midpoint calculator.
The result updates as you type. Use the Share button to copy a link with your inputs pre-filled for sharing or saving.
The Slope Formula
Slope is defined as the ratio of vertical change to horizontal change between any two points on a line:
m = (y₂ − y₁) / (x₂ − x₁) = rise / run
Once you have the slope, the y-intercept b follows from the point-slope form:
b = y₁ − m · x₁
And the complete line equation in slope-intercept form is:
y = mx + b
The angle of inclination θ (the angle the line makes with the positive x-axis) is:
θ = arctan(m), expressed in degrees
Interpreting Slope
The slope tells you two things: the direction of the line and how steep it is.
- Positive slope (m > 0) — line rises from left to right. Example: a savings account balance growing over time.
- Negative slope (m < 0) — line falls from left to right. Example: a car depreciating in value over time.
- Zero slope (m = 0) — horizontal line. The y-value does not change as x increases. Example: a constant temperature reading.
- Undefined slope — vertical line (x₁ = x₂). The run is 0, so the ratio is undefined. Vertical lines cannot be written in slope-intercept form; their equation is x = constant.
The magnitude of the slope determines steepness: m = 0.1 is nearly flat; m = 1 is 45°; m = 10 is nearly vertical. For very steep lines, the angle of inclination (arctan of the slope) is more intuitive than the slope itself.
Slope in Real Life
Slope has direct, tangible meanings in many applied contexts:
- Road grades — a 6% grade means a rise of 6 feet per 100 feet of horizontal run (m = 0.06). Steep for a road; typical for mountain highways.
- Ramps and accessibility — ADA wheelchair ramps must not exceed a 1:12 slope (rise:run = 1/12 ≈ 8.3%), meaning 1 inch of rise per 12 inches of run.
- Roofing — roof pitch is expressed as rise-over-run (e.g., 6/12 means 6 inches of rise per 12 inches of run, or m = 0.5).
- Economics — in a linear supply or demand curve, slope tells you how sensitive price is to quantity (or vice versa).
- Physics — velocity is the slope of a position-time graph; acceleration is the slope of a velocity-time graph.
Parallel and Perpendicular Lines
The relationship between slopes of special line pairs:
- Parallel lines — same slope (m₁ = m₂), different y-intercepts. Example: y = 2x + 1 and y = 2x − 3 are parallel.
- Perpendicular lines — slopes are negative reciprocals: m₁ × m₂ = −1, so m₂ = −1/m₁. Example: if m₁ = 3, then m₂ = −1/3. The angle between perpendicular lines is exactly 90°.
- Collinear points — three points are collinear (on the same line) if and only if the slope between any two pairs of them is equal.
For distance-related geometry problems, our distance formula calculator computes the length of the segment between any two points.
Step-by-Step Example
Problem: Find the slope, y-intercept, and equation of the line through (−2, 1) and (4, 13).
- Rise = 13 − 1 = 12
- Run = 4 − (−2) = 6
- Slope m = 12 / 6 = 2
- y-intercept b = 1 − 2·(−2) = 1 + 4 = 5
- Line equation: y = 2x + 5
- Distance: √(6² + 12²) = √(36 + 144) = √180 ≈ 13.42
- Angle: arctan(2) ≈ 63.43°
Verification: plug x = −2 into y = 2x + 5: y = 2(−2) + 5 = 1 ✓. Plug x = 4: y = 2(4) + 5 = 13 ✓.
Sources & References
- Slope of a Line — Khan Academy
- Slope-Intercept Form — Math Is Fun