StatGardenREF. DESK
Calculators/Maths/Equation of a line
Maths

Equation of a line calculator

Slope-intercept, point-slope and standard form of the line through two points.

What this calculator does

Equation of a line works out slope-intercept, point-slope and standard form of the line through two points. Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.

The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.

The formula

Formulam = (y₂−y₁)/(x₂−x₁); y − y₁ = m(x − x₁); y = mx + b

The inputs explained

FieldWhat to enter
x₁A number. Starts at 1.
y₁A number. Starts at 2.
x₂A number. Starts at 4.
y₂A number. Starts at 11.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How the answer changes with x₁

Every other input is held at the calculator’s starting values while x₁ varies. Select any row to load that scenario into the calculator.

How the answer changes with x₁
x₁Slope-intercept formPoint-slope formStandard form (Ax + By = C)
0.5y = 2.571x + 0.7143y − 2.000 = 2.571(x − 0.5000)2.571x − y = -0.7143
0.75y = 2.769x − 0.0769y − 2.000 = 2.769(x − 0.7500)2.769x − y = 0.0769
1y = 3.000x − 1.000y − 2.000 = 3.000(x − 1.000)3.000x − y = 1.000
1.5y = 3.600x − 3.400y − 2.000 = 3.600(x − 1.500)3.600x − y = 3.400
2y = 4.500x − 7.000y − 2.000 = 4.500(x − 2.000)4.500x − y = 7.000
3y = 9.000x − 25.000y − 2.000 = 9.000(x − 3.000)9.000x − y = 25.000