Slope and Line Equation Calculator
Find the slope, y-intercept and equation of a straight line from two coordinate points, with explicit handling of vertical lines.
YOUR SHORTCUTS
Continue where you left off
Recently used
Your favorites
These shortcuts remember only calculator names on this device, not the values you enter.
Slope and Line Equation Calculator
View complete schedule
ⓘ Calculated locally in your browser. Results depend on the values and units you enter.
Interactive mathematical graph
The axes, points and dimensions are recalculated from the values you enter.
Enter valid values to draw this graph.
Interpretation:
Graph data (accessible table)
| Reference | X | Y |
|---|
What changes if one input changes?
7: 1.66666666666667 · 8: 2 · 9: 2.33333333333333
This combination has no safe comparable results. Check the inputs above or select another value.
How this calculator works
The slope between (x₁,y₁) and (x₂,y₂) is (y₂−y₁)/(x₂−x₁). Find the y-intercept by b=y₁−mx₁, then write y=mx+b. If the X coordinates are equal, the line is vertical, so its slope and y-intercept are not defined; the calculator reports the condition instead of dividing by zero. Two identical points cannot determine a unique line. Results use decimal arithmetic, but some fractional slopes are approximations.
Formula and reasoning
m = (y₂ − y₁) / (x₂ − x₁)
- 1. Start with the measurementsFirst point X1Second point X4First point Y2Second point Y8
- 2. Substitute into the formula
First point X = 1 ? Second point X = 4 ? First point Y = 2 ? Second point Y = 8
- 3. Check the computed answer
Result for the sample inputs
Worked example
Frequently asked questions
Can I enter negative coordinates?
Yes. Positive and negative coordinates are supported.
What if the two X values match?
That is a vertical line. Its slope is undefined and the calculator explains why.
Results are informational and assume the stated inputs and formulas. Double-check critical financial or engineering decisions with a qualified professional.
Was this calculator helpful?
Your feedback helps you keep track of useful tools on this device.
Your selection stays in this browser. No public vote count is shown.
Prefer EverydayCalc on Google
Opens Google source preferences. Availability and placement are determined by Google; this does not guarantee higher rankings.