Skip to content
Math

Gradient Calculator

Enter two coordinate points, or switch to Rise/Run mode to enter the vertical and horizontal distances directly. The calculator finds the gradient (slope), angle in degrees, percent grade, the "1 in X" ratio used in civil engineering, and the straight-line distance between the two points. Every result updates instantly and the step-by-step panel shows the working with your actual numbers.

Your details

Choose whether to enter two (x, y) coordinate pairs or the raw rise and run values.
Horizontal coordinate of the first point.
Vertical coordinate of the first point.
Horizontal coordinate of the second point.
Vertical coordinate of the second point.
Gradient (slope)Very steep slope
2

Rise divided by run (the slope, m)

Angle63.43°
Percent grade200%
1 in X ratio1 in 0.50
Rise10
Run5
Straight-line distance11.1803
63.43 °
Flat<5Gentle5-15Moderate15-30Steep30-45Very steep45+
-20020-10010
x (run)
y (rise)
x (run)y = mx (slope line)Input segment
-10-201
-9-1811
-8-16
-7-14
-6-12
-5-10
-4-8
-3-6
-2-4
-1-2
00
12
24
36
48
510
612
714
816
918
1020
  • y = mx (slope line)
  • Input segment

Gradient is 2.0000 (positive (uphill left to right)).

  • The slope rises 10.0000 units for every 5.0000 units of horizontal travel.
  • The inclination angle is 63.43 degrees and the grade is 200.00%.
  • An extremely steep gradient - most vehicles cannot climb slopes above 0.58 (30 degree tangent). Staircases are typically around 0.7 to 1.0.

Next stepThe straight-line distance between the two points is 11.1803 units. For road design, most design codes limit gradients to 8 to 12% (0.08 to 0.12) for vehicle safety.

Formula

m=riserun=y2y1x2x1,θ=arctan ⁣(m),grade%=m×100,d=(x2x1)2+(y2y1)2m = \dfrac{\text{rise}}{\text{run}} = \dfrac{y_2 - y_1}{x_2 - x_1}, \quad \theta = \arctan\!\left(|m|\right), \quad \text{grade}\% = m \times 100, \quad d = \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}

Worked example

Points (-2, 1) and (3, 11): rise = 11 - 1 = 10, run = 3 - (-2) = 5, gradient = 10/5 = 2. Angle = arctan(2) = 63.43 degrees. Percent grade = 200%. Distance = sqrt(5^2 + 10^2) = sqrt(125) = 11.18 units.

What is a gradient and how is it calculated?

A gradient (or slope) measures how steeply a line rises or falls. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on a straight line. The formula is m = (y2 - y1) / (x2 - x1). A positive gradient means the line climbs from left to right; a negative gradient means it descends. A gradient of zero describes a perfectly horizontal (flat) line, while a gradient approaching infinity describes a near-vertical line. In coordinate geometry, the gradient is also the coefficient m in the slope-intercept equation y = mx + b.

Percent grade, angle in degrees, and the 1:X ratio

The same slope can be expressed in several ways depending on the context. Percent grade multiplies the gradient by 100 - a 5% grade means the road rises 5 metres for every 100 metres of horizontal travel. The angle in degrees is the inverse tangent of the absolute gradient: angle = arctan(|m|). The civil engineering 1:X notation states how many horizontal units correspond to 1 unit of rise - for example a gradient of 0.25 is written "1 in 4". Each representation is equivalent; this calculator converts between all four simultaneously. Note that percent grade is not the same as "percent of the slope length" - the two diverge at steeper angles, as the reference table below shows.

Practical gradient standards in engineering and everyday life

Gradient limits appear in virtually every area of engineering. Most national road standards cap standard carriageways at 6 to 8% grade (3.4 to 4.6 degrees) to keep vehicles safe and fuel costs reasonable, though mountain roads may reach 12 to 15%. Wheelchair ramps under the ADA must not exceed 1:12 (8.3%, about 4.8 degrees). Conventional railways typically stay below 2 to 3%; rack-and-pinion railways can handle 48%. Roof pitches range from near-flat (1 degree or less) to steep domestic roofs at 45 degrees. Ski runs are classified by gradient: greens below about 25%, blues to about 40%, and blacks beyond that. Recognising common gradient benchmarks quickly tells you whether a slope is buildable, driveable, or safe for a given purpose.

Two-point mode versus rise/run mode

This calculator supports two input methods. In two-point mode, enter the (x, y) coordinates of two points on a line - the calculator derives the rise, run, gradient, and Euclidean distance automatically. This is the natural choice when working with coordinate geometry, plotting lines, or reading values from a graph. In rise/run mode, you enter the vertical and horizontal components directly - the most convenient approach in construction and surveying, where you might measure 1.2 m of height gained over 8 m of ground. Both modes produce identical downstream results: gradient, angle, percent grade, and the 1:X ratio.

Angle to gradient and percent grade reference

AngleGradient (slope)Percent grade1:X ratioTypical use
0.0000.0%flatLevel surface
0.0171.7%1 in 57Drainage slopes, flat roofs
0.0353.5%1 in 29Gentle road grade
0.0878.7%1 in 11.4Maximum common road grade
8.5°0.14914.9%1 in 6.7Steep mountain roads
10°0.17617.6%1 in 5.7Steep ramps, limiting car grade
14°0.24924.9%1 in 4.0Switchback roads
18°0.32532.5%1 in 3.1Steepest railway grades (rack)
26.6°0.50050.0%1 in 2Very steep hiking trails
30°0.57757.7%1 in 1.7Ski slopes (intermediate)
35°0.70070.0%1 in 1.4Black diamond ski runs
45°1.000100.0%1 in 1Equal rise and run, staircase-like
60°1.732173.2%1 in 0.58Near-cliff terrain
90°undefinedverticalPerfectly vertical surface

Common inclination angles with their gradient (slope), percent grade, and civil engineering 1:X ratio. Percent grade is calculated as (rise / run) x 100.

Frequently asked questions

What is the difference between gradient and slope?

Gradient and slope refer to the same quantity: the ratio of rise to run for a straight line. In mathematics and the UK, "gradient" is the standard term; in the US and general engineering, "slope" is more common. Both equal (y2 - y1) / (x2 - x1) and both appear as the coefficient m in y = mx + b.

Can the gradient be negative?

Yes. A negative gradient means the line falls from left to right (downhill in the conventional orientation). The magnitude tells you how steep it is; the sign tells you the direction. Percent grade is usually given as a signed value in road engineering, so -8% means an 8% downhill grade.

What does undefined gradient mean?

A gradient is undefined when the run is zero, meaning the two points share the same x-coordinate and the line is perfectly vertical. Division by zero has no finite answer, so no slope value exists. Vertical lines are described by the equation x = constant rather than y = mx + b.

How do I convert a gradient to an angle in degrees?

Use the inverse tangent (arctan) function: angle = arctan(|m|) x (180 / pi). For example, a gradient of 1 gives arctan(1) = 45 degrees. Most scientific calculators and spreadsheets have an ATAN or DEGREES function for this. This calculator handles the conversion automatically.

What is percent grade and how does it differ from the gradient?

Percent grade is simply the gradient multiplied by 100. A gradient of 0.05 equals a 5% grade. It is the dominant notation in road and rail engineering because it gives a direct sense of rise per 100 units of horizontal distance. The gradient is the decimal form of the same number.

Is a 100% grade the same as 45 degrees?

Yes. A 100% grade means rise equals run, so the angle is arctan(1) = 45 degrees exactly. Many people assume 100% grade = 90 degrees (vertical), but that is incorrect. A 100% grade is a very steep but not vertical slope - equivalent to a typical staircase.

What gradient is the steepest road in the world?

Baldwin Street in Dunedin, New Zealand, has been measured at about a 35% grade (19.3 degrees), equivalent to a gradient of approximately 0.35. Canton Avenue in Pittsburgh, Pennsylvania, is sometimes cited at close to 37%. Most standard vehicles struggle to climb sustained grades above 20 to 25% (11 to 14 degrees).

Sources

Written by Dr. Rajiv Menon, PhD Applied Mathematician · Bengaluru, India

Applied mathematician bridging algebraic theory and computational tools for students, engineers, and everyday problem-solvers.

Search 3,500+ calculators

Loading search…