Line Equation from Two Points
Enter two coordinate points and instantly get the slope-intercept equation, intercepts, and distance with a live graph.
Use the Line Equation from Two Points
Enter Two Points
Results
Equation
Slope (m)
Y-Intercept (b)
X-Intercept
Distance
Graph
Enter two points to see the graph
Copied!
Summary
This calculator takes two coordinate points (x1, y1) and (x2, y2) and computes the full linear equation in slope-intercept form (y = mx + b). It also calculates the slope, y-intercept, x-intercept, and the straight-line distance between the two points. A live SVG graph updates as you type so you can visualize the line immediately.
How it works
- Enter the x and y coordinates for the first point (x1, y1).
- Enter the x and y coordinates for the second point (x2, y2).
- The slope m is calculated as (y2 - y1) / (x2 - x1).
- The y-intercept b is derived from y = mx + b using one of the points.
- The x-intercept is found by solving 0 = mx + b for x.
- Distance is computed using the Pythagorean theorem: sqrt((x2-x1)^2 + (y2-y1)^2).
Use cases
- Verify homework answers for linear equation problems.
- Find the equation of a trend line through two data points.
- Calculate slope and intercepts for engineering or design problems.
- Visualize how changing coordinates shifts the line on a graph.
- Determine the distance between two locations on a coordinate map.
- Check if three points are collinear by testing the same equation.
Frequently Asked Questions
Last updated: 2026-05-23 · Reviewed by Nham Vu