Slope Calculator
The slope between two points is the change in y divided by the change in x (rise over run), which tells you how steep a line is. Enter two points to get the slope and the line's equation.
Find the slope of a line between two points — with the angle of incline, the distance between the points, Δx, Δy and the full line equation y = mx + b, drawn on a graph. Or use the second calculator to enter one point, a slope and a distance and find the second point.
The slope (also called the gradient) of a line measures how steeply it climbs or falls as you move from one point to another.
m — slope • θ — angle of incline • d — distance
Change the values in either calculator and press Calculate — the result appears below it.
1 2 points known
2 1 point + slope known
How to find the slope of a line
The slope of a straight line — also called its gradient — is a single number that captures how steep the line is and which way it tilts. It answers a simple question: for every one step you take to the right, how far does the line go up or down? That vertical change divided by the horizontal change is the slope, usually written as m. Slope is often expressed as a percentage too — the “grade” of a road or roof — and the percentage calculator converts any ratio to a percent.
The slope formula
m = (y₂ − y₁) ÷ (x₂ − x₁) = Δy ÷ Δx = tanΘ
Δy (the “rise”) is how far the line climbs or drops; Δx (the “run”) is how far it travels sideways. The bigger m is in size, the steeper the line.
The sign of the slope tells you the direction of the line:
- m > 0 — the line rises from left to right (uphill).
- m < 0 — the line falls from left to right (downhill).
- m = 0 — a flat, horizontal line; y never changes.
- Undefined — a vertical line, where x₂ = x₁. You cannot divide by zero, so the slope has no value.
Distance, angle and the equation of the line
Because Δx and Δy meet at a right angle, the two points and the segment between them form a right triangle — and the line is its hypotenuse. So the distance d between the points comes straight from the Pythagorean theorem, and the angle of incline θ (how far the line tilts from horizontal) comes from the slope:
d = √(Δx² + Δy²) • θ = arctan(m) • Line: y = mx + b, with b = y₁ − m·x₁
From the line equation the calculator also reads off the intercepts: the line meets the y-axis at y = b (where x = 0) and the x-axis at x = −b ÷ m (where y = 0).
Worked example
Working backwards: one point, a slope and a distance
The second tab solves the reverse problem. If you know a starting point, the slope (or the angle), and how far to travel along the line, there are always two answers — one on each side of the start. The horizontal step is Δx = d ÷ √(1 + m²) and the vertical step is Δy = m · Δx; add them for one point and subtract them for the other. For example, from (1, 2) with slope 0.75 and distance 5, the two end points are (5, 5) and (−3, −1), both sitting on the line y = 0.75x + 1.25.
Where the slope of a line shows up in real life
Slope is far more than a classroom exercise — it is the “steepness” number behind a lot of everyday design and safety rules, which is why people also reach for a roof slope calculator, a ramp slope calculator or a percent slope calculator:
- Roof slope & pitch — builders quote a roof as a ratio such as 4:12 (rise : run), which is exactly Δy over Δx. Enter the run and rise as two points and this tool returns the pitch as a slope, a percentage and a ratio.
- Wheelchair & car ramps — accessibility guidance caps a ramp’s slope (often 1:12, about 8.3%), so the ramp slope ratio matters. Read it straight off the ratio and percent shown under the result.
- Road & railway grades — the “8% grade” on a steep-hill sign is simply the slope written as a percentage of rise over run.
- Pipe slope & drainage fall — drains, gutters and pipes need a small, deliberate slope (for example 1:40 or 1:100) so water keeps flowing the right way.
In every one of these the maths is identical to what this calculator does: divide the vertical rise by the horizontal run to get one number — then read it as a decimal slope, a percent grade, a ratio, or an angle.
Slope as a percentage, a ratio, and an angle
The same slope can be written several equivalent ways, and this calculator shows all of them so you never have to convert by hand:
- Decimal slope (m) — rise ÷ run, for example 0.75.
- Percent slope (grade) — the decimal × 100, for example 75%. This is the “percent slope” used for roads, ramps and land grading.
- Ratio (rise : run) — for example 3 : 4, or 1 : 12 for a gentle ramp. Builders and plumbers usually work in this form.
- Angle of incline (θ) — arctan(m) in degrees, for example 36.87°.
To convert a slope to a percentage, multiply by 100; to write it as a ratio, use rise : run and simplify; to get the angle, take the inverse tangent. Every result panel lists the decimal, percent, ratio and angle together.
How to use it & key terms
Enter two points for slope, or the a, b and c coefficients for a quadratic, then press Calculate for the result and the steps.
| Term | What it means |
|---|---|
| Slope | The steepness of a line, rise over run (change in y ÷ change in x). |
| Intercept | Where a line crosses the y-axis. |
| Quadratic | An equation of the form ax² + bx + c. |
| Roots / solutions | The x-values where a quadratic equals zero. |
| Discriminant | b² − 4ac; its sign shows how many real roots there are. |
| Vertex | The turning point (highest or lowest) of a parabola. |
Sources & methodology
Slope is computed as (y₂ − y₁) ÷ (x₂ − x₁); a zero denominator is reported as a vertical, undefined-slope line. Distance uses the Pythagorean theorem d = √(Δx² + Δy²), the angle of incline uses θ = arctan(m), and the line uses slope-intercept form y = mx + b with b = y₁ − m·x₁. The reverse mode steps Δx = d ÷ √(1 + m²) in both directions.
Sources: Standard coordinate-geometry formulas — the slope (gradient) formula, the distance formula (Pythagorean theorem), the relationship m = tanθ, and the slope-intercept form of a straight line.
Reading a slope: sign, steepness, parallel and perpendicular
A slope is more than a single number; its sign and size together tell you the whole shape of a line at a glance. The sign gives the direction. A positive slope rises as you move from left to right, a negative slope falls, and a slope of zero is perfectly flat — a horizontal line that never climbs. The one case with no number at all is a vertical line: because the run between its points is zero, the formula would divide by zero, so its slope is undefined rather than infinite. Getting the sign right is often all you need to know whether a quantity is growing or shrinking, before you worry about how fast.
The size of the slope measures steepness — how much the line climbs for each step across. A slope of 2 rises twice as steeply as a slope of 1; anything between 0 and 1 is a gentle grade, while values above 1 climb sharply and large numbers approach the near-vertical. This is exactly why a wheelchair ramp or a mountain road spreads a small rise over a long run: keeping the slope low, well under 1, is what makes it gentle enough to use. Reading the magnitude lets you compare two lines instantly — the one with the larger absolute value is the steeper, whether it is rising or falling — without plotting a single point, which is handy when you only have the two coordinates.
Slopes also reveal how two lines relate. Two lines are parallel exactly when their slopes are equal — they climb at the same rate and never meet. They are perpendicular, crossing at a right angle, when one slope is the negative reciprocal of the other, so that the two multiplied together give −1; a line of slope 2 meets one of slope −0.5 at ninety degrees. The same idea gives a quick straightness test for three points: they lie on one line only if the slope between the first pair matches the slope between the second. Compute the slope between each pair of points above and compare the results, and you can judge direction, steepness and these relationships without ever drawing the graph.
- Positive, negative or zero — the line rises, falls, or runs flat.
- Larger absolute value — the steeper the climb or descent.
- Equal slopes are parallel; negative reciprocals are perpendicular.
Frequently asked questions
How do I find the slope between two points?
Divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (5, 5), m = 3 / 4 = 0.75. A larger absolute value means a steeper line.
What is the angle of incline of a line?
It is the angle the line makes with the horizontal x-axis. Slope and angle are linked by m = tanθ, so θ = arctan(m). A slope of 3/4 gives about 36.87°.
How do I find the distance between two points?
Use the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²). For (1, 2) and (5, 5), d = √(16 + 9) = √25 = 5.
What is the equation of a line, y = mx + b?
Once you have the slope m, the y-intercept is b = y₁ − m·x₁, and the line is y = mx + b. It crosses the y-axis at y = b and the x-axis at x = −b ÷ m.
Can a slope be zero, negative or undefined?
Yes. A horizontal line has slope 0. A line falling left-to-right has a negative slope. A vertical line has an undefined slope, because x₂ − x₁ = 0 and dividing by zero is not allowed.
How do I find a second point from one point, a slope and a distance?
There are two answers, one on each side. Step Δx = d ÷ √(1 + m²) and Δy = m·Δx, then add or subtract them from your point. The calculator returns both possible second points.
What does “rise over run” mean?
Rise is the vertical change (Δy) and run is the horizontal change (Δx). Slope is rise divided by run — how many units the line climbs or falls for every one unit it moves to the right.
Are slope and gradient the same thing?
Yes — two names for the same quantity. “Slope” is more common in the US; “gradient” is often used in the UK and in science and engineering.
How do I calculate roof slope or roof pitch?
Roof pitch is rise over run written as a ratio like 4:12 (4 units of rise for every 12 of run). Enter the run and rise as two points — for example (0, 0) and (12, 4) — and the calculator gives the slope (0.3333), the percent (33.33%), the ratio and the angle (about 18.43°).
How do I find a ramp slope such as 1:12?
A 1:12 ramp rises 1 unit for every 12 units of length, a slope of 1÷12 ≈ 0.0833, or about 8.33%. Enter the run and rise as two points such as (0, 0) and (12, 1), then read the ratio and percent below the result to check a wheelchair or car ramp against its limit.
What is percent slope, and how do I convert a slope to a percentage?
Percent slope (or grade) is the decimal slope multiplied by 100. A slope of 0.75 is a 75% grade; a slope of 0.08 is an 8% grade. The calculator shows the percent automatically in the “more about this line” panel.
How do I calculate pipe slope or drainage fall?
Pipe slope is the fall (vertical drop) divided by the length of the run, often written as a ratio like 1:40 or 1:100. Enter the run and the fall as two points and the calculator returns the slope, percent and ratio so you can compare it with the required minimum.
What is the point-slope form of a line?
Point-slope form is y − y₁ = m(x − x₁). It builds the line straight from one point and the slope, without first finding the y-intercept. The calculator prints the point-slope form next to the usual y = mx + b (slope-intercept) form.
How do I calculate gutter slope for drainage?
Gutters need a slight fall so water runs to the downspout — commonly about 1/4 inch per 10 feet, roughly a 1:480 slope (about 0.2%). Enter the horizontal run and the vertical fall as two points and the calculator returns the slope, percent and ratio to check against the recommended minimum.
What is a roof slope factor (roof pitch multiplier)?
The roof slope factor (pitch multiplier) converts a roof's flat footprint area into its actual sloped area. It equals √(rise² + run²) ÷ run — the same as 1 ÷ cos(angle). For a 4:12 pitch the factor is about 1.054, so a roof covering 1,000 sq ft of ground is about 1,054 sq ft of surface. Enter the run and rise as two points for the angle, then divide 1 by its cosine.
What slope should a patio or driveway have for drainage?
To drain water off a patio, deck, driveway or pavement, a common minimum is about 1/4 inch of fall per foot — roughly a 2% slope (a 1:50 ratio); some codes allow down to 1% on hard, smooth surfaces. Enter the run (length) and the fall (drop) as two points and the calculator shows the percent and ratio to check against the minimum.
Can this calculator find the slope of a curve?
No — this tool finds the slope of a straight line between two points. A curve has no single slope; its steepness changes from point to point, and finding it needs calculus (the derivative gives the slope of the tangent line at a chosen point). For straight lines and segments, though, the answer here is exact.