Slope Calculator

Calculate the slope (rise over run), y-intercept, line equation, and distance between two points. Supports slope-intercept, point-slope, and standard form.

Slope (m)
Y-Intercept (b)
Equation
Distance Between Points
Extended More scenarios, charts & detailed breakdown
Slope (m)
Y-Intercept (b)
Line Equation
Distance
Midpoint X
Midpoint Y
Professional Full parameters & maximum detail

Core Results

Slope (m)
Y-Intercept (b)
X-Intercept
Rise (Δy)
Run (Δx)

Line Equations

Slope-Intercept Form
Point-Slope Form
Standard Form (Ax+By=C)

Geometry

Angle of Inclination (°)
Distance Between Points
Midpoint X
Midpoint Y

How to Use This Calculator

Enter the coordinates of two points (X₁, Y₁) and (X₂, Y₂). The calculator instantly shows the slope, y-intercept, line equation (y = mx + b), and the distance between the two points.

Formula

Slope: m = (y₂ − y₁) / (x₂ − x₁) • Y-intercept: b = y − mx • Distance: d = √((Δx)² + (Δy)²)

Example

Points (1, 2) and (4, 8): m = 6/3 = 2, b = 0, equation: y = 2x, distance ≈ 6.708

Frequently Asked Questions

  • Slope (m) measures the steepness and direction of a line. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points: m = (y₂ − y₁) / (x₂ − x₁). A positive slope means the line rises from left to right; a negative slope means it falls. A slope of 0 is a horizontal line. For example, points (1, 2) and (4, 8): m = (8−2)/(4−1) = 6/3 = 2, meaning for every 1 unit right, the line rises 2 units.
  • An undefined slope occurs when a line is vertical — both points have the same x-coordinate (x₁ = x₂), making the denominator of the slope formula equal to zero. For example, points (3, 1) and (3, 7): slope = (7−1)/(3−3) = 6/0 = undefined. A vertical line does not have a slope — it goes straight up and down and cannot be expressed as y = mx + b. Its equation is simply x = 3 (or whatever the constant x-value is).
  • Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept (the y-value where the line crosses the y-axis, i.e., where x = 0). For example, y = 2x + 3 has slope 2 and y-intercept 3. This form is the easiest to graph: start at (0, b) and move up/right by the slope. For slope −½, the equation y = −½x + 5 starts at (0, 5) and falls 1 unit for every 2 units to the right.
  • First calculate the slope m = (y₂−y₁)/(x₂−x₁), then substitute one point into y = mx + b and solve for b. Formula: b = y₁ − m×x₁. Example: points (2, 5) and (6, 13). m = (13−5)/(6−2) = 8/4 = 2. Then b = 5 − 2×2 = 5 − 4 = 1. So the line is y = 2x + 1. Verify with the second point: 2×6 + 1 = 13 ✓. Either point can be used — both give the same b.
  • Parallel lines have identical slopes — they never intersect because they rise and run at exactly the same rate. For example, y = 2x + 1 and y = 2x − 3 are parallel (both have slope 2). Perpendicular lines intersect at a right angle (90°), and their slopes are negative reciprocals: m_perp = −1/m. For a line with slope 2, any perpendicular line has slope −1/2. For slope 3, perpendicular slope is −1/3. If slope is 0 (horizontal), the perpendicular is vertical (undefined slope).

Related Calculators