↗ Linear Equation from Two Points

Find the slope and y-intercept of a line passing through two 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 Equation

Find the slope and y-intercept from two points.

🧮 Formula

Where

  • (x1,y1) = first point
  • (x2,y2) = second point
  • m = slope
  • b = y-intercept
m = (y2 - y1)/(x2 - x1), then 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 the y-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

💡 Important

  • The two x-values must be different.
  • A vertical line has undefined slope and is not handled by this formula.

❓ Frequently asked questions

What is the line form?

The result corresponds to y = mx + b.