Slope Calculator
A slope calculator finds the slope of the line through two coordinate points. Slope is the lineβs rate of change: how much the vertical coordinate changes for each unit of horizontal change. Enter x1, y1, x2, and y2 to get the rise, run, and decimal slope, then use the interpretation to identify whether the line rises, falls, stays horizontal, or is vertical.
Definition: slope as rate of change
In coordinate geometry, a line has constant steepness. Moving from one point on the line to another changes the y coordinate by a certain amount and the x coordinate by a certain amount. The ratio of those changes is the slope. It is often summarized as rise over run, where rise is vertical change and run is horizontal change.
This simple ratio carries a lot of meaning. In algebra, it is the coefficient of x in a linear equation written as y equals mx plus b. In physics, the slope of a position-versus-time graph is velocity. In business, the slope of a cost line can be dollars per unit. In construction, grade is often a rise-to-run ratio converted to a percent. The same calculation appears whenever a straight-line relationship can be described by two points.
Formula and variable definitions
For points and , the slope is
where:
- and are the coordinates of the first point.
- and are the coordinates of the second point.
- is the rise, or vertical change.
- is the run, or horizontal change.
The calculator requires the run to be nonzero. If , then the denominator is zero and no numerical slope exists. That is the vertical-line case. If while the run is nonzero, the slope is zero and the line is horizontal.
The formula comes directly from comparing coordinate differences. A straight line changes at a constant rate, so any two distinct points on the same nonvertical line give the same ratio. Reversing the point order does not change the result because both the numerator and denominator change sign.
Checked example
The calculatorβs default points are and . The rise is
The run is
So the slope is
The calculator displays the primary result as 0.5000 because it formats slope to four decimal places. It also lists rise as 2 and run as 4, and its note shows the substituted calculation. Interpreted in words, y increases by one-half unit for each 1-unit increase in x. If the axes were meters and seconds, the slope would be 0.5 meters per second. If they were dollars and items, it would be 0.5 dollars per item.
For a negative example, compare and . The rise is , and the run is , so the slope is . The line falls as x increases.
Interpreting slope in applications
Positive slope means the dependent variable increases as the independent variable increases. Negative slope means it decreases. Zero slope means no change in y over the interval. Undefined slope means the relationship is vertical and cannot be expressed as a numerical amount of y change per one x change.
Because slope is a ratio, units matter. A road that rises 6 feet over a horizontal run of 100 feet has slope 0.06, often described as a 6 percent grade. A graph of revenue against units sold may have slope equal to price per unit. A temperature trend line may have slope measured in degrees per hour. If you want to convert an angle associated with a slope, the angle converter can help with degrees and radians. If you are comparing before-and-after quantities rather than coordinate points, the percentage change calculator focuses on relative change. For datasets where a line is only part of the story, the statistics calculator summarizes center and spread.
Domain, edge cases, and common mistakes
The inputs can be positive, negative, zero, or decimal coordinates. The only forbidden geometric case is equal x coordinates, because the run is zero. Very small runs can produce very large slopes, so interpret decimal-coordinate examples carefully: a rise of 1 over a run of 0.001 gives a slope of 1000.
A common mistake is subtracting in inconsistent order, such as using but . That changes the sign. Use the same second-minus-first order for both coordinates. Another mistake is confusing steepness with the visual angle on a resized graph. If the x and y axes are not drawn with the same scale, a line can look steep or shallow while its numeric slope stays unchanged. Finally, remember that slope is not the y-intercept. The slope describes change; the intercept describes where the line crosses the y-axis.
Sources
- Wolfram MathWorld, Slope β mathematical definition of line slope.
- Khan Academy, Slope review β instructional explanation of rise over run.
- OpenStax, Understand Slope of a Line β algebra textbook treatment of slope and graph interpretation.