Slope Calculator
Find the slope, line equation, and angle of inclination for any two points — or solve for a missing coordinate.
What is the Slope Formula?
The slope of a line measures how steep it is: how much the y-value changes for every one unit increase in x. It is often called rise over run because it equals the vertical change (rise) divided by the horizontal change (run) between any two points on the line.
The slope is a single number that fully describes the steepness and direction of a straight line:
- Positive slope: the line rises left to right
- Negative slope: the line falls left to right
- Zero slope: the line is horizontal (y does not change)
- Undefined slope: the line is vertical (x does not change, and division by zero is undefined)
Once you have the slope, you can write the full line equation in slope-intercept form: y = mx + b, where m is the slope and b is the y-intercept (the y-value where the line crosses the y-axis, found by b = y1 - m*x1).
Slope is fundamental in algebra, calculus (where it generalizes to the derivative), physics (rate of change), engineering (gradients), and everyday contexts such as road incline ratings and roof pitch calculations.
Formula and Variables
Y-intercept: b = y1 - m * x1
Line equation: y = mx + b
Angle of inclination: theta = arctan(|m|) in degrees
Find missing y2: y2 = y1 + m * (x2 - x1)
Find missing x2: x2 = x1 + (y2 - y1) / m
Find missing y1: y1 = y2 - m * (x2 - x1)
Find missing x1: x1 = x2 - (y2 - y1) / m
Variables:
- m — slope (rise over run)
- x1, y1 — coordinates of the first point
- x2, y2 — coordinates of the second point
- b — y-intercept (where the line crosses the y-axis)
- theta — angle between the line and the positive x-axis (0 to 90 degrees)
How to Use the Slope Calculator
Steps to Calculate
Example Calculations
Frequently Asked Questions
🔗 Related Calculators
What is the slope formula?
The slope formula is m = (y2 - y1) / (x2 - x1). It measures the rate of change: how much y changes for each unit increase in x. A positive value means an upward line; negative means downward; zero means horizontal; undefined means vertical.
How do you find the slope between two points?
Subtract the y-coordinates (y2 minus y1) to get the rise. Subtract the x-coordinates (x2 minus x1) to get the run. Divide rise by run: m = rise / run. For example, for (1, 2) and (4, 8): rise = 8 - 2 = 6, run = 4 - 1 = 3, slope = 6/3 = 2.
What does it mean when slope is undefined?
Slope is undefined when the two points share the same x-coordinate, making the run (x2 - x1) equal to zero. Division by zero is undefined in mathematics. Geometrically this represents a perfectly vertical line, which has no slope in the traditional sense.
What is the slope-intercept form of a line?
The slope-intercept form is y = mx + b, where m is the slope and b is the y-intercept (the y-value where the line crosses the y-axis). It is the most common way to write a line equation because m and b are directly readable from the formula.
How is the angle of inclination calculated from slope?
The angle of inclination theta equals arctan(|m|), converted to degrees: theta = atan(|m|) * (180/pi). A slope of 1 gives 45 degrees. A slope of 0 gives 0 degrees (horizontal). A vertical line is 90 degrees. The absolute value is used so the angle is always between 0 and 90 degrees.
What is rise over run?
Rise over run is an informal name for the slope formula. Rise is the vertical change (y2 - y1) between two points; run is the horizontal change (x2 - x1). Slope = rise / run. For example, a roof that rises 3 metres for every 12 metres of horizontal span has a slope of 3/12 = 0.25.
Can the slope be a decimal or fraction?
Yes. Slope can be any real number: positive integer, negative fraction, zero, or irrational. For example, the slope of the line through (0, 0) and (3, 1) is 1/3 ≈ 0.3333. This calculator displays decimals rounded to four places.
How do I find a missing coordinate if I know the slope?
Use the Find Missing Coordinate mode. Enter the known slope and the three known coordinate values, leaving the unknown field blank. The calculator solves the slope formula for the missing value: for example, if slope m, x1, y1, and x2 are known, then y2 = y1 + m*(x2-x1).
What is a negative slope?
A negative slope means the line falls from left to right: as x increases, y decreases. The steeper the downward angle, the more negative the slope. For example, a line through (0, 5) and (5, 0) has slope (0-5)/(5-0) = -1.
Are parallel lines and slope related?
Yes. Two lines are parallel if and only if they have the same slope (and different y-intercepts). Two lines are perpendicular if their slopes are negative reciprocals: m1 * m2 = -1. For example, slopes 2 and -0.5 are perpendicular.
Does the order of the two points affect the slope?
No. Swapping (x1, y1) and (x2, y2) gives the same slope because both the numerator and denominator change sign, and the negatives cancel. m = (y2-y1)/(x2-x1) = (y1-y2)/(x1-x2).
How is slope used in real life?
Slope appears in road gradients (a 6% grade means 6 cm rise per 100 cm run), roof pitch, wheelchair ramp regulations, ski run ratings, speed-time graphs in physics, interest-rate curves in finance, and any situation involving a constant rate of change between two variables.