Line Equation from Two Points Calculator

Find the equation of a line through two points. Get slope-intercept, point-slope, and standard forms plus slope, intercepts, distance, midpoint, and angle.

Slope-Intercept Form
y = 3.0000x − 1.0000
y = mx + b
Point-Slope Form
y − 2.0000 = 3.0000(x − 1.0000)
y − y₁ = m(x − x₁) using point (1, 2)
Standard Form
3x − 1y = 1
Ax + By = C with integer coefficients
Slope (m)
3.0000
Δy/Δx = (8−2)/(3−1)
y-intercept (b)
-1.0000
The y value where the line crosses the y-axis (x = 0)
x-intercept
0.3333
The x value where the line crosses the x-axis (y = 0)
Distance Between Points
6.3246
√((3−1)² + (8−2)²)
Midpoint
(2.0000, 5.0000)
((x₁+x₂)/2, (y₁+y₂)/2)
Angle with x-axis
71.57°
atan2(Δy, Δx) converted to degrees

Line Properties

Distance
6.32
|Slope|
3.00
|y-int|
1.00
|Angle|
71.57

Equation Forms Reference

FormGeneralThis Line
Slope-Intercepty = mx + by = 3.0000x − 1.0000
Point-Slopey − y₁ = m(x − x₁)y − 2.0000 = 3.0000(x − 1.0000)
StandardAx + By = C3x − 1y = 1
Parametric(x,y) = P₁ + t·(P₂−P₁)(x, y) = (1.0000, 2.0000) + t(2.0000, 6.0000)

Sample Points on the Line

xyNote
-2.0000-7.0000
-1.0000-4.0000
0.0000-1.0000y-intercept
1.00002.0000Point 1
2.00005.0000
3.00008.0000Point 2
4.000011.0000
5.000014.0000
6.000017.0000
Planning notes, formulas, and examples

About the Line Equation from Two Points Calculator

Finding the equation of a line passing through two points is one of the most fundamental tasks in coordinate geometry and algebra. Given two points (x₁, y₁) and (x₂, y₂), this calculator computes the line equation in three standard forms — slope-intercept (y = mx + b), point-slope (y − y₁ = m(x − x₁)), and general standard form (Ax + By = C) — along with a parametric representation.

Beyond the equation itself, the calculator derives the slope, both intercepts (x and y), the distance between the two points, their midpoint, and the angle the line makes with the positive x-axis. These properties are essential for graphing, analysing linear relationships, and solving coordinate-geometry problems that appear in courses from pre-algebra through calculus and analytic geometry.

Whether you are checking coordinate-geometry homework, preparing worked examples, or validating a line before using it in another calculation, the page keeps the slope, intercepts, midpoint, distance, and angle together. The sample-points table lets you verify the equation at integer x-values, while the equation-forms reference shows how the same line looks in each common algebraic form.

When This Page Helps

Writing a line from two points is simple in principle, but sign mistakes and fraction errors are common once you convert the result between forms. This calculator keeps slope-intercept, point-slope, and standard form side by side so you can see whether each rearrangement is still describing the same line.

It is also useful when the equation is only part of the job. Midpoint, distance, intercepts, and angle are all derived from the same two coordinates, so it is more practical to check them together than to work them out on separate pages.

How to Use the Inputs

  1. Enter x₁ and y₁ in the input fields.
  2. Select the mode, method, or precision options that match your line equation from two points problem.
  3. Read Slope-Intercept Form first, then use Point-Slope Form to confirm your setup is correct.
  4. Try a preset such as "(0,0)→(1,1)" to test a known case quickly.
Formula used
Slope m = (y₂ − y₁)/(x₂ − x₁). Slope-intercept: y = mx + b where b = y₁ − mx₁. Standard form: Ax + By = C derived from the slope equation with integer coefficients.

Example Calculation

Result: Slope-Intercept Form shown by the calculator

Using the preset "(0,0)→(1,1)", the calculator evaluates the line equation from two points setup, applies the selected algebra rules, and reports Slope-Intercept Form with supporting checks so you can verify each transformation.

Tips & Best Practices

  • If both points have the same x-coordinate, the line is vertical (x = constant) and the slope is undefined.
  • If both points have the same y-coordinate, the line is horizontal (y = constant) and the slope is 0.
  • The standard form Ax + By = C is normalized so A ≥ 0 and the coefficients are integers with no common factor.
  • Swap the two points and you get the same line — the equation is independent of point order.
  • For a perpendicular line through a point, use the negative reciprocal of the slope.

How This Line Equation from Two Points Calculator Works

The calculator starts by finding the slope m = (y₂ − y₁)/(x₂ − x₁). It then substitutes one of the points into y = mx + b to solve for the intercept, rewrites the result in point-slope form, and normalizes the equation into standard form. From the same two coordinates it also derives the midpoint, distance, intercepts, and angle.

Interpreting Results

Start with the slope and one equation form you recognize, then compare the others. If the slope is positive, negative, zero, or undefined, the intercepts and angle should match that behavior. The midpoint and distance are useful checks that your input points were entered correctly.

Study Strategy

Try swapping the two points and confirm that the line equation does not change. Then use a horizontal example and a vertical example to see how the calculator handles slope 0 and undefined slope as special cases.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • First calculate the slope m = (y₂ − y₁)/(x₂ − x₁), then substitute one point into y = mx + b to solve for b. The result is the slope-intercept form y = mx + b.