Enter two points to get the slope and the full equation of the line — slope-intercept, point-slope and standard forms — plus intercepts, midpoint, distance and angle, with a graph.
Slope (m)
2
Angle
63.43°
Calculator
Slope-intercept form
y = 2x + 3
Through (0, 3) and (2, 7).
Slope
2
y-intercept
3
x-intercept
-1.5
Point-slope
y − 3 = 2(x − 0)
Standard form
2x − y = -3
Midpoint
(1, 5)
Distance
4.4721
Graph
How the line equation is found
The slope is the rise over the run: m = (y₂ − y₁) / (x₂ − x₁). With the slope and one point you get the slope-intercept form y = mx + b, where b = y₁ − m·x₁ is the y-intercept. The same line can be written in point-slope form y − y₁ = m(x − x₁) and in standard form Ax + By = C.
The x-intercept is where y = 0, i.e. x = −b/m. The midpoint averages the two coordinates, the distance is √((x₂ − x₁)² + (y₂ − y₁)²), and the angle of inclination is arctan(m). A vertical line (x₁ = x₂) has no slope and the equation x = constant; a horizontal line has slope 0.
What if the two points are vertical?
When the x-coordinates are equal the line is vertical, the slope is undefined, and the equation is simply x = constant. There is no y-intercept and the angle of inclination is 90°.
How is the standard form normalized?
The standard form Ax + By = C is written with A ≥ 0 (and B ≥ 0 when A = 0) and, when the coefficients are integers, divided by their greatest common divisor so the form is unique.
What does the angle mean?
It is the angle the line makes with the positive x-axis, measured anticlockwise in [0°, 180°). A positive slope gives an acute angle, a negative slope an obtuse one.
Results are estimates. Verify with a professional for important decisions.
About this calculator
This calculator finds every property of the line through two points you enter: slope, y-intercept, x-intercept, slope-intercept form (y = mx + b), point-slope form, standard form (Ax + By = C), the midpoint, the distance between the points, and the angle of inclination. An interactive graph shows the line and both points at a glance.
How to read your results
Enter the coordinates of your two points and the results update instantly. The headline result card shows the slope-intercept equation. Below it, a detail panel lists the point-slope form, standard form, midpoint, and distance. A small graph renders the line and highlights the two input points. The slope and angle of inclination also appear in the stat strip at the top of the page.
Worked example
Enter point 1 as (1, 3) and point 2 as (4, 9).
The calculator returns slope 2, y-intercept 1, x-intercept −0.5, equation y = 2x + 1, standard form 2x − y = −1, midpoint (2.5, 6), distance approximately 6.708, and angle of inclination about 63.43°.
Frequently asked questions
What does the slope tell me?
The slope (m) measures how steeply the line rises or falls. A slope of 2 means the line goes up 2 units for every 1 unit it moves to the right. A negative slope means the line falls from left to right, and a slope of zero means the line is horizontal. A vertical line has no defined slope.
What is the difference between the three equation forms?
Slope-intercept form (y = mx + b) is the most convenient for reading off the slope and y-intercept directly. Point-slope form (y − y₁ = m(x − x₁)) is useful when you know one point and the slope. Standard form (Ax + By = C) keeps all variables on one side and is common in systems of equations. All three represent the same line.
How are the midpoint and distance calculated?
The midpoint is the average of the two x-coordinates and the average of the two y-coordinates: ((x₁ + x₂)/2, (y₁ + y₂)/2). The distance is the length of the straight segment between the two points, found with the Pythagorean theorem: √((x₂ − x₁)² + (y₂ − y₁)²).
How it's calculated
The slope is m = (y₂ − y₁) / (x₂ − x₁). The y-intercept follows from b = y₁ − m·x₁ and the x-intercept from −b/m. Standard form coefficients are derived from (y₂ − y₁)x − (x₂ − x₁)y = (y₂ − y₁)x₁ − (x₂ − x₁)y₁, then reduced by the GCD of the integer coefficients and normalized so A ≥ 0. The angle of inclination is arctan(m) in degrees, shifted to [0°, 180°) for negative slopes. Formulas follow Wolfram MathWorld: Slope-Intercept Form and Slope.
Spot a translation issue, a calculation issue, or have a suggestion? Let us know.