━ Line Equation From Two Points

Find the slope and y-intercept of the line through two non-vertical points.

No ratings yet — be the first
Rate it: ★ ★ ★ ★ ★

Enter details

Fill in the details and click Calculate to see your results.


Also available in our Android app, with charts and full breakdown tables.

📘 About the Line From 2 Points

Find y = mx + b from two points.

🧮 Formula

Line form
y = mx + b

Where

  • m = slope
  • b = y-intercept
m = (y2-y1)/(x2-x1), b = y1-mx1.

✏️ Worked example

Points (1,3) and (4,9)

You enter
X11
Y13
X24
Y29
You get
Slope m2
Y-Intercept b1

The slope is 2 and intercept is 1.

Try this example →

🧭 How to use this calculator

What you enter

  • X1
  • Y1
  • X2
  • Y2

What you get

  • Slope m
  • Y-Intercept b

💡 Common uses

  • Coordinate geometry homework and revision
  • Analytic geometry calculations
  • Checking graph and line calculations

❓ Frequently asked questions

Can this represent a vertical line?

No. A vertical line has undefined slope and should be represented as x = constant.