Free Gradient Calculator
Calculate gradient (slope), percent grade, and angle in degrees. Choose whether you want to work from two points or directly from rise and run.
Tip: Use the same unit for vertical and horizontal measurements (meters/meters, feet/feet, etc.).
What Is Gradient?
Gradient describes how steep a line is. In mathematics, it is often called slope. A larger positive gradient means the line rises faster as you move to the right. A negative gradient means the line falls.
- Positive gradient: line goes up from left to right.
- Negative gradient: line goes down from left to right.
- Zero gradient: perfectly horizontal line.
- Undefined gradient: vertical line (no horizontal change).
Gradient Formula
1) Using Two Points
If you know two points, (x1, y1) and (x2, y2), use:
m = (y2 - y1) / (x2 - x1)
Here, m is the gradient. The top part is the vertical change (rise), and the bottom part is the horizontal change (run).
2) Using Rise and Run Directly
If you already know the vertical change and horizontal change:
m = rise / run
This is common in engineering, road design, and construction.
How to Use This Gradient Calculator
- Select your mode: Two Points or Rise/Run.
- Enter the required values.
- Click Calculate Gradient.
- Read the outputs: gradient, percent grade, and angle in degrees.
When you use two points, the calculator also gives you the line equation and point-to-point distance.
Worked Examples
Example 1: Increasing Line
Points: (2, 3) and (10, 7)
Rise = 7 - 3 = 4
Run = 10 - 2 = 8
Gradient = 4 / 8 = 0.5
So the line rises 0.5 units for every 1 unit across. In percent grade, that is 50%.
Example 2: Decreasing Line
Points: (1, 9) and (5, 1)
Rise = 1 - 9 = -8
Run = 5 - 1 = 4
Gradient = -8 / 4 = -2
The negative sign indicates downward slope from left to right.
Common Mistakes to Avoid
- Mixing units (e.g., rise in meters and run in feet).
- Swapping point order for y-values but not x-values.
- Ignoring the sign of the result (positive vs. negative slope).
- Trying to divide by zero when run = 0.
Where Gradient Is Used in Real Life
- Roads and railways: to control safe incline and decline.
- Roofing: to ensure proper water drainage.
- Physics: to analyze rates of change on graphs.
- Economics and data analysis: to measure trend strength.
- Machine learning: in optimization methods like gradient descent.
FAQ
Is gradient the same as slope?
Yes. In many contexts the words are interchangeable.
What does a gradient of 1 mean?
It means rise and run are equal. The line goes up 1 unit for each 1 unit across (45° angle).
Can gradient be a fraction or decimal?
Absolutely. Gradient can be any real number, including positive, negative, fractional, or zero.
What if the run is zero?
The line is vertical, so gradient is undefined.
Bottom Line
Gradient is one of the most useful ideas in math because it tells you how quickly something changes. Use the calculator above whenever you need fast, accurate slope, percent grade, or angle results.