My Calculator

Line Equation Calculator

Find the equation of a line from two points, or from a point and a slope — in point-slope, slope-intercept, and standard form, with a plotted diagram and step-by-step solution.

Enter two points on the line — the calculator finds its slope and full equation.

Slope (m)1.5
y-intercept (b)0.5
Point-Slope Formy - 2 = 1.5(x - 1)
Slope-Intercept Formy = 1.5x + 0.5
Standard Form1.5x - y = -0.5

Line Diagram

The line plotted from your input, with its slope triangle and y-intercept (when visible) labeled directly on the graph.

0(0, 0.5)(1, 2)(5, 8)runrisey = 1.5x + 0.5
The lineRunRisey-intercept

Step-by-Step Solution

Here's exactly how this answer was calculated, one step at a time.

  1. 1

    Identify the two points

    (x₁, y₁) = (1, 2), (x₂, y₂) = (5, 8)

    Label the first point's coordinates x₁, y₁ and the second point's coordinates x₂, y₂.

  2. 2

    Find the slope

    m = (y₂ − y₁) / (x₂ − x₁) = (8 − 2) / (5 − 1) = 1.5

    The slope tells you how steep the line is between the two points.

  3. 3

    Write the point-slope form

    y - 2 = 1.5(x - 1)

    The point-slope form y − y₁ = m(x − x₁) is built directly from the slope and one known point.

  4. 4

    Simplify to slope-intercept form

    y = 1.5x + 0.5

    Distribute and solve for y: b = y₁ − m·x₁ = 2 − (1.5)(1) = 0.5.

  5. 5

    Rearrange into standard form

    1.5x - y = -0.5

    Standard form (Ax + By = C) is found by moving all terms to one side of the equation.

Final Answer: y = 1.5x + 0.5 (Standard form: 1.5x - y = -0.5)

Free Online Line Equation Calculator

This line equation calculator finds the full equation of a straight line — in point-slope, slope-intercept, and standard form — from either two points on the line or a single point plus its slope. Enter your values, and the calculator instantly returns every common form of the equation, along with a plotted diagram and a complete step-by-step solution.

Whether you're a student solving linear equations for algebra class, a teacher preparing worked examples, or anyone who needs to quickly convert between point-slope, slope-intercept, and standard form, this line equation solver handles the entire derivation for you — including the special case of a vertical line.

Forms of a Line's Equation

A straight line can be written several different but equivalent ways, and this calculator produces all of them:

  • Point-slope form: y − y₁ = m(x − x₁), built directly from a known point and the slope
  • Slope-intercept form: y = mx + b, where m is the slope and b is the y-intercept
  • Standard form: Ax + By = C, with all terms rearranged onto one side of the equation
  • Slope formula (when using two points): m = (y₂ − y₁) / (x₂ − x₁)
  • Special case — vertical line: x = x₁, which has an undefined slope and no y-intercept

How to Use This Line Equation Calculator

Using the calculator takes just a few steps. First, choose whether you know two points on the line, or a single point plus its slope, using the 'Given information' dropdown. Second, enter the required coordinates (and slope, if applicable). Third, read the results: the calculator instantly displays the slope, y-intercept, and the line's equation in point-slope, slope-intercept, and standard form, along with a plotted diagram.

The diagram draws the actual line through your points, extended a little in both directions so its direction is clear, and marks the run and rise legs that determine the slope. If the y-intercept falls within the visible area of the graph, it's marked in green so you can see exactly where the line crosses the y-axis.

Worked Example

Suppose you know two points: (1, 2) and (5, 8). First find the slope: m = (8 − 2) / (5 − 1) = 6 / 4 = 1.5. Using point-slope form with (1, 2) gives y − 2 = 1.5(x − 1). Distributing and solving for y gives the slope-intercept form: y = 1.5x + 0.5. Rearranging into standard form gives 1.5x − y = −0.5.

If instead you're given a single point and a slope — say the point (2, 3) and slope m = −2 — the same point-slope process applies: y − 3 = −2(x − 2), which simplifies to y = −2x + 7 in slope-intercept form and −2x − y = −7 in standard form.

Point-Slope vs. Slope-Intercept vs. Standard Form

Each form of a line's equation is useful in different situations. Point-slope form is the easiest to write down immediately once you know one point and the slope, making it the natural starting point for a derivation. Slope-intercept form (y = mx + b) is the most common form for graphing by hand, since the slope and y-intercept can be read directly from the equation. Standard form (Ax + By = C) is often preferred in systems of equations and certain algebraic manipulations, since both variables appear on the same side.

Where Line Equations Are Used

Finding the equation of a line is a foundational skill with wide-ranging applications:

  • Students and teachers use it throughout algebra, coordinate geometry, and pre-calculus, especially for graphing and systems of linear equations.
  • Economists use linear equations to model relationships like supply and demand, or cost versus quantity produced.
  • Physicists and engineers use line equations to describe constant rates of change, such as velocity or a linear trend in experimental data.
  • Data analysts use linear regression, which is built on the same slope-intercept form, to model and predict trends in data.
  • Computer graphics and game development use line equations for tasks like collision detection and pathfinding along straight edges.

Frequently Asked Questions

What is point-slope form?

Point-slope form is y − y₁ = m(x − x₁), where m is the slope and (x₁, y₁) is any known point on the line. It's the most direct form to write once you know a point and the slope.

How do I convert point-slope form to slope-intercept form?

Distribute the slope on the right side and solve for y: starting from y − y₁ = m(x − x₁), expand to y = mx − m·x₁ + y₁, which simplifies to y = mx + b where b = y₁ − m·x₁.

What is standard form of a line's equation?

Standard form is Ax + By = C, with both x and y terms on one side. It can be derived from slope-intercept form y = mx + b by rearranging to mx − y = −b, giving A = m, B = −1, and C = −b.

How do I find the equation of a vertical line?

A vertical line has an undefined slope and its equation is simply x = a constant, such as x = 3. Every point on a vertical line shares the same x-coordinate, so no y term appears in its equation.

Can I find a line's equation from just one point?

You need either two points, or one point plus the slope, to uniquely define a line. A single point alone isn't enough, since infinitely many lines can pass through any one point.