Skip to content
LoveToCalc

Definition — what does that mean?

Equation of a straight line

Every straight line that is not vertical can be written y = mx + c. Two numbers fix the whole line.

In Swedish: Räta linjens ekvation

Equation of a straight line

The relation

y=mx+c

Every straight line that is not vertical is y = mx + c: m is how steep it is, c is where it crosses the y-axis.

Solve for

y=7

y equals (2 times 3) plus 1, equals 6 plus 1, equals 7

Working3 steps

Practice questions

You are given

  • y=65
  • m=7
  • x=8

What m and c mean

m is the slope. It says how much y changes when x increases by 1. If m = 3 the line climbs three steps for every step to the right; if m = −0.5 it drops half a step. Written f(x) = mx + c, the line is the graph of a linear function.

c is the y-intercept. It is the value of y when x = 0 — where the line crosses the vertical axis.

m The line
m > 0 Rises to the right
m = 0 Horizontal
m < 0 Falls to the right

Two lines with the same m are parallel, or the same line if c is also equal. c only decides where on the page the line sits, not which way it leans.

Finding m from two points

The slope is the change in y divided by the change in x:

m = (y₂ − y₁) / (x₂ − x₁)

Example. The line passes through (2, 5) and (6, 13).

m = (13 − 5) / (6 − 2) = 8 / 4 = 2

Then substitute one of the points to get c: 5 = 2 · 2 + c gives c = 1. The line is y = 2x + 1.

The card above does the same thing: choose c as the unknown, enter m, x and y, and the working is shown a step at a time.

Where it turns up outside a textbook

A straight line is any situation where something increases by the same amount per step:

A straight line means the same amount per step, not the same percentage per step.

Common mistakes

Common questions

Why m and c, and not k and m? Conventions differ by country. Swedish textbooks write the same line y = kx + m, where k is the slope and m the intercept, so the letter m means something different there from what it means here. This page uses m and c, as English books do; the Swedish version uses k and m.

What happens when x = 0? Then y = c. That is the definition of the intercept: the height of the line where it crosses the y-axis. A single point, however, says nothing about the slope, whether x is zero or not: lines of every slope pass through one point. It takes a second one.

How do I tell whether a point lies on the line? Substitute the point’s x into the equation and compare with its y. If they agree the point is on the line. Is (4, 9) on y = 2x + 1? 2 · 4 + 1 = 9. Yes.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
my−cx7−132
xy−cm7−123
cy−mx7−2·31
ymx+c2·3+17

Last reviewed October 6, 2026 ·How pages are reviewed

Ready-made worksheets with this formula

Sheets that ask this formula, with their answer keys. Open one to see the questions or print it.

High school

  • Equation of a straight line

    Eight questions on the equation of a line, asking for x, y or the intercept, and eight on the slope between two points, sometimes asking for a coordinate.

Straight linesAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.