What Is Slope How To Calculate

Slope Calculator

What Is Slope and How Do You Calculate It?

Use this interactive calculator to find slope from two points, see the rise and run visually, convert to percent grade and angle, and understand what the number means in algebra, geometry, engineering, and real world measurement.

  • Compute slope from any two coordinate points
  • See slope as a ratio, decimal, percent grade, and angle
  • Visualize the line with an interactive chart
  • Learn the formula with examples and expert guidance below
Formula

The slope of a line is rise divided by run.

m = (y2 – y1) / (x2 – x1)
Quick meaning

Positive slope rises to the right. Negative slope falls to the right. Zero slope is horizontal. Undefined slope is vertical.

Used for rise and run labels in the result.
Choose how many decimals to show.

Your result will appear here

Enter two points and click Calculate Slope to see the slope, angle, percent grade, and line equation.

What is slope?

Slope is a number that tells you how steep a line is and in which direction it moves as you go from left to right. In algebra, geometry, trigonometry, physics, surveying, architecture, transportation, and data analysis, slope is one of the most important ideas because it describes change. If one variable changes as another variable changes, slope captures the rate of that change. The standard symbol for slope is m.

When people ask, “What is slope and how do you calculate it?” they are usually trying to understand one of two things. First, they may want the mathematical definition of slope for a line on a coordinate plane. Second, they may want a practical way to measure steepness in the real world, such as the grade of a road, wheelchair ramp, roof, hiking trail, drainage line, or landscape surface. In both cases, the core concept is the same: slope compares vertical change to horizontal change.

Slope = rise / run = (y2 – y1) / (x2 – x1)

Here, rise means how much the line goes up or down vertically, and run means how much it moves horizontally. If the line rises as you move to the right, the slope is positive. If the line falls as you move to the right, the slope is negative. If the line stays at the same height, the slope is zero. If the line is vertical, the run is zero, so the slope is undefined because division by zero is not allowed.

How to calculate slope step by step

The most common method is to use two points on the line: (x1, y1) and (x2, y2). You subtract the y values to get the rise, then subtract the x values to get the run. Finally, divide rise by run.

  1. Identify the coordinates of two points on the line.
  2. Find the vertical change: y2 – y1.
  3. Find the horizontal change: x2 – x1.
  4. Divide the vertical change by the horizontal change.
  5. Simplify the fraction if possible, or convert it to a decimal if needed.

Example: Use the points (2, 3) and (8, 15). The rise is 15 – 3 = 12. The run is 8 – 2 = 6. The slope is 12 / 6 = 2. That means the line rises 2 units vertically for every 1 unit it moves to the right.

Why order matters, and why it also does not

You must subtract in the same order for both coordinates. If you calculate y2 – y1, you must also calculate x2 – x1. If you switch the order in both the top and bottom, you still get the same slope because both signs change together. For example:

  • (15 – 3) / (8 – 2) = 12 / 6 = 2
  • (3 – 15) / (2 – 8) = -12 / -6 = 2

This is a common area where students make mistakes. The problem is not changing the order. The problem is changing the order in only one part of the formula.

Interpreting positive, negative, zero, and undefined slope

Positive slope

A positive slope means the line goes upward as you move from left to right. In a graph of income over time, a positive slope may show growth. In a terrain model, it may mean you are climbing uphill.

Negative slope

A negative slope means the line goes downward as you move from left to right. In economics, this often appears in demand curves. In elevation profiles, it indicates a descent.

Zero slope

A zero slope means there is no vertical change. The line is horizontal. An example is the equation y = 5. No matter what x is, y stays the same.

Undefined slope

An undefined slope means the horizontal change is zero. The line is vertical, such as x = 4. Since the denominator in the slope formula is zero, the slope cannot be computed as a real number.

Slope in fraction, decimal, percent grade, and angle

Slope can be expressed in several ways depending on the field you are working in:

  • Ratio or fraction: rise/run, such as 3/4
  • Decimal: 0.75
  • Percent grade: slope x 100, such as 75%
  • Angle in degrees: arctangent of slope, such as tan-1(0.75) = 36.87 degrees

These forms are connected, but they are not identical. A slope of 1 does not mean 1 degree. It means rise equals run. Its percent grade is 100%, and its angle is 45 degrees because tan(45 degrees) = 1.

Rise : Run Decimal Slope Percent Grade Angle in Degrees Typical Interpretation
1 : 20 0.05 5% 2.86 Gentle roadway or drainage slope
1 : 12 0.0833 8.33% 4.76 Common maximum ramp guideline ratio in accessibility contexts
1 : 4 0.25 25% 14.04 Noticeably steep path or roof pitch equivalent range
1 : 2 0.50 50% 26.57 Very steep grade
1 : 1 1.00 100% 45.00 Equal rise and run

Real world statistics and standards related to slope

Slope matters far beyond the classroom. It appears in public infrastructure, land management, transportation design, and accessibility. The numbers below show how slope is used in real standards and guidance.

Application Reference Value Equivalent Percent Authority Why It Matters
Accessible ramp running slope 1:12 maximum 8.33% ADA guidance from U.S. government resources Supports safe access and mobility for wheelchair users
Accessible cross slope 1:48 maximum 2.08% ADA guidance from U.S. government resources Helps prevent lateral tilt that can make movement difficult
Interstate highway design on mountainous terrain Often around 6% maximum by design guidance context 6% Transportation engineering references Balances safety, braking distance, and heavy vehicle performance
USGS topographic analysis Slope often derived from digital elevation models Varies by landscape U.S. Geological Survey Used for runoff, erosion, hazard mapping, and land planning

Important note: standards vary by project type, jurisdiction, and design code. Always verify requirements with the latest official engineering, building, or accessibility source.

Different contexts where slope is used

Algebra and coordinate geometry

In algebra, slope measures the rate at which y changes for each 1 unit increase in x. If the equation is y = mx + b, then m is the slope and b is the y intercept. This makes slope central to graphing linear equations, comparing lines, and understanding parallel or perpendicular relationships. Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals, when both slopes are defined.

Physics and engineering

On a graph of distance versus time, slope can represent speed. On a graph of position versus time, the slope tells you velocity direction and magnitude. In civil engineering and construction, slope can describe drainage paths, road grade, roof design, and embankments. In electronics and economics, slope still means rate of change, even though the variables are different.

Geography and earth science

The U.S. Geological Survey and GIS professionals use slope to analyze terrain. Steeper slopes often correlate with higher erosion risk, faster runoff, and greater landslide susceptibility in certain geologic conditions. Slope maps created from elevation data are used in watershed management, zoning studies, environmental planning, and emergency response.

Common mistakes when calculating slope

  • Reversing only one subtraction: You must keep the same order in both numerator and denominator.
  • Using x change over y change: The formula is y change divided by x change, not the other way around.
  • Ignoring units: If rise and run are not measured in the same unit, the result can be misleading.
  • Confusing percent grade with degrees: A 100% slope equals 45 degrees, not 100 degrees.
  • Forgetting vertical lines are undefined: If x2 = x1, there is no valid real-number slope.

How to find slope from an equation

If you are given a line in slope intercept form, y = mx + b, the slope is simply the coefficient of x. For example:

  • y = 3x + 7 has slope 3
  • y = -2x + 1 has slope -2
  • y = x – 4 has slope 1

If the equation is in standard form, Ax + By = C, you can solve for y to identify the slope. For example, 2x + y = 5 becomes y = -2x + 5, so the slope is -2.

How to calculate slope from a graph

To find slope directly from a graph, choose two clear points where the line passes through grid intersections. Count how many units the line rises or falls, then count how many units it runs to the right. Write the result as rise over run. If the line goes down as you move right, the slope is negative. If you count up 3 and right 4, the slope is 3/4. If you count down 2 and right 5, the slope is -2/5.

Practical examples of slope

Example 1: Road grade

A road rises 18 feet over a horizontal distance of 300 feet. The slope is 18/300 = 0.06. The percent grade is 6%. This is a realistic roadway grade value in some design conditions.

Example 2: Wheelchair ramp ratio

If a ramp rises 1 foot over 12 feet of run, the slope is 1/12 = 0.0833, or 8.33%. This ratio is widely recognized in accessibility discussions. Government accessibility resources explain how running slope and cross slope are treated in compliant design.

Example 3: Data trend

If sales increase from 200 units to 260 units while advertising spend goes from 10 to 20, the slope is (260 – 200) / (20 – 10) = 60/10 = 6. That means sales increased by 6 units for each additional 1 unit of advertising spend, based on those two points.

Authoritative sources for slope, grade, and measurement

If you want to explore trusted references, these sources are strong places to begin:

Frequently asked questions about slope

What does a slope of 2 mean?

A slope of 2 means that for every 1 unit increase in x, y increases by 2 units. The line rises steeply as you move to the right.

Can slope be a fraction?

Yes. In fact, slope is often easiest to interpret as a ratio, such as 3/5 or -2/7. Fractions are especially useful when comparing rise to run.

Is slope the same as grade?

Not exactly. Grade usually means slope expressed as a percentage. If slope is 0.08, the grade is 8%.

What is the slope of a horizontal line?

The slope is 0 because there is no vertical change.

What is the slope of a vertical line?

The slope is undefined because the run is 0, and division by zero is not possible.

Final takeaway

Slope is one of the clearest ways to describe change. Whether you are graphing equations, studying rates, building a ramp, designing drainage, or reading a topographic map, the idea is the same: compare vertical change to horizontal change. To calculate slope, subtract the y coordinates, subtract the x coordinates, and divide. Then interpret the result as a ratio, decimal, percent, or angle depending on your purpose. Use the calculator above to test different points and instantly see how the line changes.

Leave a Reply

Your email address will not be published. Required fields are marked *