Free to Use

Slope Calculator

Calculate the slope between two points on a line. Find slope, y-intercept, distance, and line equation with step-by-step solutions.

X-coordinate of first point
Y-coordinate of first point
X-coordinate of second point
Y-coordinate of second point

Real-World Slope Examples

๐Ÿ”๏ธ Ramp Construction

A wheelchair ramp connects two points: the start at (0, 0) and the end at (12, 3) โ€” where x is horizontal distance (feet) and y is height (feet).

Slope: m = (3 - 0) รท (12 - 0) = 0.25

Equation: y = 0.25x (y-intercept = 0)

ADA guidelines recommend slopes of 1:12 or less (m โ‰ค 0.083) for new construction. This ramp exceeds standards โ€” consider a longer run.

๐Ÿ“ˆ Stock Price Trend

A stock's price was $45 on day 10 and $75 on day 30. Points: (10, 45) and (30, 75).

Slope: m = (75 - 45) รท (30 - 10) = 30 รท 20 = 1.5

Equation: y = 1.5x + 30

Interpretation: The stock rose $1.50 per day, starting from a base of $30 (y-intercept).

Analyzing trends using slope helps investors understand the rate of price change over time.

๐Ÿ—๏ธ Roof Pitch

A roof rises from (0, 8) at the wall to (10, 18) at the peak (feet).

Slope: m = (18 - 8) รท (10 - 0) = 10 รท 10 = 1.0

Equation: y = 1.0x + 8

Distance between points: โˆš[(10-0)ยฒ + (18-8)ยฒ] = โˆš(100 + 100) = 14.14 feet

A slope of 1.0 means the roof rises 1 foot for every 1 foot of horizontal run โ€” a 45-degree angle. This is a fairly steep roof pitch.

๐Ÿ”ฌ Physics: Velocity from Position

A ball rolling down a ramp passes point (1, 4) meters at time 1s and point (5, 20) meters at time 5s.

Slope (velocity): m = (20 - 4) รท (5 - 1) = 16 รท 4 = 4 m/s

Distance traveled: โˆš[(5-1)ยฒ + (20-4)ยฒ] = โˆš(16 + 256) = โˆš272 โ‰ˆ 16.49 meters

When plotting position vs. time, the slope of the line gives the velocity. A steeper slope means a higher speed.

Understanding the Slope of a Line

The slope of a line measures its steepness and direction. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two distinct points on the line.

Slope Formula

m = (yโ‚‚ - yโ‚) / (xโ‚‚ - xโ‚)
Where (xโ‚, yโ‚) and (xโ‚‚, yโ‚‚) are two distinct points on the line, with xโ‚ โ‰  xโ‚‚.
Distance = โˆš[(xโ‚‚ - xโ‚)ยฒ + (yโ‚‚ - yโ‚)ยฒ]
The Euclidean distance between the two points, derived from the Pythagorean Theorem.

Y-Intercept Formula

b = y - mx
Using either point: b = yโ‚ - mยทxโ‚ (or b = yโ‚‚ - mยทxโ‚‚). Both give the same result.
Line Equation: y = mx + b
The slope-intercept form of a linear equation, where m is the slope and b is the y-intercept.

How to Calculate Slope Step by Step

1
Identify the coordinates: Write down (xโ‚, yโ‚) and (xโ‚‚, yโ‚‚) for your two points.
2
Calculate the rise: Subtract yโ‚ from yโ‚‚ (ฮ”y = yโ‚‚ - yโ‚).
3
Calculate the run: Subtract xโ‚ from xโ‚‚ (ฮ”x = xโ‚‚ - xโ‚). Verify ฮ”x โ‰  0 โ€” a vertical line has undefined slope.
4
Divide rise by run: m = ฮ”y รท ฮ”x to find the slope.
5
Find the y-intercept: Substitute m and either point into b = y - mx.
6
Write the equation: Express the line as y = mx + b using the computed values.

Interpreting Slope Values

๐Ÿ“ˆ Positive Slope (m > 0)

The line rises from left to right. As x increases, y increases. Example: m = 2 means y increases by 2 for every 1 unit increase in x.

๐Ÿ“‰ Negative Slope (m < 0)

The line falls from left to right. As x increases, y decreases. Example: m = -3 means y decreases by 3 for every 1 unit increase in x.

โžก๏ธ Zero Slope (m = 0)

A horizontal line with no vertical change. The line is parallel to the x-axis. The equation is y = b (constant).

โฌ†๏ธ Undefined Slope

A vertical line where xโ‚ = xโ‚‚. The run is zero, and division by zero is undefined. The equation is x = a (constant x-value).

๐Ÿ“
Slope Calculation
Compute the slope (m) between any two points instantly using the standard rise-over-run formula.
๐Ÿ“
Line Equation Generation
Get the complete line equation in slope-intercept form (y = mx + b) with the y-intercept automatically calculated.
๐Ÿ“Š
Point Distance
Calculate the Euclidean distance between the two points using the Pythagorean distance formula.
๐Ÿ“
Step-by-Step Solutions
See the full working โ€” rise, run, slope computation, y-intercept calculation, and final equation โ€” all explained clearly.

What Is the Slope of a Line?

The slope of a line is a measure of its steepness and direction. Mathematically, it is the ratio of the vertical change (the "rise") to the horizontal change (the "run") between any two points on the line. Slope is commonly denoted by the letter m and is calculated using the formula m = (yโ‚‚ - yโ‚) / (xโ‚‚ - xโ‚).

Slope is a fundamental concept in algebra, geometry, and calculus. It describes how a line behaves โ€” whether it rises, falls, or stays flat โ€” and by how much. In the slope-intercept form y = mx + b, the slope m determines the line's angle, while the y-intercept b determines where it crosses the y-axis.

The slope concept extends far beyond mathematics. In physics, slope represents velocity on a position-time graph. In economics, marginal cost and revenue are slopes of cost and revenue functions. In engineering, road grades and roof pitches are expressed as slopes. Mastering slope calculations is essential for anyone studying algebra, precalculus, or calculus.

Key Properties of Slope

How to Calculate Slope Between Two Points

Finding the slope between two points is a straightforward process once you understand the formula. Here's a detailed walkthrough:

Step 1: Identify your two points as (xโ‚, yโ‚) and (xโ‚‚, yโ‚‚). For example, take Point 1 as (2, 3) and Point 2 as (5, 7).

Step 2: Calculate the rise (change in y): ฮ”y = yโ‚‚ - yโ‚ = 7 - 3 = 4.

Step 3: Calculate the run (change in x): ฮ”x = xโ‚‚ - xโ‚ = 5 - 2 = 3.

Step 4: Divide rise by run: m = 4 รท 3 = 1.333...

Step 5: Find the y-intercept: b = yโ‚ - mยทxโ‚ = 3 - 1.333 ร— 2 = 3 - 2.667 = 0.333.

Step 6: Write the equation: y = 1.333x + 0.333.

Step 7: Calculate the distance: โˆš[(5-2)ยฒ + (7-3)ยฒ] = โˆš(9 + 16) = โˆš25 = 5.

Common Mistakes to Avoid

Real-World Applications of Slope

Slope appears in countless real-world scenarios across multiple disciplines:

๐Ÿ”๏ธ Construction & Architecture

Roof pitch, stair rise-to-run ratios, wheelchair ramp gradients, road grades, and drainage slopes all use slope calculations to ensure safety and functionality.

๐Ÿ’ฐ Finance & Economics

The slope of a trendline in stock charts shows the rate of price change. Supply and demand curves use slope to describe market sensitivity (elasticity).

๐Ÿ”ฌ Physics & Engineering

Velocity is the slope of a position-time graph. Acceleration is the slope of a velocity-time graph. Force vs. displacement slopes give spring constants.

๐ŸŒ Geography & Surveying

Topographic maps use slope to indicate terrain steepness. Surveyors calculate grade percentages for roads, railways, and land development projects.

Frequently Asked Questions

What does the slope of a line tell us?
The slope tells us two things about a line: its steepness (how quickly y changes relative to x) and its direction (whether the line rises, falls, or is flat). A slope of 2 means y increases by 2 units for every 1 unit increase in x. A slope of -0.5 means y decreases by 0.5 units for every 1 unit increase in x. A slope of 0 means y does not change as x changes (horizontal line).
What happens if xโ‚ = xโ‚‚? Can the slope still be calculated?
If xโ‚ = xโ‚‚, the line is vertical and the slope is undefined. This is because the run (ฮ”x) is zero, and division by zero is mathematically undefined. A vertical line has the equation x = a, where a is the constant x-value. Our calculator will display an error message if you try to calculate the slope of a vertical line. You can still find the distance between the two points, which is simply |yโ‚‚ - yโ‚|.
How do I find the y-intercept from the slope and a point?
To find the y-intercept (b) when you know the slope (m) and one point (x, y), use the formula b = y - mx. For example, if the slope is 2 and the line passes through (3, 7), then b = 7 - 2(3) = 7 - 6 = 1. The line equation is y = 2x + 1. You can use either point โ€” both will give the same y-intercept value.
What is the difference between positive and negative slopes?
A positive slope means the line rises from left to right โ€” as x increases, y increases. Think of an uphill path. A negative slope means the line falls from left to right โ€” as x increases, y decreases. Think of a downhill path. The absolute value of the slope indicates steepness: a slope of 5 is steeper than a slope of 2, and a slope of -5 is steeper than a slope of -2.
How is slope related to the angle of a line?
The slope m is directly related to the angle ฮธ that the line makes with the positive x-axis. Specifically, m = tan(ฮธ), where ฮธ is measured in degrees or radians. To find the angle from the slope, use ฮธ = arctan(m). For example, a slope of 1 corresponds to a 45ยฐ angle, a slope of 0 is 0ยฐ (horizontal), and a slope of โˆš3 โ‰ˆ 1.732 corresponds to a 60ยฐ angle. A vertical line has an angle of 90ยฐ with an undefined slope.
How do I know if two lines are parallel or perpendicular using slopes?
Parallel lines have equal slopes (mโ‚ = mโ‚‚). For example, y = 2x + 3 and y = 2x - 5 are parallel because both have slope 2. Perpendicular lines have slopes that are negative reciprocals of each other: mโ‚ ร— mโ‚‚ = -1 (or mโ‚‚ = -1/mโ‚). For example, a line with slope 2 is perpendicular to a line with slope -ยฝ because 2 ร— (-ยฝ) = -1. These relationships hold for all non-vertical lines. Vertical lines (undefined slope) are perpendicular to horizontal lines (slope = 0).

โš ๏ธ Important Note: This Slope Calculator is for educational and informational purposes only. While every effort has been made to ensure accuracy, results should be verified independently for critical applications such as construction, engineering, physics calculations, or financial decisions. Always consult a qualified professional for slope-related decisions in high-stakes contexts. Remember that vertical lines have undefined slopes and cannot be computed using the standard formula.