📏Linear Equation Calculator

Find the equation of a line from two points or a point and slope

How to Use the Linear Equation Calculator

The Linear Equation Calculator finds the equation of a line, in y=mx+b form, from either two points or a point and a slope. Given two points (x1,y1) and (x2,y2), it calculates the slope m=(y2-y1)/(x2-x1) and then the y-intercept b. Given a point and a slope, it applies the point-slope formula directly. This is useful for graphing problems and for checking linear trend lines in data analysis.

Choose the input type and enter the relevant values, and the line's equation and slope update instantly. If the two points are completely identical, the tool explains that a line cannot be defined. If only the x-coordinates match, the result is treated as a vertical line (x = constant) with an undefined slope, and the output reflects that.

Frequently Asked Questions

What happens if both points have the same x-coordinate?

If the two points share the same x-coordinate, the slope is undefined and the line is vertical (x = constant). In that case, the calculator shows the result as "x = value".

What formula is used to find the slope?

Given two points (x1,y1) and (x2,y2), the slope is m = (y2-y1)/(x2-x1).

Can I find the equation from just a point and a slope?

Yes, given a point (x1,y1) and slope m, the point-slope formula y = m(x-x1) + y1 can be rearranged into y = mx + b form.