Skip to main content

Slope Calculator — Slope, Angle, Distance & Line Equation From Two Points

Two points in, full line out — slope, angle, distance, midpoint, y = mx + b and grade % — browser-only

  • Runs locally
  • Category Calculator
  • Best for Getting a realistic range before a purchase, plan, workout, or schedule decision.
Enter two points (x1, y1) and (x2, y2). The tool computes slope m = (y2 - y1) / (x2 - x1), the inclination angle, distance, midpoint, y-intercept, the line equation y = mx + b, and the grade percentage. A vertical line (x2 = x1) has an undefined slope — shown as such, never Infinity or NaN.
Point 1
Point 2
Slope (m)
3
Angle
71.57°
Distance
9.4868
Midpoint
(2.5, 6.5)
y-intercept (b)
-1
Grade
300%
Line equation
y = 3x - 1

What this tool does

Free slope calculator that turns two points (x1, y1) and (x2, y2) into a complete picture of the line through them. It reports the slope m = (y2 - y1) / (x2 - x1), the inclination angle in degrees from atan2(Δy, Δx), the straight-line distance hypot(Δx, Δy), the midpoint, the y-intercept, the fully formatted line equation y = mx + b, and the civil- engineering grade percentage (m × 100). Vertical lines are handled honestly: when x2 = x1 the run is zero, so the slope is shown as "undefined (vertical line)" instead of a misleading Infinity or NaN. Every result is rounded to a readable precision and there is one button to copy all of them at once. Built for students checking homework on slope, point- slope and slope-intercept form, and for engineers reading a road or roof grade off two survey points. Everything runs in your browser and the share link rebuilds your exact two points. 100% client-side, nothing uploaded.

Tool details

Input
Numbers
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy + Preview
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 12 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Calculator · Student
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How Slope Calculator fits into your work

Use it for fast estimates, comparisons, and planning numbers before you make the final call.

Calculation jobs

  • Getting a realistic range before a purchase, plan, workout, or schedule decision.
  • Comparing scenarios by changing one input at a time.
  • Turning rough assumptions into a number you can discuss.

Calculation checks

  • Double-check units, dates, rates, and rounding assumptions.
  • Treat health, finance, tax, and legal outputs as planning aids, not professional advice.
  • Save the inputs that produced an important result so you can reproduce it later.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 Unit Converter Convert between length, weight, temperature, area, volume, speed, time — instant, browser-only Open
  2. 2 Percentage Calculator 5 common percentage calculations — "x% of y", "x is what% of y", percentage change, increase/decrease — instant, browser-only Open
  3. 3 Triangle Calculator Triangle solver — SSS, SAS, ASA, AAS, and the ambiguous SSA case via law of sines + law of cosines. All sides, angles, area, perimeter, type, drawn to scale. Open

Real-world use cases

  • Check a slope homework answer in seconds

    Your worksheet asks for the slope of the line through (-2, 3) and (4, -9). Type both points, read m = -2, and confirm the angle, the equation y = -2x - 1, and the distance all at once. Instead of re-deriving rise over run by hand and second-guessing a sign, you see every related quantity and can check that your written work matches before you turn it in.

  • Read a road or driveway grade from two survey points

    A surveyor hands you two elevation points along a centerline. Enter horizontal station as x and elevation as y, and the grade percentage drops out directly — a 6% grade flags a stretch that may be too steep for the design standard. The same numbers give you the slope and the inclination angle, so you can sanity-check the cross-section without opening a CAD package.

  • Find the equation of a line for a graph

    You are plotting a trend or drawing a linear function and need its equation. Drop in two points the line passes through and the tool returns y = mx + b with the intercept already computed, handling the ugly cases (b = 0, m = 1, m = -1) so the equation reads cleanly. Paste it straight into your notes, a report, or a graphing tool.

  • Size a ramp or roof pitch to a slope limit

    A ramp must stay under an 8.33% grade and a roof needs a target pitch. Enter the run as x and the rise as y, read the grade percent and the angle, and adjust the rise until both land inside spec. The midpoint and distance also tell you the ramp's true sloped length, not just its horizontal footprint.

Common pitfalls

  • Swapping the order of subtraction inconsistently. The slope is (y2 - y1) / (x2 - x1); if you do y2 - y1 on top but x1 - x2 on the bottom you flip the sign. Always subtract the two coordinates in the same order. The tool fixes the order for you, but on paper this is the number one slope error.

  • Calling a vertical line's slope "infinity" or zero. When x2 = x1 the slope is undefined, not infinite and definitely not 0 (that is a horizontal line). Writing 0 swaps vertical and horizontal completely. The tool prints "undefined (vertical line)" and gives the x = c equation instead.

  • Confusing grade percentage with the angle in degrees. A 100% grade is a 45 degree angle, not 90, because grade is rise over horizontal run while the angle is measured off the horizontal. Reading a "10% grade" as "10 degrees" overstates steep slopes and understates shallow ones.

Privacy

Every number here — slope, angle, distance, midpoint, the equation and the grade — is computed by plain JavaScript inside your browser tab. The two points you enter never leave the page and nothing is logged. The one caveat: the shareable URL encodes your points in the query string, so a link pasted into chat records those coordinates in the recipient server's access log. If the points are sensitive, copy the text output instead of sharing the URL.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-06-14