331+ free tools. No sign-up. No hidden fees. Explore the toolkit

Slope Calculator

The slope of a line measures its steepness: how much y rises or falls for each step in x. Two points are all it takes to pin a line down — from them you can find the slope, the y-intercept, the line's equation, the distance between the points and the angle the line makes with the x-axis.

Enter two points below to get the slope, both forms of the line equation, the distance between the points, the midpoint and the angle of the line.

Slope

Save to Pinterest
Vertical lines have no slope: when both points share the same x value, the run is 0 and dividing by zero is undefined. The equation of a vertical line is simply x = a constant — this calculator shows that instead of a slope.

How It Works

Slope is rise over run: m = (y₂ − y₁) / (x₂ − x₁). A positive slope means the line rises as x increases; a negative slope means it falls; a slope of 0 means the line is horizontal. A slope of 2 means y climbs 2 units for every 1 unit of x; a slope of 1/2 means it climbs 1 unit for every 2 units of x. To see the line drawn, with its slope and intercepts marked, use the graphing calculator.

Once you have the slope, the line's equation follows. The slope-intercept form is y = mx + b, where b — the y-intercept — is the value of y where the line crosses the y-axis (x = 0). It is found from either point: b = y₁ − m·x₁. The point-slope form, y − y₁ = m(x − x₁), is the same line written around the first point, and it is often the handiest form when you only know a point and a slope.

The distance between the points comes from the Pythagorean theorem: distance = √((x₂ − x₁)² + (y₂ − y₁)²). The angle the line makes with the positive x-axis is arctan(m) — for a slope of 2, that is about 63.43°. The midpoint is the average of the two points: ((x₁ + x₂) / 2, (y₁ + y₂) / 2). If the two points are identical, there is no line at all, and the calculator says so.

Worked Example

Take the points (1, 2) and (5, 10). The rise is 10 − 2 = 8 and the run is 5 − 1 = 4, so the slope is m = 8 / 4 = 2. The y-intercept is b = y₁ − m·x₁ = 2 − 2 × 1 = 0, so the slope-intercept form is simply y = 2x. The point-slope form around the first point is y − 2 = 2(x − 1).

The distance between the points is √(4² + 8²) = √80 ≈ 8.9443, the midpoint is (3, 6), and the angle is arctan(2) ≈ 63.4349°. For a vertical example, the points (3, 1) and (3, 7) share x = 3, so the slope is undefined, the equation is x = 3, the distance is 6 and the angle is 90°.

Assumptions

Sources: No external data is used on this page — every figure is calculated from the numbers you enter. Last reviewed: 21 November 2026.

Built and tested by SumKitTool — see how we check our numbers.

How to Use This Calculator

Enter the coordinates of the two points — x₁ and y₁ for the first, x₂ and y₂ for the second — and the results update live. The headline shows the slope; the table gives the y-intercept, both equation forms, the distance, the angle and the midpoint. Try (3, 1) and (3, 7) to see how a vertical line is handled, or (0, 4) and (5, 4) for a horizontal line with slope 0.

Tips and Practical Advice

Slope in the Real World: Ramps, Grades and Rates of Change

Slope is more than a geometry exercise — it is how the world measures steepness and change. A slope is a rate: how much one quantity changes for each unit of another. Take the points (2, 50) and (6, 170) as a distance–time graph, where x is hours and y is miles. The slope is (170 − 50)/(6 − 2) = 120/4 = 30, which means 30 miles per hour — the speed of the journey. The calculator also gives the distance between the points, 120.0666, and the angle, 88.0908°, but notice that the angle is only meaningful when x and y use the same units: on a graph where one axis is hours and the other is miles, the “angle” is an artefact of the scale, not a physical slope.

Where x and y are both lengths, slope becomes steepness, and it is often written as a percentage grade: multiply the slope by 100. A slope of 0.05 is a 5% grade — the ground rises 5 units for every 100 units of horizontal distance. Road signs use this convention: a 10% grade means a slope of 0.1, which feels steep in a car and is very steep on a bicycle. Roofers use a related convention, pitch: a 6/12 pitch rises 6 inches for every 12 inches of run, a slope of 0.5 and an angle of 26.5651°, while a 12/12 pitch is a slope of 1, exactly 45°.

Wheelchair ramps show why small slopes matter. In the US, the ADA Standards set the maximum slope of a ramp run at 1:12 — one unit of rise for every 12 units of run. That is a slope of 1/12 ≈ 0.0833, an 8.33% grade, and an angle of 4.7636°. Try the points (0, 0) and (12, 1) above to see it: a ramp rising 1 metre needs 12 metres of run. A slope that looks gentle on paper is still hard work in a wheelchair, which is why the limit exists — and why ramps also need level landings at the top and bottom, and handrails where the rise is more than 6 inches.

A few habits keep slope problems honest. First, keep the point order consistent — (y₂ − y₁)/(x₂ − x₁) — or the sign flips. Second, remember that slope has no units of its own when both axes share a unit, but it inherits a rate (miles per hour, pounds per week) when they do not. Third, check the sign against the story: a falling line has a negative slope, so a negative answer for a distance that is clearly growing means the points were entered the wrong way round. Finally, test your equation against both points — substituting either point into y = mx + b should return the other coordinate exactly.

Frequently Asked Questions

What is slope?

Slope measures how steep a line is: how much y changes for each unit x changes. It is calculated as (y₂ − y₁) / (x₂ − x₁), often remembered as “rise over run”. A positive slope rises left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has an undefined slope.

What is the y-intercept?

The y-intercept is the value of y where the line crosses the y-axis — that is, where x = 0. In the slope-intercept form y = mx + b, the intercept is b. For the points (1, 2) and (5, 10), the line is y = 2x, so the y-intercept is 0.

Why is the slope of a vertical line undefined?

Because both points share the same x value, the run (x₂ − x₁) is 0, and dividing by zero is undefined. A vertical line has no slope-intercept form — its equation is simply x = a constant, such as x = 3. This calculator shows the equation and the distance instead of a slope.

How is the angle of a line calculated?

The angle is the angle between the line and the positive x-axis, found with the inverse tangent of the slope: angle = arctan(m). A slope of 2 gives an angle of about 63.43°, a slope of 0 gives 0°, and a vertical line gives 90°.

What slope is a wheelchair ramp allowed to have?

In the US, the ADA Standards set the maximum slope of a ramp run at 1:12 — one unit of rise for every 12 units of run. That is a slope of about 0.0833, an 8.33% grade and an angle of about 4.76°. A ramp rising 1 metre needs at least 12 metres of run, plus level landings at the top and bottom.

How can I tell if two lines are parallel or perpendicular from their slopes?

Parallel lines have exactly the same slope. Perpendicular lines have slopes that are negative reciprocals of each other — their product is −1. If one line has slope 2, a line perpendicular to it has slope −1/2, and 2 × (−1/2) = −1. A horizontal line (slope 0) is perpendicular to a vertical line (undefined slope).

Last updated: