Slope & line equations
Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). With the slope and one point, write the line as y = mx + b (slope-intercept form) or y − y₁ = m(x − x₁) (point-slope form).
| Use it to | Formula |
|---|---|
| Slope | m = (y₂ − y₁) / (x₂ − x₁) |
| Slope-intercept form | y = mx + b |
| Point-slope form | y − y₁ = m(x − x₁) |
| Parallel lines | m₁ = m₂ |
| Perpendicular lines | m₁ × m₂ = −1 (neither line vertical) |
Slope & line equations calculator
Describe a direction, then locate the line. Change a value and the diagram, result, and working update together.
Your measurements
Drag either point on the grid, or enter its coordinates. Coincident points have no unique line.
Why it works
The idea
Slope is vertical change divided by horizontal change. Positive slope rises from left to right; negative slope falls. Once slope m is known, use a point to find b in y = mx + b, or write the point-slope form y − y₁ = m(x − x₁).
Work through an example
1Work through an example
- The line through (1, 2) and (4, 8) has slope (8 − 2)/(4 − 1) = 2. Substituting (1, 2) gives 2 = 2 × 1 + b, so b = 0 and the equation is y = 2x.
Common mistakes
- Vertical lines have undefined slope and equations such as x = 3. Horizontal lines have slope zero. Two identical points do not determine a unique line.
Make the formula move.
Open the full tool for a larger workspace.