Equation of a Line Calculator
Find the equation of a line given two points.
This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.
Can't find what you need?
Request a ToolHow to Use the Equation of a Line Calculator
This tool finds the equation of the line passing through two given points.
- Enter Point 1. Provide x1 and y1 coordinates.
- Enter Point 2. Provide x2 and y2 coordinates.
- View the equation. The slope-intercept form (y = mx + b) and individual values appear instantly. Vertical lines are detected automatically.
About the Equation of a Line
Given two points, the slope is m = (y2 - y1) / (x2 - x1). The y-intercept is b = y1 - m * x1. Together these give the slope-intercept form y = mx + b. When x1 equals x2, the line is vertical and the equation is x = x1. Finding line equations is a core skill in algebra and analytic geometry, used in curve fitting, trend analysis, and coordinate geometry problems.
Frequently Asked Questions
What if the two points have the same x-coordinate?
When both points share the same x-coordinate, the line is vertical. Its equation is x = (that x value), and the slope is undefined.
What is slope-intercept form?
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).
Can I use two identical points?
No. Two identical points do not define a unique line. You need two distinct points to determine a line.