Skip to main content

Enter values

Type whole numbers, decimals like -1.5, or fractions like -3/4. Choose Undefined slope when the line is vertical, such as x = 4.

Slope is “rise/run”. Example: m = 3/2 means up 3 for every right 2. A flat (horizontal) line has m = 0.

Options:

Chips prefill common line-definition scenarios and run the calculation.

Result:

You changed an input. Click Calculate to update this result.

No results yet. Enter values and click Calculate.

How to use this calculator

  1. Choose what you know.
    Select Point + slope if you know a point and the slope, Two points if you know two points, or Undefined slope for a vertical line like x = 4.
  2. Enter the values.
    Type whole numbers, decimals like -1.5, or fractions like -3/4. The calculator keeps results exact when possible.
  3. Adjust options (optional).
    Choose whether to round decimals, show step-by-step work, or display the mini graph.
  4. Click Calculate.
    Instantly get the line written in point-slope, slope-intercept, and standard form, along with the y-intercept and x-intercept. If you change a number later, click Calculate again to update the result.
  5. Explore the results.
    Follow the step-by-step solution to see how each form and intercept was found, hover over the graph to see the equation, and use the extra tools to check a point or build parallel and perpendicular lines.

Tip: Try the quick-pick examples to see common cases like vertical lines, horizontal lines, or fractional slopes.

How this calculator works

  • Point + slope: plugs into y − y₁ = m(x − x₁).
  • Two points: slope is m = (y₂ − y₁)/(x₂ − x₁), then we use point-slope.
  • Slope-intercept: compute b = y₁ − mx₁ → y = mx + b.
  • Intercepts: the y-intercept is b, and the x-intercept is −b/m (set y = 0).
  • Standard form: rearrange into Ax + By = C with integer coefficients.

Tip: A vertical line has undefined slope and looks like x = 4. A horizontal line has slope 0 and looks like y = 3.

Formula & Equation Used

Point-slope: y − y₁ = m(x − x₁)

Slope from two points: m = (y₂ − y₁)/(x₂ − x₁)

Slope-intercept: b = y₁ − mx₁ and y = mx + b

Y-intercept: b, the point (0, b)

X-intercept: x = −b/m, the point (−b/m, 0)

Standard form: Ax + By = C

Example Problem & Step-by-Step Solution

Example 1 — Two points (1, 2) and (5, −4)

  1. Compute slope: m = (−4 − 2)/(5 − 1) = −6/4 = −3/2
  2. Point-slope (use point (1,2)): y − 2 = (−3/2)(x − 1)
  3. Slope-intercept: b = 2 − (−3/2)·1 = 7/2 → y = (−3/2)x + 7/2
  4. Intercepts: the y-intercept is (0, 7/2). For the x-intercept, set y = 0: 0 = (−3/2)x + 7/2, so x = 7/3, the point (7/3, 0).
  5. Standard form: 3x + 2y = 7

Example 2 — Point + slope (2, −1) with m = 3

  1. Start with point-slope form: y − y₁ = m(x − x₁)
  2. Substitute: y − (−1) = 3(x − 2) → y + 1 = 3(x − 2)
  3. Distribute: y + 1 = 3x − 6
  4. Solve for y: y = 3x − 7, so the y-intercept is (0, −7)
  5. X-intercept (set y = 0): 0 = 3x − 7 → x = 7/3
  6. Standard form: 3x − y = 7

Example 3 — Vertical line through (4, 1) and (4, 7)

  1. Compute slope: m = (y₂ − y₁)/(x₂ − x₁)
  2. Here x₂ − x₁ = 4 − 4 = 0, so the slope is undefined.
  3. A line with undefined slope is vertical.
  4. Equation: x = 4. The x-intercept is (4, 0), and there is no y-intercept because x is never 0.

Example 4 — Horizontal line through (−1, 3) with m = 0

  1. Substitute: y − 3 = 0(x + 1)
  2. Anything times 0 is 0, so y − 3 = 0 → y = 3
  3. The y-intercept is (0, 3). A flat line never crosses the x-axis, so there is no x-intercept.

Frequently Asked Questions

Q: What is point-slope form?

Point-slope form is y − y₁ = m(x − x₁). It writes the equation of a line using the slope m and one point (x₁, y₁) on the line. You can rearrange it into slope-intercept form, y = mx + b, or standard form, Ax + By = C.

Q: How do I find the y-intercept?

The y-intercept is where the line crosses the y-axis, at x = 0. Rearrange to y = mx + b and read b, or compute b = y₁ − mx₁. The calculator shows it as a labelled result and marks it on the graph.

Q: How do I find the x-intercept?

Set y = 0 and solve for x, which gives x = −b/m. A horizontal line (slope 0) never crosses the x-axis unless it is the x-axis itself, and a vertical line x = c crosses it at (c, 0).

Q: Why does my slope show “undefined”?

If x₁ = x₂, the denominator in (y₂ − y₁)/(x₂ − x₁) is zero, so the slope is undefined and the line is vertical.

Q: Why do you “prefer exact fractions”?

Fractions keep answers clean (like −3/2) and avoid rounding errors. You can still show decimals with rounding.

Q: Can I use this calculator to find parallel or perpendicular lines?

Yes. After calculating the original line, you can generate a parallel line (same slope) or a perpendicular line (negative reciprocal slope) through any new point. The calculator outputs the equations and shows them on the mini graph.

Q: What happens if the line is vertical or horizontal?

If a line is vertical, its equation is x = c and the slope is undefined. If a line is horizontal, its equation is y = c and the slope is 0. The calculator automatically detects both cases and displays the correct equation, intercepts, and graph.

Q: Why did my result turn grey?

You changed one of the numbers after calculating, so the result on screen no longer matches the inputs. Click Calculate to update it.

Back to all calculatorsAll calculators