Slope (m)
Y-Intercept (b)
Line Equation
Angle of Inclination
Table of Contents
What is the slope of a line?
The slope of a line measures how steep it is — specifically, how much the line rises (or falls) for every unit it moves to the right. A larger absolute slope means a steeper line; a slope of zero means the line is flat. Slope is one of the most fundamental concepts in algebra and the gateway to graphs, linear equations, and calculus.
The slope formula
The slope between two points (x₁, y₁) and (x₂, y₂) is calculated as:
m = (y₂ − y₁) / (x₂ − x₁)
The numerator (y₂ − y₁) is called the "rise" — the vertical change between the two points. The denominator (x₂ − x₁) is called the "run" — the horizontal change. Slope is often described as "rise over run" because of this structure.
Order matters in a specific way: as long as you subtract the coordinates in the same order in both the numerator and the denominator, you'll get the correct slope. Subtracting in opposite orders flips the sign incorrectly.
Finding the equation of the line
Once you know the slope m, you can write the equation of the line in slope-intercept form: y = mx + b, where b is the y-intercept (the point where the line crosses the y-axis). The y-intercept can be calculated by substituting one of the points into y = mx + b and solving for b:
b = y₁ − m·x₁
For example, if the slope is 2 and the line passes through (3, 7), then b = 7 − 2·3 = 1, and the equation is y = 2x + 1. This calculator does the algebra for you and presents the result in clean slope-intercept form.
Positive, negative, zero and undefined slopes
A positive slope means the line rises from left to right — y increases as x increases. A negative slope means the line falls — y decreases as x increases. A slope of zero indicates a perfectly horizontal line, where y stays constant. An undefined slope occurs when the line is vertical (x₁ = x₂), because the slope formula divides by zero.
How to use the slope calculator
Enter the x and y coordinates of two points that lie on your line. The calculator returns the slope, the y-intercept, the full equation in slope-intercept form, and the angle the line makes with the horizontal axis (its angle of inclination, useful in physics and engineering applications).
If your two points have the same x-value, the line is vertical and the slope is undefined. If they have the same y-value, the line is horizontal with slope zero. The calculator handles both edge cases gracefully.
Real-world applications of slope
Slope shows up everywhere outside the math classroom. In construction and architecture, the slope (or "pitch") of a roof determines drainage and snow load. In transportation, the grade of a road or rail line — usually expressed as a percentage — is the slope multiplied by 100. In economics, slope describes elasticity and rate of change in supply and demand curves.
In data analysis, the slope of a best-fit line through scatter-plotted data is the heart of linear regression — it tells you how much one variable changes per unit change in another. From physics (velocity is the slope of a position-vs-time graph) to finance (return-on-investment trajectories), slope is one of math's most universally useful tools.
Parallel and perpendicular lines
Two lines are parallel if they have the same slope. They are perpendicular if their slopes are negative reciprocals of each other — that is, m₁ · m₂ = −1. For example, a line with slope 2 is perpendicular to a line with slope −1/2. This relationship is used constantly in geometry proofs, in CAD design, and in graphics programming.
Angle of inclination
The angle of inclination is the angle (measured counterclockwise from the positive x-axis) that the line makes with the horizontal. It is calculated as θ = arctan(m). A slope of 1 corresponds to a 45° angle; a slope of 0 to 0°; and a vertical line corresponds to 90°. This angle is often more intuitive than the raw slope number when describing physical inclines.
FAQs
The slope of a line is a measure of its steepness — how much the line rises or falls for every unit it moves horizontally. It is calculated as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line. A positive slope rises from left to right; a negative slope falls.
The slope formula is m = (y₂ − y₁) / (x₂ − x₁), where (x₁, y₁) and (x₂, y₂) are any two points on the line. The numerator is the rise (change in y) and the denominator is the run (change in x). The result is a single number that describes the steepness of the line.
First, calculate the slope m using the slope formula. Then use the point-slope form y − y₁ = m(x − x₁) with one of your points, and rearrange to slope-intercept form y = mx + b. The y-intercept b can also be found directly as b = y₁ − m·x₁.
A slope is undefined when the line is vertical — that is, when x₁ = x₂. The denominator of the slope formula becomes zero, which is mathematically undefined. Vertical lines have the equation x = c for some constant c, and they cannot be written in slope-intercept form.
A slope of zero indicates a horizontal line. The y-values do not change as x increases, so the line is perfectly flat. Its equation has the form y = b, where b is the y-intercept. Horizontal lines are common in graphs of constant values, like a fixed temperature or a fixed price.
In two-dimensional geometry, slope and gradient are essentially the same thing — both describe the steepness of a line. Outside the US, 'gradient' is the more common term for what Americans call 'slope.' In multivariable calculus, gradient takes on a more specific meaning as a vector of partial derivatives, but for lines on a plane the two terms are interchangeable.