Slope & Grade Calculator

Calculate slope angle, percent grade and rise/run ratio from height change and horizontal distance in the same unit. Copy or save uphill and downhill results as TXT or JSON.

How to use

  1. Enter the height change and a positive horizontal run in the same unit.
  2. Calculate and review the angle, grade and rise/run ratio.
  3. Check the uphill/downhill sign and units before using the result.

Calculation inputs

Enter height change and horizontal run in the same unit. Plain numbers, at most 64 characters and 12 fractional digits each, magnitude up to 10^18. Signs and decimals allowed. No exponents, commas, spaces or unit text. Write decimals as 0.5.

Angle: approximate to 6 decimal places. Grade and ratio: rounded to 12 decimal places. TXT/JSON: 4,000 bytes each. Inputs and results are neither stored nor sent.

Results

Try a use case and check the result

Read angle, grade percentage and rise/run ratio separately from a height change and horizontal distance.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

Use a rise of 1 and a horizontal run of 2

Input and settings

Rise: 1 / Horizontal run: 2 (same unit)

Expected result

Angle: 26.565051° / Grade: 50% / Ratio: 0.5

Use a negative rise for a downward slope

Input and settings

Rise: -1 / Horizontal run: 2 (same unit)

Expected result

Angle: -26.565051° / Grade: -50% / Ratio: -0.5

How to read the result

Grade is rise÷horizontal run×100. A 50% grade is not a 50° angle. Angle is approximated using arctangent. The sign of rise distinguishes uphill and downhill; horizontal run must remain positive.

Scope and limits

Enter horizontal run, not the length along the slope. Each value allows 64 characters, 12 fractional digits and magnitude 10¹⁸. Non-positive run, exponents, commas and outer spaces are rejected. Ratio and grade use integer/rational arithmetic rounded to 12 decimal places; angle uses a floating-point approximation rounded to six. This does not assess dimensional safety or compliance with design standards.

Verification: existing calculate checks cover signed rises, 50% versus approximately 26.565051°, and rejection of zero run. Browser checks cover running examples, restoring input history and cancelling Workers.

Continue with the next task

Details and limits

Divide height change by horizontal run to get the rise/run ratio. Multiply by 100 for percent grade. The angle uses the inverse tangent and is shown in degrees. Enter the horizontal distance, rather than the length along the slope.

The example rise 10 and run 100 gives ratio 0.1, grade 10% and angle approximately 5.710593 degrees. Rise 1 and run 1 gives 100% grade and a 45-degree angle. Percent grade and angle are different quantities.

Height change follows your direction of travel. Positive means uphill; negative means downhill. Rise -10 and run 100 gives -10% grade and approximately -5.710593 degrees. Zero rise gives zero grade and angle.

Horizontal run must be greater than zero. A vertical line with zero run is not supported. Use the same unit, such as meters or centimeters, for both inputs. Units are not automatically converted.

Grade and ratio are computed as exact integer fractions, then rounded to 12 decimal places, with halfway values rounded away from zero. Trailing zeros are removed. The angle is a floating-point approximation shown to 6 decimal places. Very small values can round to zero; very steep slopes can round to a 90-degree angle.

TXT contains normalized inputs, approximate angle, grade and ratio. JSON also records precision and methods. Numeric values remain strings and the complete result is copied/saved. Files are UTF-8 without a BOM or added trailing newline.

Editing either input cancels work and clears the previous result. Cancel keeps inputs. Reset clears inputs and results.

Frequently asked questions

What angle is a 100% grade?

A 100% grade means equal rise and horizontal run, giving a 45-degree angle. Percent grade and degrees are different values.

Can I use downhill or decimal height changes?

Yes. Use a negative rise for downhill and up to 12 fractional digits. Horizontal run must always be greater than zero.

Are the displayed values completely exact?

The angle is approximate to 6 decimal places. Grade and ratio are integer-derived fractions rounded to 12 decimal places; very small values can round to zero.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16