Slope Calculator

In short: for the points (2, 3) and (6, 11) the slope is 2, the distance is 8.9443 and the line is y = 2x − 1. Enter any two points and every standard fact about their line appears at once.

What this calculator works out

Give it two points on a straight line and this calculator returns everything that line is usually described by: the slope, the distance between the points, the midpoint, the angle of incline in degrees, the full equation in slope-intercept form (y = mx + b), the x- and y-intercepts, and the slopes of lines parallel and perpendicular to yours. Those seven answers are the standard toolkit of coordinate geometry, the branch of mathematics set out by René Descartes in the 1630s that ties algebra to pictures. Students meet the ideas in school, but the same numbers show up in roof pitches, road gradients, ramps, drainage falls and trend lines through business data, where "slope" is how fast one thing changes when another changes.

The formulas are short. Slope is rise over run: m = (y2 − y1) / (x2 − x1). Distance comes from the Pythagorean theorem applied to the same rise and run: √((x2 − x1)² + (y2 − y1)²). The midpoint is the average of the two x-values and of the two y-values. The angle of incline is arctan(m), in degrees. Once the slope is known, the y-intercept follows by rearranging y = mx + b around either point, and the x-intercept is where y = 0, namely x = −b / m. Answers update the moment you change any coordinate.

Worked examples

Points (2, 3) and (6, 11): the rise is 11 − 3 = 8 and the run is 6 − 2 = 4, so the slope is 8 / 4 = 2. The distance is √(4² + 8²) = √80 = 8.9443. The midpoint is ((2 + 6) / 2, (3 + 11) / 2) = (4, 7). The angle is arctan(2) = 63.43°. Using the first point, b = 3 − 2×2 = −1, so the equation is y = 2x − 1, the y-intercept is −1 and the x-intercept is 0.5. A parallel line also has slope 2; a perpendicular line has slope −0.5.

A falling line, points (0, 10) and (5, 0): the rise is −10 over a run of 5, giving slope −2 and the equation y = −2x + 10. Negative slope always means the line falls as you move right — here, something draining away at a steady rate, emptying at x = 5, exactly the x-intercept.

A flat line, points (1, 4) and (9, 4): the rise is 0, so the slope is 0, the distance is 8, and the equation is y = 4. There is no x-intercept: a horizontal line at height 4 never crosses the x-axis.

Special cases: vertical and horizontal lines

Two cases break the usual template, and both are handled as answers rather than errors. If the two x-values are equal, the line is vertical: the run is zero, division by zero is undefined, and there is no slope and no y = mx + b form. Its equation is x = that shared value, its angle is 90°, and it has no y-intercept (unless it is the y-axis itself). If the two y-values are equal, the line is horizontal: slope 0, angle 0°, equation y = that shared value, and no x-intercept unless the line is the x-axis. Enter the same point twice and there is no line at all — infinitely many lines pass through one point — so the calculator asks for two different points.

Reading a slope table

Slope00.512−1
Angle of incline0°26.57°45°63.43°−45°
MeaningFlatGentle riseRises 1 per 1Rises 2 per 1Falls 1 per 1

The table shows why the angle is not just the slope in different clothing: doubling the slope from 1 to 2 adds about 18 degrees, not 45, because the arctangent compresses large slopes towards the 90-degree ceiling. Positive slopes climb to the right, negative slopes descend, and the size of the number, not its sign, tells you how steep the line is: a slope of −3 is steeper than a slope of 2.

Rules and notes

Order does not matter: swapping the two points changes the sign of both the rise and the run, which cancels in the slope, and distance and midpoint are identical either way. Units carry through the slope — if x is in hours and y in kilometres, the slope is in kilometres per hour, which is why slope is the natural language of rates. Keep the axes straight: slope is always change in y divided by change in x, never the other way round; the reciprocal error is the most common mistake in hand calculations. Finally, a slope describes a straight line only. Curved data has a slope that changes from point to point, and a two-point slope then describes only the average rate between those points.

Frequently asked questions

What is slope?

Slope is how steep a straight line is: the vertical change between two points divided by the horizontal change, written m = (y2 − y1) / (x2 − x1). A slope of 2 means the line rises 2 units for every 1 unit it runs to the right. Slope is a rate — the same idea as speed (distance per hour) or a price per kilogram — expressed for a line on a graph.

What does a slope of zero mean?

A slope of zero means the line is perfectly horizontal: y does not change at all as x increases, so the rise is 0 and 0 divided by any run is 0. The equation of such a line is simply y = the constant y-value, for example y = 4. On a graph it is a flat line, and in real terms it describes something that does not change, such as a fixed price however many units you buy.

Why is the slope of a vertical line undefined?

A vertical line has the same x-value at every point, so the run (x2 − x1) is 0, and dividing by zero has no defined answer in mathematics. The line is infinitely steep rather than steep by any finite amount. Its equation is x = the constant x-value, for example x = 3, and it has no y-intercept unless it is the y-axis itself. This calculator reports that case plainly instead of showing an error.

What are parallel and perpendicular slopes?

Parallel lines have exactly the same slope, which is why they never meet: they rise at the same rate forever. Perpendicular lines have slopes that are negative reciprocals of each other — flip the fraction and change the sign. If one line has slope 2, a perpendicular line has slope −1/2, and the two meet at a right angle. If a line is horizontal (slope 0), its perpendicular is vertical, and vice versa.

What is the difference between slope and the angle of incline?

Slope is a ratio; the angle of incline is that same steepness expressed in degrees, found with the arctangent: angle = arctan(slope). A slope of 1 gives 45 degrees, a slope of 2 gives about 63.43 degrees, and as slope grows without bound the angle approaches 90 degrees, the vertical. Surveyors and engineers often quote the angle, while algebra works with the ratio, so this page gives both.

Related tools

Formulas and worked examples last verified: 24 November 2026. Everything is calculated in your browser — nothing you type is sent anywhere.