Slope Calculator Online: Find the Slope of Any Line in Seconds

CodexFuse Team · 2026-11-05T20:35:39.339Z · 10 min read min read

Find the slope of any line between two points in seconds — rise over run, grade percentage and angle, free in your browser.

A slope calculator tells you how steep a line is between two points — nothing more, nothing less. You enter two coordinates, (x1, y1) and (x2, y2), and it returns the slope as rise over run, plus the angle the line makes with the horizontal. No formula to memorise, no arithmetic slip to catch later.

It sounds like a school maths problem, and often it is. But the same calculation quietly decides whether a driveway drains, whether a roof sheds rain, whether a wheelchair ramp is legal, and whether a trend line on a chart actually means anything. The free slope calculator on CodexFuse handles all of it in your browser, with no sign-up and nothing uploaded.

What is a slope calculator?

A slope calculator is a free online tool that finds the gradient of a straight line from two points you enter. It applies the formula m = (y2 − y1) ÷ (x2 − x1), shows the rise and the run separately, and converts the result into an angle in degrees. Vertical lines are flagged as undefined rather than returning a wrong number.

That is the whole job. The value is not in the formula — it is in getting the answer in two seconds, with the working shown, instead of reaching for a calculator and a scrap of paper every time a gradient question comes up.

How to find the slope between two points

The method is the same whether you are doing homework or checking a building gradient. Take the two points, subtract the y-values to get the rise, subtract the x-values to get the run, then divide.

  1. Enter the first point. Type the x and y coordinates of your starting point — for example, (0, 0).
  2. Enter the second point. Type the coordinates of the other end of the line — for example, (4, 2).
  3. Press Calculate. The tool shows the slope, the rise over run, and the angle in degrees in one go.
  4. Check the result against reality. A slope of 0.5 means the line rises 1 unit for every 2 units it runs. If that does not match what you can see, one of the points is wrong.

On the CodexFuse slope calculator you can also try a built-in preset — (0, 0) to (4, 2) is one of them — or copy the result straight to your clipboard when you need to paste it into a report or a message.

PointsRise ÷ RunSlopeAngle
(0, 0) → (4, 2)2 ÷ 40.526.57°
(1, 3) → (5, 3)0 ÷ 400°
(2, 1) → (2, 6)5 ÷ 0Undefined90°
(0, 5) → (10, 0)−5 ÷ 10−0.5−26.57°
Pro Tip

Keep your units consistent. If x is in metres and y is in metres, the slope is a clean ratio. Mix metres with centimetres and the answer is still "correct" — for the wrong question.

What does the slope actually tell you?

A single number carries more meaning than most people expect. Four cases cover nearly everything you will meet.

  • Positive slope — the line climbs. As x increases, y increases. A slope of 2 is steep; a slope of 0.1 is a gentle climb. Most ramps, roofs and trend lines live here.
  • Negative slope — the line falls. As x increases, y decreases. A drainage channel or a falling sales trend both show up as negative slopes.
  • Zero slope — the line is flat. The y-value never changes. A perfectly level floor or a flat stretch of road has a slope of exactly 0.
  • Undefined slope — the line is vertical. Both points share the same x, so the run is zero and division is impossible. This is not an error in the tool; it is the mathematically honest answer, and the calculator says so instead of inventing a number.

Worked example: checking a garden path gradient

Consider a fictional landscaping job. A contractor named Sara is laying a 8-metre garden path and needs water to drain away from the house. The rule she works to: the path must fall at least 2% away from the building, or rainwater pools against the wall.

She measures the height at the house wall (0 metres along the path, 0.40 metres above her datum) and at the far end (8 metres along, 0.00 metres above the datum). Her two points are (0, 0.40) and (8, 0.00).

Into the slope calculator: rise = 0.00 − 0.40 = −0.40, run = 8 − 0 = 8, slope = −0.40 ÷ 8 = −0.05. The angle is about −2.86°. As a percentage grade, that is a 5% fall — comfortably above her 2% minimum, so the path drains. If the answer had come back at −0.01, she would have known before laying a single slab that the path would hold water.

The whole check took under a minute. Done by hand, the same arithmetic is easy to fumble — one misplaced decimal and a path that should fall 5% is built flat. That is the real job of a slope calculator: not the maths, but removing the one careless slip that costs a day of rework.

Still doing gradient maths by hand on every job?

One wrong decimal can mean a path that holds water or a ramp that fails inspection. CodexFuse keeps the tools you reach for — calculators, converters, business email, hosting and security — in one fully managed place on pay-as-you-go credits, so the small jobs stop eating your day.

Get Started with CodexFuse

Slope, percentage grade and angle — the same number, three views

Slope, grade percentage and angle all describe the same steepness. Builders talk in percentages, students in slopes, and engineers in degrees. The calculator shows the slope and the angle; the percentage is the slope multiplied by 100.

SlopeGradeAngleWhat it feels like
0.022%1.15°Barely noticeable — minimum for drainage
0.0838.3%4.76°A 1:12 wheelchair ramp, the common accessibility standard
0.550%26.57°A steep staircase-like climb
1100%45°Rises exactly as fast as it runs

The 1:12 ramp figure matters. Accessibility rules in many countries cap ramp gradients around 1:12, which is a slope of roughly 0.083. If you measure a ramp at 0.12, it is too steep — and a slope calculator is the fastest way to prove it before anyone complains.

Important

A slope of 1 does not mean a 1% grade — it means a 100% grade. This trips up nearly everyone the first time. Percentage grade is slope × 100, so a gentle 0.05 slope is a 5% grade, not a 0.05% one.

Where a slope calculator earns its keep

The tool earns its place in more workflows than the classroom suggests.

  • Students and teachers. Checking homework answers instantly, with the rise and run shown, so a wrong answer becomes a visible mistake instead of a mystery.
  • Builders and roofers. Verifying falls for drainage, roof pitches and ramp gradients before materials are ordered. A roof pitch of 4:12, for instance, is a slope of 0.333.
  • Data analysts. Sanity-checking a trend line: if two points on a chart give a slope that contradicts the story, the chart is probably misread.
  • Hikers and cyclists. Turning elevation profiles into gradient numbers to judge whether a route is a gentle roll or a wall.
  • Small business owners. The same quick-answers habit applies elsewhere — a SIP calculator for monthly investment planning, or a reading time calculator when you are pricing a piece of content by the minute.
Suggested Reading

If you like tools that answer a question in seconds, try the password entropy calculator — it measures how strong a password really is instead of guessing — and the free sitemap validator for checking whether search engines can actually read your site's sitemap.

What a slope calculator cannot do

Honesty matters here. The tool finds the gradient of a straight line between two points, and that is all it does.

  • It cannot handle curves. A curved line has a different slope at every point. For that you need calculus, not two coordinates.
  • It cannot check your measurements. If you typed the wrong height or read the tape measure badly, the answer is precisely wrong. Always sanity-check against what you can see.
  • It does not know the rules. It will happily confirm a ramp is 0.15 — it will not tell you that your local accessibility code caps it at 0.083. The judgement is yours.
  • It is not a survey tool. For anything where a wrong gradient has legal or safety consequences — retaining walls, structural work — a licensed surveyor's numbers are the ones that count.

Used inside those limits, it is one of the most reliable little tools on the internet: a calculation too simple to get wrong, automated so you cannot get it wrong either.

Frequently Asked Questions

What is the formula for the slope of a line?

Slope m = (y2 − y1) ÷ (x2 − x1), also called rise over run. Take the difference in the y-values, divide by the difference in the x-values, and that is your slope. The CodexFuse slope calculator applies exactly this formula to the two points you enter.

What is the slope between (0, 0) and (4, 2)?

The slope is 0.5. Rise = 2 − 0 = 2, run = 4 − 0 = 4, and 2 ÷ 4 = 0.5. The angle is about 26.57°. This is one of the calculator's built-in presets, so you can see the worked answer instantly.

What does it mean when slope is 0 or undefined?

A slope of 0 means a horizontal line — no rise as x changes. An undefined slope means a vertical line, where x1 equals x2 and division by zero is impossible. The calculator detects a vertical line and reports it as undefined instead of returning a wrong number.

How do I convert slope to an angle?

Angle = arctan(slope), converted to degrees. A slope of 1 gives 45°, a slope of 0 gives 0°, and a vertical line gives 90°. The calculator shows the angle next to the slope, so you never need to look up the conversion.

How do I calculate slope as a percentage grade?

Multiply the slope by 100. A slope of 0.05 is a 5% grade, a slope of 0.083 is about an 8.3% grade, and a slope of 1 is a 100% grade. Builders and road engineers usually quote grades this way, so it is the number to use when you are talking to a contractor.

Is this slope calculator free to use?

Yes — it is free and unlimited, with no sign-up. Everything runs in your browser, so nothing you enter is uploaded anywhere. Like the rest of CodexFuse's free tools, it is there to solve the problem in front of you, not to collect your details first.

Stop doing rise-over-run by hand

The next time a gradient question comes up — a homework problem, a drainage fall, a ramp check, a trend line that does not look right — open the free slope calculator, enter the two points, and have the answer in seconds, with the working shown. Then move on to the work that actually needs your judgement.

And if the small, fiddly jobs are what eat your day — the calculators, the email that will not deliver, the hosting that needs babysitting, the security you keep meaning to check — move them to CodexFuse. One fully managed platform, pay-as-you-go credits, no subscriptions. Create your free account today and put the busywork down for good.

Featured on Twelve Tools Hunt for Tools Featured on LaunchBuff Launch Llama Tools Launch your MCP Top Web Development Companies in the US - OnToplist.com Designer Listings Listed on SeeWhatNewAI Featured on SubmitMySaas