ThisCalculator

Chemistry

Graph Slope Calculator: How to Find Slope

Updated · Standard formula, shown below

Slope (m) 2.0000
Rise (y₂−y�)
6.00
Result
Run (x₂−x�)
3.00
Result
Angle
63.43 degrees
Result

Graph Slope Calculator: How to Find Slope

This calculator finds the slope of a line when you enter two points (x1, y1) and (x2, y2). You get the slope as a decimal, a fraction, and the equation of the line in point-slope form. It also shows the rise over run and the angle of inclination, so you can see exactly what the slope means.

Formula

The slope of a line through two points (x�, y�) and (x₂, y₂) is:

m = (y₂ − y�) / (x₂ − x�)

  • m = slope (unitless, or in the units of y per unit of x)
  • (xâ‚�, yâ‚�) = coordinates of the first point
  • (xâ‚‚, yâ‚‚) = coordinates of the second point

The slope is the rise (vertical change) divided by the run (horizontal change). It tells you how steep the line is and in which direction it tilts. A positive slope means the line goes up as x increases; a negative slope means it goes down. A zero slope is a horizontal line; an undefined slope (division by zero) is a vertical line.

Worked Example

Using the default values: (x�, y�) = (1, 2) and (x₂, y₂) = (4, 8).

  1. Calculate the rise: y₂ − y� = 8 − 2 = 6
  2. Calculate the run: x₂ − x� = 4 − 1 = 3
  3. Divide rise by run: 6 ÷ 3 = 2

The slope is 2. This matches the calculator’s output of 2.00. The rise is 6, the run is 3, and the angle of inclination is atan2(6, 3) ≈ 63.43°.

How to Read the Slope

A slope of 2 means that for every 1 unit you move to the right (run), the line goes up 2 units (rise). In real-world terms, if the x-axis is time (hours) and the y-axis is distance (miles), a slope of 2 means you travel 2 miles per hour. The slope is a rate of change.

The angle of inclination is the angle the line makes with the positive x-axis, measured counterclockwise. It is the arctangent of the slope, but using atan2 ensures the correct quadrant for negative slopes. For example, a slope of −1 gives an angle of −45° (or 315° if you prefer 0–360°).

When the slope is undefined (x₂ = x�), the line is vertical, and the angle is 90° or −90° depending on direction. The calculator will show “Infinity� or an error because division by zero is not defined.

Common Mistakes and How to Avoid Them

  • Swapping the order of points: The formula works regardless of which point you call (xâ‚�, yâ‚�) as long as you subtract in the same order. If you mix up the order in the numerator and denominator, you get the wrong sign.
  • Forgetting the negative signs: Negative coordinates are a common source of errors. For example, (xâ‚�, yâ‚�) = (−2, 3) and (xâ‚‚, yâ‚‚) = (4, −1) gives rise = −1 − 3 = −4 and run = 4 − (−2) = 6, so slope = −4/6 = −2/3. It helps to write out the subtraction step.
  • Using the slope formula for vertical lines: If xâ‚‚ = xâ‚�, the slope is undefined. The line is vertical, not “infiniteâ€� in a practical sense; it has no run, so the concept of slope does not apply.
  • Rounding too early: If you round intermediate values, you may get a slope that is slightly off. Keep full precision until the final step.

When to Use a Slope Calculator

You might need the slope for:

  • Algebra homework: writing equations of lines, finding parallel or perpendicular lines.
  • Physics: velocity (slope of position vs. time), acceleration (slope of velocity vs. time).
  • Economics: marginal cost (slope of cost vs. quantity), demand curves.
  • Construction: roof pitch, ramp incline, road grade.
  • Data analysis: the slope of a trend line in a scatter plot.

In all these cases, the slope is the rate of change of one variable with respect to another. The calculator works for any units, but you need to keep the units consistent. For example, if x is in hours and y is in miles, the slope is in miles per hour.

How to Choose the Right Point Order

The slope is the same no matter which point you call first, as long as you are consistent. However, for the angle of inclination, using the leftmost point as (x�, y�) and the rightmost as (x₂, y₂) gives an angle between −90° and 90°. If you reverse them, the angle will be off by 180° (e.g., 45° vs. 225°). The calculator uses atan2, which returns values from −180° to 180°, so the angle will be correct for the order you enter. To get the conventional angle (0° to 180° for a line), you can add 180° if the result is negative.

Limitations of the Slope Formula

The slope formula only works for straight lines. If your data points are not linear, the slope between two points is the average rate of change over that interval, not the slope of the entire curve. For curves, you need calculus (derivatives) to find the instantaneous slope at a point. Also, the slope is sensitive to outliers: if one point is far off, the slope between two points may not represent the overall trend.

Another limitation: the slope is a dimensionless number only when the axes have the same units. If the axes have different units (e.g., time in seconds and distance in meters), the slope has those units (m/s). The calculator does not display units, so you must interpret them yourself.

Frequently Asked Questions

What is the slope of a horizontal line?

A horizontal line has a rise of 0, so the slope is 0. For example, the line through (2, 5) and (7, 5) has slope (5−5)/(7−2) = 0/5 = 0. The angle is 0°.

What is the slope of a vertical line?

A vertical line has a run of 0, so the slope is undefined (division by zero). The angle is 90° or −90°. In the calculator, you will get an error or “Infinity� because you cannot divide by zero.

How do I find the equation of a line from the slope?

Once you have the slope m and one point (x�, y�), you can write the point-slope form: y − y� = m(x − x�). Then simplify to slope-intercept form (y = mx + b) by solving for y. For example, with slope 2 and point (1,2), y − 2 = 2(x − 1) → y = 2x.

What is the difference between slope and gradient?

In mathematics, they are the same thing. In vector calculus, “gradient� refers to a vector of partial derivatives. In everyday language, “gradient� can also mean the steepness of a road or slope. For a straight line, slope and gradient are synonyms.

Can the slope be a fraction?

Yes, the slope is often left as a fraction, like 2/3, to show the exact rise over run. The calculator gives a decimal, but you can convert it to a fraction manually. For example, 0.6667 is approximately 2/3.

How do I find slope from a graph without coordinates?

Pick two points on the line that have clear grid intersections. Count the vertical change (rise) and horizontal change (run) between them. Then divide rise by run. This is the same as the formula, but you are reading the coordinates from the graph.

Related

Formula used
in x1 | x� | - | 1 | 0
in y1 | y� | - | 2 | 0
in x2 | xâ‚‚ | - | 4 | 0
in y2 | yâ‚‚ | - | 8 | 0
out slope | Slope (m) | - | (y2 - y1) / (x2 - x1) | 4
out rise | Rise (y₂−y�) | - | y2 - y1 | 2
out run | Run (x₂−x�) | - | x2 - x1 | 2
out angle | Angle | degrees | atan2(y2 - y1, x2 - x1) * 180 / pi | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.