About the Slope Calculator
Slope measures steepness, whether of a graph line, a road, a ramp or a roof. This slope calculator takes two points and gives the slope as an exact fraction and a decimal, the equation of the line in slope-intercept, point-slope and standard forms, the angle of the line and the distance between the points. Through (1, 2) and (4, 8), for example, the slope is 2 and the line is y = 2x. A road grade of 8 percent is a slope of 0.08, an angle of about 4.57 degrees.
Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). A positive slope climbs to the right, a negative slope falls, a slope of zero is a horizontal line, and a vertical line has an undefined slope because the run is zero. The y-intercept b follows from b = y₁ − m x₁, and the angle the line makes with the x-axis is arctan(m). Using fractions keeps the equation exact; 2/3 stays 2/3 instead of becoming 0.666667.
Example: through (1, 2) and (3, 8), the rise is 6 and the run is 2, so m = 3. Then b = 2 − 3 × 1 = −1, giving y = 3x − 1, or 3x − y = 1 in standard form. The line climbs at about 71.5651°, and the points are √40 = 2√10 ≈ 6.3246 apart. Through (1, 2) and (4, 4) the slope is 2/3, and the line is y = (2/3)x + 4/3, or 2x − 3y = −4.
Slope appears in roads and ramps as a percentage grade, which is the slope × 100. For the distance and midpoint of a segment, see the distance formula calculator and midpoint calculator, and for best-fit lines through many points, the linear regression calculator.
How to use the Slope Calculator
- Enter the first pointType x₁ and y₁.
- Enter the second pointType x₂ and y₂.
- Read the slope and equationSee m as a fraction and decimal, and y = mx + b.
- See every formCheck point-slope and standard forms, intercepts, angle and distance.
Slope Calculator features
- Slope as an exact fraction and a decimal
- Slope-intercept, point-slope and standard form
- x- and y-intercepts
- Angle of inclination in degrees
- Distance between the points with exact root
- Horizontal and vertical lines handled
- Step-by-step working
Common uses
- Algebra and coordinate geometry homework
- Road, ramp and roof grades
- Rates of change in science and economics
- Checking graphs and plotted data
- Preparing for SAT and ACT math
Slope in practice: roads, ramps, roofs, drains and graphs
Slope measures steepness: how much something rises or falls over a given horizontal distance. It shows up as gradients on road signs, ratios for ramps, pitches for roofs, falls for drainage pipes and rates of change on graphs. Each field writes slope differently, as a percentage, a ratio, an angle or a fraction, so converting between them is essential. This guide covers those contexts with worked examples.
Road gradients
Road signs in many countries show steep hills as a percentage, such as 10%, meaning the road rises 10 metres for every 100 metres travelled horizontally. That is a ratio of 1 in 10, or an angle of about 5.7 degrees. Older signs in the United Kingdom showed ratios such as 1:10. A 20% gradient is very steep for cars, especially for heavy vehicles going downhill.
Ramps and accessibility
Accessibility guidance in many countries recommends wheelchair ramps no steeper than 1:12, which is a gradient of about 8.3% or an angle of about 4.8 degrees. Gentler slopes, such as 1:15 or 1:20, are easier to use. To find a ramp's length, multiply the rise by the ratio: a step of 0.6 metres needs a ramp about 7.2 metres long at 1:12, usually with landings at intervals for rest.
Roof pitches
Roof pitch can be written as an angle, such as 30 degrees, or as a rise over a run, such as 6 in 12. Different roofing materials have minimum pitches: some tiles need steeper roofs to shed water, while sheet materials can work at lower pitches. Converting between angle and ratio is a common step when reading manufacturers' instructions.
Drains and pipes
Drainage pipes must slope so that water and waste flow away. Household drains are often laid at falls of around 1 in 40 to 1 in 80, depending on pipe size and local regulations. Too little fall lets solids settle, while too much can let water run ahead of the solids. Builders set the fall with levels and lasers, and slope calculations convert the ratio into a total drop over the pipe's length.
A worked example: a mountain road
A road climbs 120 metres in height over a horizontal distance of 1.5 kilometres. The gradient is 120 ÷ 1,500 = 0.08, or 8%, a ratio of about 1 in 12.5 and an angle of about 4.6 degrees. A sign would show 8%, which drivers of heavy vehicles take as a cue to use a lower gear when descending.
If the road's length along its surface was measured instead of the horizontal distance, the difference at this gradient is tiny, but for steep slopes it matters, so check which distance a measurement describes.
Slope on graphs
On a graph, slope is the rate of change of one quantity with another. On a distance-time graph, the slope is speed; on a graph of total cost against quantity, it is the price per unit. A steeper line means a faster rate of change, and a negative slope means one quantity decreases as the other increases. Reading slopes this way is one of the most useful skills in data analysis.
Slope in statistics
A line of best fit through data points has a slope that summarises the relationship between two variables, such as how much a house price rises, on average, with each extra square metre. The slope is an average trend, not a rule for every case, and it says nothing about causation on its own.
Common mistakes
- Treating a 100% slope as vertical; it is 45 degrees.
- Swapping rise and run.
- Mixing up percentage gradient and angle in degrees.
- Using the sloping length instead of the horizontal run.
Related tools
For angles, use Angle Converter. For roofs, try Roofing Calculator, and for distances between points, Distance Formula Calculator.
Stairs
Stairs are slopes broken into steps, and building regulations set limits on their steepness. In England, for example, private stairs may have a maximum pitch of 42 degrees. Comfortable stairs usually have a rise of about 150 to 190 mm per step and a going, the depth of the tread, of about 250 to 300 mm. The ratio of rise to going is the slope, and checking it before building avoids stairs that feel steep or awkward.
Slopes as unit rates
In everyday maths, slope often appears as a unit rate. A taxi fare that rises by Rs 50 for every kilometre has a slope of 50 rupees per kilometre on a graph of fare against distance, and a phone plan's cost per gigabyte is the slope of cost against data. Seeing these rates as slopes helps compare options: the steeper line costs more for each extra unit.
Measuring a slope on site
To measure a slope on site, place a straight board of known length, such as 1 metre, on the slope with a spirit level on top, lift the low end until the board is level and measure the gap underneath. A gap of 80 mm over 1 metre is a gradient of 8%. Builders use the same idea with longer straight edges, string lines or laser levels for greater accuracy over longer distances.
Limits
Calculations are exact for the values entered. Follow local building regulations for ramps, roofs and drainage.
Frequently asked questions
How do I calculate slope?
Divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). From (2, 1) to (6, 9), the rise is 8 and the run is 4, so the slope is 2.
What does a negative slope mean?
The line falls as you move to the right. A slope of −2 means y drops by 2 for every 1 step in x. Zero slope is flat, and the steeper the line the larger the absolute value.
What is slope-intercept form?
y = mx + b, where m is the slope and b is the y-intercept, the point where the line crosses the y-axis. y = 3x − 1 has slope 3 and crosses at (0, −1).
What is the slope of a vertical line?
Undefined, because the run x₂ − x₁ is zero and you cannot divide by zero. Vertical lines are written x = c. Horizontal lines have slope 0 and are written y = c.
How do I convert slope to an angle?
Take the arctangent: angle = arctan(m). A slope of 1 is 45°, a slope of 3 is about 71.57°, and a slope of 0.5 is about 26.57°.
How do I convert slope to percent grade?
Multiply by 100. A slope of 0.08 is an 8% grade, meaning 8 units of rise per 100 units of horizontal distance, common on steep roads.
What is standard form of a line?
Ax + By = C with whole-number A, B and C, usually with A positive. y = (2/3)x + 4/3 becomes 2x − 3y = −4 after multiplying by 3 and rearranging.