Toolvito

Works on this device

Graph Gradient Calculator

The gradient tells you how steep a line is: how far it goes up for each step across. Find it from two points on a graph, from the equation of a line, at a point on a curve, or for a ramp or roof from its rise and length.

Enter your values

Read two points from the line on your graph and enter them here.

Your values

A whole number, a decimal or a fraction such as 3/4.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Calculate.

How to find the gradient of a graph

  1. For a straight line: pick two points on the line that are easy to read, far apart from each other. Read their x and y values from the scales on the axes.
  2. Choose Gradient of a straight line through two points and enter the two points.
  3. Choose Calculate. The page gives the gradient, the equation of the line and the working.
  4. For a curve: the gradient is different at every point. If you know the formula of the curve, choose Gradient of a curve at a point. If you only have the drawing, draw the tangent line at the point with a ruler and use two points on that line.

The formulas

  • Two points: gradient = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁).
  • Equation a x + b y = c: gradient = −a ÷ b. For y = mx + c the gradient is m.
  • Curve y = f(x): gradient at x = a is the derivative f′(a). This is the gradient of the tangent line there.
  • Ramp or roof: gradient = rise ÷ flat length. A ratio of 1 in N means a gradient of 1 ÷ N.
  • Percent = gradient × 100. Angle = arctan(gradient).

What the sign and size mean

  • A positive gradient goes up from left to right. A negative gradient goes down.
  • A gradient of 0 is a horizontal line. A vertical line has no gradient, because the run is 0.
  • A larger number means a steeper line. A gradient of 1 is 45° when both axes use the same scale.

How to type a function for a curve

  • Use x as the variable, with +, -, *, / and ^ for powers. 2x means 2 times x.
  • Functions: sin, cos, tan, asin, acos, atan, sqrt, abs, ln, log, exp. They need brackets, such as sin(x). Constants: pi and e.
  • Angles are in radians. ln is the natural logarithm. log is the logarithm to base 10.
  • -x^2 means −(x²). 1/2x is read as (1/2) × x. Anything else is refused, and the page tells you where the problem is.

Worked examples

A line passes through (1, 3) and (4, 9). Rise = 9 − 3 = 6 and run = 4 − 1 = 3. The gradient is 6 ÷ 3 = 2, and the line is y = 2x + 1.

The line 3x + 4y = 12 has gradient −3 ÷ 4 = −0.75.

The curve y = x^2 − 4x has the gradient function 2x − 4. At x = 3 the gradient is 2.

A ramp rises 300 mm over a flat length of 3.6 m. The gradient is 0.3 ÷ 3.6 = 0.0833, which is 1 in 12, 8.33% or 4.76°.

Limits you should know

  • The gradient of a line is worked out with exact fractions. Other results are shown with 6 significant digits.
  • The angle is the true angle of the line on a graph only when both axes use the same scale.
  • For a curve you need its formula. The page cannot read a gradient from a picture, and it does not draw graphs.
  • For ramps the page works out the gradient and compares it with a limit that you enter. It does not know the building or access rules of your country. This is not professional advice.

Related tools