Find slope, line equation, distance, midpoint and angle from any two points — with full working and a coordinate-plane graph.
Results update live as you type.
Slope (m)
Y-intercept
0
where x = 0
Distance
6.708
between the points
Midpoint
(2.5, 5)
halfway point
Angle
63.43°
from x-axis
| Slope | Type | Direction |
|---|---|---|
| m > 0 | Positive | Rises left to right |
| m < 0 | Negative | Falls left to right |
| m = 0 | Zero | Horizontal line |
| m = ∞ | Undefined | Vertical line |
The Method
The slope of a line through two points (x₁, y₁) and (x₂, y₂) is the
ratio of rise (vertical change) to run (horizontal change):
m = (y₂ − y₁) / (x₂ − x₁). Once you have m and a known
point, the y-intercept b follows from y = mx + b,
giving three equivalent line equations: slope-intercept,
point-slope, and standard form. The distance
between the points and the midpoint are computed from the Pythagorean
theorem and the coordinate average.
Working for (1, 2) and (4, 8)
About This Tool
A slope calculator finds the steepness and direction of a line through two points (x₁, y₁) and (x₂, y₂). Enter coordinates and the calculator returns the slope m, the y-intercept b, the equation of the line in three equivalent forms (slope-intercept, point-slope, and standard form), the distance between the points, the midpoint, and the angle the line makes with the x-axis.
Slope is one of the most useful ideas in mathematics — it is the foundation of linear equations, linear regression, rates of change in physics (velocity, acceleration), gradients in calculus, and structural slopes in engineering (roads, roofs, ramps). A slope of 2 means "for every 1 unit moved right, the line rises 2 units". A negative slope means the line falls; a slope of zero means a horizontal line.
The calculator uses the classic formulas: m = (y₂ − y₁) / (x₂ − x₁) for slope, d = √((x₂ − x₁)² + (y₂ − y₁)²) for distance, and ((x₁ + x₂)/2, (y₁ + y₂)/2) for the midpoint. The coordinate-plane graph plots the two points and the line through them so you can visualise the result immediately.
Use this free slope calculator for algebra homework, exam revision, plotting linear functions, finding rates of change, or checking work on linear-regression problems. Every calculation runs locally — no sign-up, no tracking.
Slope (m)
Exact rise-over-run calculation, including vertical and horizontal edge cases.
3 Line Equations
Slope-intercept, point-slope, and standard form — all rendered at once.
Distance & Midpoint
Pythagorean distance and the coordinate midpoint between the two points.
Live Graph
A live coordinate-plane chart plots the points and the line through them.
100% Free & Private
No account, no tracking — every calculation runs locally in your browser.
Parallel & Perpendicular
Inspect parallel slope (m) and perpendicular slope (−1/m) instantly.
Four inputs give you a full linear analysis in seconds.
Type the x₁ and y₁ coordinates of your first point. Decimals and negative numbers are allowed.
Type the x₂ and y₂ coordinates. The line is uniquely determined by these two points.
The headline shows m — positive means the line rises, negative means it falls, zero means horizontal, and undefined means vertical.
The formula card shows the line in slope-intercept (y = mx + b), point-slope, and standard form (Ax + By = C).
The coordinate-plane chart plots both points and the line through them — useful for sanity-checking the answer at a glance.
The stat tiles show distance (Pythagorean), midpoint, y-intercept, and angle θ with the x-axis — all computed in real time.
Everything you need to know about slope, line equations, and how to interpret your result.
The slope of a line, denoted m, measures its steepness and direction. It is the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line: m = (y₂ − y₁) / (x₂ − x₁). A slope of 2 means the line rises 2 units for every 1 unit moved to the right.
A negative slope means the line falls from left to right — as x increases, y decreases. For example, m = −3 means that for every 1 unit moved right, the line drops 3 units. Negative slopes describe things like the cooling of a hot object, a depreciating asset, or downhill terrain.
Slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept (the y-coordinate where the line crosses the y-axis, i.e. where x = 0). It is the most common way to write a linear equation and is easiest to graph: start at (0, b) and move "rise over run" using the slope.
Subtract the y-coordinates and divide by the difference of the x-coordinates: m = (y₂ − y₁) / (x₂ − x₁). The order of subtraction does not matter as long as you subtract in the same order in both the numerator and denominator. If x₁ = x₂, the line is vertical and the slope is undefined (division by zero).
Two non-vertical lines are perpendicular if and only if their slopes are negative reciprocals: m₁ × m₂ = −1. So a line with slope 2 has perpendicular slope −1/2. A vertical line (undefined slope) is perpendicular to any horizontal line (slope 0).
Two distinct lines are parallel if and only if they have the same slope (and different y-intercepts). Parallel lines never intersect — they maintain the same direction across the entire plane. Two vertical lines are also parallel (both have undefined slope).
The distance between (x₁, y₁) and (x₂, y₂) is the hypotenuse of the right triangle whose legs are the horizontal and vertical differences. Using the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²). For our default points (1, 2) and (4, 8): d = √(9 + 36) = √45 ≈ 6.708.
The midpoint of the segment from (x₁, y₁) to (x₂, y₂) is the average of the coordinates: ((x₁ + x₂) / 2, (y₁ + y₂) / 2). The midpoint is equidistant from both endpoints and lies on the segment exactly halfway between them.
The angle θ a line makes with the positive x-axis is θ = arctan(m). A slope of 1 gives 45°, slope of √3 gives 60°, slope of 0 gives 0° (horizontal), and an undefined slope corresponds to 90° (vertical). The calculator shows the absolute angle (between 0° and 90°) so it is intuitive regardless of sign.
If both points share the same x-coordinate, the line is vertical and the slope is undefined (you would be dividing by zero). The equation of the line is simply x = x₁. The distance reduces to the absolute difference in y, and the midpoint averages the y values.
Slope is everywhere: physics (velocity is the slope of position-vs-time), economics (marginal cost is the slope of total cost), statistics (the regression line has a slope coefficient), civil engineering (road and roof grades), and cartography (terrain steepness). It is one of the most universally useful mathematical concepts.
Standard form is Ax + By = C, where A, B, and C are constants (and A is typically non-negative). It is useful for systems of linear equations and for finding intercepts: x-intercept = C/A, y-intercept = C/B. The slope from standard form is m = −A/B.