Skip to main content
Pearson+ LogoPearson+ Logo
All Calculators & ConvertersAll calculators

Enter values

You can type decimals or fractions like -3/4. We’ll keep results exact when possible.

Slope is “rise/run”. Example: m = 3/2 means up 3 for every right 2.

Options:

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, or Two points if you know two points on the line.
  2. Enter the values.
    Type numbers as decimals or fractions (for example -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.
  5. Explore the results.
    Review the steps, hover over the graph to see the equation, and confirm whether the line is slanted, horizontal, or vertical.

Tip: Try the quick-pick examples to see common cases like vertical 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.
  • Standard form: rearrange into Ax + By = C with integer coefficients.

Tip: A vertical line has undefined slope and looks like x = 4.

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

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/2y = (−3/2)x + 7/2
  4. 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
  5. 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

Frequently Asked Questions

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 and graph.