What is a slope calculator?
A slope calculator finds the steepness of the straight line that passes through two points on a coordinate plane. The slope, usually written as , describes how much the line rises (or falls) vertically for each unit it moves horizontally. It is one of the most fundamental quantities in coordinate geometry and shows up everywhere from algebra to physics, road design, and statistics.
Given two points and , this calculator returns a single dimensionless number — the rise divided by the run.
Key concepts
- Point — an ordered pair that locates a position on the plane.
- Rise — the vertical change between the two points, .
- Run — the horizontal change between the two points, .
- Slope (m) — the ratio of rise to run. A pure number with no units when both axes use the same unit.
How does the calculator work?
The slope between two points is defined as the ratio of the vertical change to the horizontal change:
Enter the coordinates of the two points and the calculator immediately returns the slope. If , the line is vertical and the slope is undefined — the calculator leaves the result empty in that case, because dividing by zero has no meaningful value.
What the sign of the slope means
- Positive slope () — the line goes up from left to right.
- Negative slope () — the line goes down from left to right.
- Zero slope () — the line is horizontal; the values are equal.
- Undefined slope — the line is vertical; the values are equal and the denominator is zero.
Worked examples
Example 1: positive slope
For the points and :
The line rises one unit for every unit it moves to the right — a 45° angle.
Example 2: steeper positive slope
For the points and :
The line rises twice as fast as it runs.
Example 3: horizontal line
For the points and :
Both points share the same , so the line is horizontal.
Example 4: vertical line (undefined)
For the points and :
The line is vertical. The calculator returns an empty value because the slope does not exist.
Example 5: negative slope
For the points and :
The line falls two units for every unit it moves to the right.
Practical uses
- Geometry and algebra — finding the equation of a line in slope-intercept form .
- Construction and civil engineering — expressing the grade of a road, ramp, or roof. A grade of 5% is a slope of 0.05.
- Physics — reading velocity from a position-time graph, or acceleration from a velocity-time graph.
- Statistics — the slope of a regression line measures the average change in one variable per unit change in another.
- Cartography and hiking — relating elevation change to horizontal distance from a topographic map. Pair this with the distance-2d calculator to compute the actual length of the segment, or with the midpoint calculator to locate the point halfway along it.
Notes
- The slope is dimensionless when both coordinates are measured in the same unit. The calculator converts inputs internally so that mixing units (for example, in cm and in m) still gives a correct ratio.
- The order of the two points does not matter: swapping and negates both rise and run, leaving the slope unchanged.
- A vertical line has no defined slope. Some texts say the slope is “infinite,” but in practice it is left undefined.
- Slope is closely related to the Pythagorean theorem: the rise, run, and the distance between the two points form a right triangle.