Slope Calculator

Enter two points to find slope, distance, midpoint, and the equation of the line.

Point 1
Point 2
Slope (m)
2
6 / 3
Angle
63.43°
Distance
6.708
Midpoint
(2.5, 5)
Slope-Intercept Form
y = 2x + 0
Point-Slope Form
y - 2 = 2(x - 1)
Rise
6
Run
3
Disclaimer: This tool is provided for general educational purposes only. Neither MayoCalc nor Cook Media Systems assumes any liability for consequences arising from the use of this tool. By using this site, you agree to our Terms of Service and Disclaimer.

What Is Slope?

Slope measures the steepness and direction of a line. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line. A slope of 2 means the line rises 2 units for every 1 unit it moves to the right. A slope of -1 means the line falls 1 unit for every 1 unit to the right. A slope of 0 is a perfectly horizontal line, and an undefined slope is a vertical line.

Slope (m) = (y₂ - y₁) / (x₂ - x₁) = rise / run

How to Use This Calculator

Enter the coordinates of two points: (x₁, y₁) and (x₂, y₂). The calculator instantly computes the slope (as both a decimal and a fraction), the angle of inclination in degrees, the distance between the two points, the midpoint, and the equation of the line in both slope-intercept form (y = mx + b) and point-slope form (y - y₁ = m(x - x₁)). The interactive graph updates in real time as you change the inputs.

Understanding Slope Types

Positive slope: The line rises from left to right. Both variables increase together. Examples include speed vs. time when accelerating, and revenue vs. units sold at a fixed price.

Negative slope: The line falls from left to right. As one variable increases, the other decreases. Examples include altitude vs. time when descending, and remaining battery charge vs. usage time.

Zero slope: A horizontal line where y does not change regardless of x. The equation is y = b (a constant). Example: a car parked at a constant elevation.

Undefined slope: A vertical line where x does not change. Division by zero makes the slope undefined. The equation is x = a (a constant). Example: dropping an object straight down.

Slope-Intercept Form: y = mx + b

Slope-intercept form is the most common way to write the equation of a line. In y = mx + b, m is the slope and b is the y-intercept (the point where the line crosses the y-axis). To find b, substitute the slope and one known point into the equation and solve: b = y₁ - m * x₁. This form is especially useful for graphing because it immediately tells you where the line starts (b) and how steeply it rises or falls (m).

Point-Slope Form: y - y₁ = m(x - x₁)

Point-slope form is useful when you know the slope and one point but do not need the y-intercept immediately. It is often the fastest way to write the equation of a line in exam settings. To convert to slope-intercept form, distribute m and isolate y. Both forms describe the same line and are interchangeable.

Distance and Midpoint Formulas

The distance between two points uses the Pythagorean theorem: d = sqrt((x₂ - x₁)² + (y₂ - y₁)²). The midpoint is the average of the coordinates: M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2). Both formulas are essential in coordinate geometry, physics, and engineering. The Quadratic Equation Solver handles parabolas and curves where slope varies at each point.

Real-World Applications of Slope

Slope appears throughout science and daily life. In physics, velocity is the slope of a position-time graph, and acceleration is the slope of a velocity-time graph. In construction, roof pitch is expressed as slope (a 6:12 pitch means the roof rises 6 inches for every 12 inches of horizontal run). Road grades are slopes expressed as percentages: a 6% grade means 6 feet of rise per 100 feet of horizontal distance. In economics, the slope of a demand curve shows how price changes affect quantity demanded. In statistics, the slope of a regression line quantifies the relationship between two variables.

Parallel and Perpendicular Lines

Parallel lines have equal slopes. If line A has slope 3, any line parallel to it also has slope 3. Perpendicular lines have slopes that are negative reciprocals of each other: if line A has slope 3, a perpendicular line has slope -1/3. The product of perpendicular slopes always equals -1 (except for horizontal and vertical lines, which are perpendicular but one slope is 0 and the other is undefined). These relationships are fundamental in geometry, CAD design, and navigation.

Slope Calculator FAQ

What is the slope formula?
The slope formula is m = (y₂ - y₁) / (x₂ - x₁), where (x₁, y₁) and (x₂, y₂) are two points on the line. It measures the rate of change: how much y changes for each unit change in x.
What does a negative slope mean?
A negative slope means the line goes downward from left to right. As x increases, y decreases. For example, a slope of -2 means y decreases by 2 for every 1 unit increase in x.
What is an undefined slope?
A vertical line has an undefined slope because the run (x₂ - x₁) equals zero, and division by zero is undefined. The equation of a vertical line is x = a constant, such as x = 3.
How do you find the equation of a line from two points?
First find the slope m using (y₂ - y₁) / (x₂ - x₁). Then use point-slope form: y - y₁ = m(x - x₁). Rearranging gives slope-intercept form: y = mx + b, where b is the y-intercept.
What is the difference between slope and rate of change?
For a straight line, slope and rate of change are the same thing. Slope measures the constant rate at which y changes per unit of x. For curves, the rate of change varies at each point, and the slope of the tangent line at a specific point gives the instantaneous rate of change (a concept from calculus).

Related Calculators