About Contact
Tools
1 Rep Max Calculator — Estimate Your 1RM From Any Set401(k) CalculatorAge Calculator — Your Exact Age in Years, Months & DaysAmortization CalculatorAsphalt CalculatorAsphalt Driveway Cost CalculatorAuto Loan CalculatorBarcode GeneratorBase64 EncoderBd Ft CalculatorBench Press Max Calculator — Estimate Your Bench 1RMBMR Calculator — Estimate Your Basal Metabolic RateBoard Foot CalculatorBrick CalculatorCalorie Deficit Calculator — Daily Target and TimelineCD Calculator (Certificate of Deposit)Cement CalculatorCircle Area Calculator — Area, Radius, Diameter, CircumferenceColor Palette GeneratorCompound Interest CalculatorConcrete Bag CalculatorConcrete Block CalculatorConcrete CalculatorConcrete Calculator with CostConcrete Footing CalculatorConcrete Mix CalculatorConcrete Pad CalculatorConcrete Price CalculatorConcrete Slab CalculatorConcrete Slab Cost CalculatorConcrete Volume CalculatorConcrete Weight CalculatorConcrete Yard CalculatorConduit Fill CalculatorCrushed Stone CalculatorDirt CalculatorDrywall CalculatorDue Date Calculator — Estimate Your Baby's Due DateFantasy Name GeneratorFavicon GeneratorFence CalculatorFill Dirt CalculatorFinal Exam Calculator — What Grade Do I Need on the Final?Fraction Calculator — Add, Subtract, Multiply, DivideFree Citation Generator (APA, MLA, Chicago, Harvard)GPA Calculator — Unweighted and Weighted, with Cumulative GPAGravel CalculatorHEIC to JPG ConverterHELOC CalculatorInsulation CalculatorLandscape Rock CalculatorMacro Calculator — Daily Protein, Carbs, and FatMean Calculator — Average of a List of NumbersMedian Calculator — Middle Value of a List of NumbersMeme GeneratorMetal Roof CalculatorMinute to Decimal ConverterMorse Code ConverterMortgage Payoff CalculatorMulch CalculatorOvulation Calculator — Find Your Fertile WindowPaver Base CalculatorPaver CalculatorPaver Sand CalculatorPea Gravel CalculatorPeptide CalculatorPercentage Calculator — Solve Any Percent QuestionPNG to PDF ConverterPuppy Weight CalculatorPythagorean Theorem Calculator — Solve Any Right TriangleQuadratic Formula Calculator — Roots, Vertex, Factored FormQuikrete Concrete CalculatorRaised Bed Soil CalculatorRandom Name GeneratorRiver Rock CalculatorRock CalculatorRoof Cost CalculatorRoof Pitch CalculatorRoof Shingle CalculatorRoof Slope CalculatorRoof Truss CalculatorRubik's Cube Solver — Solve Any Scrambled 3×3 CubeSakrete Concrete CalculatorSales Tax CalculatorSand CalculatorScrap Silver CalculatorSignature GeneratorSleep Calculator — Best Bedtimes & Wake Times by Sleep CycleSlope Calculator — Slope, Equation, Angle, GradeSnow Day CalculatorSod CalculatorSoil CalculatorSonotube Concrete CalculatorSquare Footage Calculator — Room and Floor AreaSquat Max Calculator — Estimate Your Squat 1RMStandard Deviation Calculator — Sample and PopulationStone CalculatorTDEE Calculator — Total Daily Energy ExpenditureTier List MakerTile CalculatorTime Calculator for WorkTop Soil CalculatorTopsoil CalculatorTriangle Calculator — Solve Any Triangle From 3 InputsUPC GeneratorUsername GeneratorVolume Calculator — 8 Shapes With Unit ConversionWebP to JPG ConverterWebP to PNG ConverterWordle Solver — Best Next Guess for Today's Puzzle
← All tools

Slope Calculator — Slope, Equation, Angle, Grade

Compute slope from two points or rise/run. Get the equation, angle, distance, and percent grade.

Mode
Slope
Equation
Angle
Distance
y-intercept

What is slope calculator?

The slope of a line measures its steepness — how much y changes per unit of x. Algebra students learn it as m = (y₂ - y₁) / (x₂ - x₁); civil engineers and accessibility designers usually express the same quantity as a percent grade or a rise:run ratio. This calculator covers both framings: switch to Two points for the algebra-class question (slope, equation, angle, distance), or to Rise / run for the engineering question (percent grade, angle, simplified ratio).

The two-points mode handles a few edge cases explicitly. A vertical line — where x₁ equals x₂ — has undefined slope; the calculator detects this and switches the line equation to x = c form, which is what a textbook expects. A horizontal line has slope 0 and an equation of the form y = c. Coincident points (identical (x, y)) return a hint asking for two distinct points.

In rise / run mode, the ratio is reduced to lowest terms via GCD when both numbers are integers, so a rise of 4 over a run of 12 displays as 1:3 rather than 4:12. Non-integer inputs fall back to 1:N formatting with N rounded to 4 decimals.

Privacy is simple: every calculation runs locally. The only saved state is your mode preference in localStorage.

When to use a slope calculator

  • Algebra homework — slope between two points — Type the two coordinates and read the slope, y-intercept, full <code>y = mx + b</code> line equation, the angle of inclination, and the Euclidean distance between the points. Vertical lines (x₁ = x₂) are handled explicitly — the slope is reported as undefined and the equation switches to <code>x = c</code> form.
  • Civil engineering — convert rise/run to percent grade — Highway and rail grades are reported as percentages. Switch to Rise / run mode, type the vertical and horizontal distances, and the calculator returns the slope as a decimal, the percent grade, the angle in degrees, and a reduced <code>rise:run</code> ratio. Useful for road grades, drainage runs, and ramp planning.
  • Accessibility — ramp gradient checks — ADA recommends a maximum 1:12 ratio (8.33%) for accessibility ramps. Type the rise (curb height) and run (ramp length); the percent grade tells you whether you're within or over the recommended threshold.

How to use the Slope Calculator — Slope, Equation, Angle, Grade

  1. Pick the modeTwo points if you have coordinates (x₁, y₁) and (x₂, y₂); Rise / run if you have vertical and horizontal distances. Your last choice persists across visits.
  2. Fill all the fields in the active groupTwo points needs all four coordinates. Rise / run needs both rise and run, with run > 0 and rise ≥ 0.
  3. Read the slope in the headlineThe headline shows the slope as a decimal. For vertical lines (two-points mode only), the slope reads as 'undefined (vertical line)'. The stats list contains the equation (or percent grade in rise/run mode), the angle of inclination in degrees, and either the distance between points or the simplified rise:run ratio.
  4. Copy the summaryTap the copy button to put a one-line summary on your clipboard.

Worked examples

(0, 0) → (3, 6)

Input:  Mode Two points; x₁=0, y₁=0, x₂=3, y₂=6
Output: Slope = 2, equation y = 2x, angle ≈ 63.43°, distance ≈ 6.71

Vertical line (2, 0) → (2, 5)

Input:  Mode Two points; x₁=2, y₁=0, x₂=2, y₂=5
Output: Slope = undefined (vertical line), equation x = 2, angle = 90°, distance = 5

When x₁ = x₂, the slope formula divides by zero. The calculator detects this and switches the equation to <code>x = c</code> form.

Rise 1 ft, Run 12 ft (ADA ramp)

Input:  Mode Rise / run; rise = 1, run = 12
Output: Slope ≈ 0.0833, grade ≈ 8.33%, angle ≈ 4.76°, ratio 1:12

The canonical ADA-compliant ramp ratio. 1:12 is the maximum recommended slope for accessibility ramps.

Frequently asked questions

What is the slope formula?
m = (y₂ - y₁) / (x₂ - x₁) — the change in y divided by the change in x between any two points on a line. The same value works regardless of which two points you pick, as long as they lie on the same line.
How do I find the y-intercept once I know the slope?
Plug one point into y = mx + b and solve for b. The calculator does this automatically: b = y₁ - m·x₁. The result appears in the equation line as the constant term and separately in the stats list as the y-intercept.
What happens when the two points are vertical (same x)?
The slope is undefined because the denominator (x₂ - x₁) is zero. A vertical line cannot be written as y = mx + b — it has the form x = c, where c is the shared x-value. The calculator detects this case and reports the slope as undefined with the equation in x = c form. The angle is 90° and the distance is just |y₂ - y₁|.
How do percent grade and slope relate?
Percent grade is the slope expressed as a percentage: grade = slope × 100. A 1:12 ramp (1 unit up for every 12 units across) has slope 1/12 ≈ 0.0833, which is an 8.33% grade. Highway grades, rail grades, and accessibility ramps are usually reported as percent grade because most readers find percentages easier to interpret than decimals.
What does a 1:12 ratio mean?
It means '1 unit of rise per 12 units of run' — a relatively shallow slope. The ADA recommends 1:12 as the maximum for accessibility ramps. The calculator reduces the rise:run ratio to lowest terms using GCD when both values are integers, so rise 4, run 12 displays as 1:3, not 4:12.
How is the angle calculated?
The angle of inclination is arctan(slope), converted to degrees. For slope 1 the angle is 45°; for slope 2 it's ~63.43°. Vertical lines give 90°; horizontal lines give 0°. The calculator uses Math.atan internally and rounds the result to 4 decimals.
Why is run restricted to > 0 in rise/run mode?
Run is a length along the horizontal — by convention it's a positive distance. A 0 run would mean no horizontal travel, which is the vertical-line case from two-points mode. A negative run isn't physically meaningful in the rise/run framing. If you genuinely have a 'backward' run, use two-points mode with x₂ < x₁ to get a negative slope.
Are my numbers stored or sent anywhere?
No. The calculation runs entirely in your browser. The values you type never leave your device. The only saved state is the mode preference (two-points / rise-run) in localStorage so the toggle remembers your last choice.