Linear Equation Calculator

Linear Equation Calculator

Emerging AI Skill PRO

Enter Calculation

Formula

y=Slope (m)·X+Y-Intercept (b)y = {{\text{Slope }(m)}} \cdot \text{X} + {{\text{Y-Intercept }(b)}}

Example

y=2·4+3=11y = 2 \cdot 4 + 3 = 11
Usage stats

Advertisement

Results

For x = 4, y = 11
Equation y = 2.0x + 3.0
Slope (m) 2
Y-Intercept (b) 3
X Value 4
Y Value 11
X-Intercept -1.5

Report an error on this page

What This Calculator Does

The Linear Equation Calculator solves the slope-intercept form of a straight line, \(y = mx + b\). You supply three numbers — the slope (m), the y-intercept (b), and an x value — and the tool instantly returns the matching y-coordinate. It also computes the line's x-intercept (where the line crosses the x-axis) and echoes back the full equation so you can confirm the line you are working with.

The Inputs You Enter

  • Slope (m): how steep the line is — the change in y for each one-unit change in x. Positive slopes rise; negative slopes fall.
  • Y-Intercept (b): the y value where the line crosses the y-axis (the point where x = 0).
  • X Value: the x-coordinate you want to plug in to find its matching y.

The Formula Explained

The calculator applies the core equation:

$$y = mx + b$$

It multiplies your slope by your x value, then adds the y-intercept. Behind the scenes it also finds the x-intercept using \(x = -b / m\), which is the x value that makes y equal to zero.

Advertisement
Line graph of y equals mx plus b showing slope m, intercept b, and point x,y
The line \(y = mx + b\): b is where it crosses the y-axis and m is its steepness.

Worked Example

Suppose the slope m = 2, the y-intercept b = 3, and you want y when x = 5.

  • $$y = (2 \times 5) + 3 = 10 + 3 = \mathbf{13}$$
  • $$x\text{-intercept} = -3 / 2 = \mathbf{-1.5}$$
  • Equation displayed: \(y = 2x + 3\)

So the point (5, 13) lies on the line, and the line crosses the x-axis at (−1.5, 0).

How Different Slopes and Intercepts Change the Line

The table evaluates five lines of the form \(y = mx + b\) at the same input, \(x = 4\). The x-intercept is found by setting \(y = 0\), which gives \(x = -b/m\) when \(m \neq 0\).

m b x Equation y x-intercept Line behavior
2 3 4 \(y = 2x + 3\) 11 \(-1.5\) Rising
-2 3 4 \(y = -2x + 3\) -5 1.5 Falling
0 3 4 \(y = 3\) 3 Undefined (the line never crosses the x-axis) Horizontal
0.5 -1 4 \(y = 0.5x - 1\) 1 2 Rising (gently)
1 0 4 \(y = x\) 4 0 Rising, passes through the origin

Substitution check for the first row: \(y = 2 \cdot 4 + 3 = 8 + 3 = 11\). For the second row: \(y = -2 \cdot 4 + 3 = -8 + 3 = -5\).

Takeaways: the slope controls steepness and direction, while the intercept shifts the whole line up or down without changing its tilt. Lines with the same \(m\) but different \(b\) are parallel.

Interpreting Your Result

  • y is the height of the line at x. The output means the point \((x, y)\) lies on the line you defined.
  • Sign of the slope. A positive \(m\) means the line rises from left to right, a negative \(m\) means it falls, and \(m = 0\) gives a horizontal line where y is always equal to \(b\).
  • The intercept b is the starting value. It is the value of y when \(x = 0\), where the line crosses the y-axis.
  • The x-intercept is the root. It is the x-value where \(y = 0\), found as \(x = -b/m\) (for \(m \neq 0\)). If \(m = 0\) and \(b \neq 0\), there is no root.
  • If b = 0, the line passes through the origin \((0, 0)\), and y is directly proportional to x.
  • Vertical lines are excluded. A vertical line such as \(x = c\) has an undefined slope and cannot be written as \(y = mx + b\), because one x-value would correspond to many y-values.

Real-world reading: think of \(m\) as a rate of change and \(b\) as a starting amount. For example, if a taxi charges a $3 base fee plus $2 per kilometre, then the cost is \(y = 2x + 3\), where \(m = 2\) is the price per kilometre and \(b = 3\) is the fixed fee. A 4 km trip costs \(2 \cdot 4 + 3 = 11\), which is $11. A linear model only makes sense where the real situation actually changes at a constant rate.

Advertisement

Key Terms: Slope, Intercept and Slope-Intercept Form

  • Slope (m): the steepness and direction of a line, defined as rise over run, \(m = \frac{\Delta y}{\Delta x} = \frac{y_2 - y_1}{x_2 - x_1}\). It is the same between any two points on a line.
  • Y-intercept (b): the y-value where the line crosses the y-axis, i.e. the value of y when \(x = 0\). It is the point \((0, b)\).
  • X-intercept: the x-value where the line crosses the x-axis, i.e. where \(y = 0\). It is the point \((-b/m, 0)\) when \(m \neq 0\).
  • Slope-intercept form: the way of writing a line as \(y = mx + b\), which shows the slope and y-intercept directly.
  • Linear equation: an equation whose graph is a straight line; in two variables, the variables appear only to the first power.
  • Coordinate / ordered pair: a pair \((x, y)\) that locates a point on the plane, with the x-value (horizontal position) first and the y-value (vertical position) second.
  • Root / zero of a function: an input value where the function's output is 0. For a line, it is the x-intercept, \(x = -b/m\).

Frequently Asked Questions

What happens if the slope is zero? With m = 0 the line is horizontal, so y always equals b regardless of x. The x-intercept becomes undefined (you cannot divide by zero), since a horizontal line off the axis never crosses it.

Can I use negative or decimal values? Yes. The calculator accepts negative numbers and decimals for all three inputs, so values like m = −0.75 or b = 2.5 work fine.

What is the difference between the y value and the x-intercept? The y value is the height of the line at your chosen x. The x-intercept is the specific x where the line touches the x-axis (where y = 0). The tool reports both so you understand the full position of the line.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators