Slope Calculator
Use this free Slope Calculator to find the slope of a line from two points, rise and run, a point-slope equation, or slope-intercept form. The calculator shows the slope value, rise over run, equation details, angle, percentage grade, and whether the line rises, falls, is horizontal, or is vertical.
If you are learning how to find slope, the most common formula is m = (y₂ − y₁) ÷ (x₂ − x₁). This page also includes a Point Slope Formula calculator, rise over run calculator, slope-intercept form calculator, roof slope calculator, and step-by-step examples so you can solve common slope problems without switching between different tools.
Slope Calculator
Find slope from two points, rise and run, point-slope form, slope-intercept form, or roof pitch.
- How to Use the Slope Calculator
- What Is Slope?
- Slope Formula
- How to Find Slope With Two Points
- Rise Over Run
- Point-Slope Formula
- Slope-Intercept Form
- How to Find Slope on a Graph
- Positive, Negative, Zero, and Undefined Slope
- Slope of a Perpendicular Line
- Roof Slope Calculator
- Slope Percentage and Angle
- Slope Examples
- Frequently Asked Questions
How to Use the Slope Calculator
The Slope Calculator has five modes so you can solve the most common slope problems without rewriting the problem into another form first. Choose Two Points when you know two coordinates on the line. Choose Rise Over Run when you already know the vertical and horizontal change. Use Point-Slope Form when you know one point and the slope, or Slope-Intercept Form when an equation is already written as y = mx + b. The Roof Slope mode converts rise and run into pitch, angle, and percentage grade.
After entering the values, press the green Calculate button. The result includes the numerical slope as well as related information such as rise, run, angle, percent slope, line type, and equation form. For basic arithmetic checks, you can also use our Simple Math Calculator.
What Is Slope?
Slope is a measure of how steep a line is and which direction it moves as you travel from left to right. In coordinate geometry, slope compares the vertical change in a line with the horizontal change. A line that rises quickly has a larger positive slope, while a line that falls from left to right has a negative slope.
The letter m is commonly used to represent slope. If m = 2, the line rises 2 units for every 1 unit it moves to the right. If m = −0.5, the line falls 0.5 units for every 1 unit of horizontal movement.
Understanding what slope means is more useful than memorizing a formula. Slope tells you a rate of change. On a graph of distance versus time, slope can represent speed. On a graph of cost versus quantity, slope can represent the extra cost per unit. On a roof, road, ramp, or drainage surface, slope describes steepness.
Slope Formula
The standard slope formula is:
m = (y₂ − y₁) ÷ (x₂ − x₁)
This formula subtracts the y-values to find the rise and subtracts the x-values to find the run. The order must stay consistent. If you calculate y₂ − y₁ in the numerator, you must calculate x₂ − x₁ in the denominator.
The expression is sometimes typed as y2-y1/x2-x1, but parentheses are important when entering it into a calculator: (y₂ − y₁) / (x₂ − x₁). Without parentheses, the order of operations can produce the wrong answer.
How to Find Slope With Two Points
To find the slope of a line with two points, label the points (x₁, y₁) and (x₂, y₂), then subtract the coordinates. Suppose the two points are (1, 2) and (5, 10).
- Change in y: 10 − 2 = 8
- Change in x: 5 − 1 = 4
- Slope: 8 ÷ 4 = 2
The slope is 2. That means the line rises 2 units for every 1 unit it moves to the right. This is the most common answer to questions asking how to find slope with two points or how to calculate the slope of a line from coordinates.
Rise Over Run
Rise over run is another way to describe the slope formula. Rise is the vertical change and run is the horizontal change. Therefore:
Slope = Rise ÷ Run
If a line rises 6 units while moving 3 units to the right, the slope is 6/3 = 2. If it falls 6 units during the same run, the rise is −6 and the slope becomes −2.
Rise over run is especially useful when reading a graph because you can choose two points that lie exactly on grid intersections. Count the vertical movement first, then the horizontal movement. Reduce the resulting fraction when possible. If you need help simplifying a fractional slope, our Fraction Calculator can help.
Point-Slope Formula
The point-slope formula is useful when you know the slope of a line and one point on that line. The formula is:
y − y₁ = m(x − x₁)
Here, m is the slope and (x₁, y₁) is the known point. If the slope is 3 and the line passes through (2, 5), substitute those values into the point-slope formula:
y − 5 = 3(x − 2)
You can expand this equation to get slope-intercept form:
y = 3x − 1
The Point-Slope Form mode in the calculator performs both steps. This makes it useful as a point slope formula calculator, point slope equation calculator, or point slope form calculator.
Slope-Intercept Form
Slope-intercept form is one of the most recognizable forms of a line equation:
y = mx + b
In this equation, m is the slope and b is the y-intercept. The y-intercept is where the line crosses the vertical y-axis.
For example, in y = 4x + 7, the slope is 4 and the y-intercept is 7. In y = −2x + 5, the slope is −2 and the y-intercept is 5.
The slope intercept form calculator on this page identifies both values and converts the slope into an angle and percentage. For more advanced calculations involving powers, trigonometry, and functions, see our Scientific Calculator.
How to Find Slope on a Graph
To find slope on a graph, choose two clear points that lie on the line. It is easiest to use points where the line crosses grid intersections. Starting from the left point, count how many units you move vertically to reach the same height as the second point. That is the rise. Then count the horizontal movement to the second point. That is the run.
If you move upward, the rise is positive. If you move downward, the rise is negative. Moving to the right gives a positive run. Dividing rise by run gives the slope.
A slope graph can also help you visualize why a larger absolute slope means a steeper line. A slope of 5 rises much faster than a slope of 0.5. A slope of −5 falls steeply, while −0.5 falls gradually.
Positive, Negative, Zero, and Undefined Slope
| Slope Type | What the Line Does | Example |
|---|---|---|
| Positive slope | Rises from left to right | m = 2 |
| Negative slope | Falls from left to right | m = −2 |
| Slope of 0 | Horizontal line | m = 0 |
| Undefined slope | Vertical line | x = 4 |
A horizontal line has a slope of 0 because there is no vertical change. A vertical line has an undefined slope because the horizontal change is zero, and division by zero is undefined.
What Is the Slope of 0?
A slope of 0 means the line is perfectly horizontal. The y-value remains constant even as x changes. For example, y = 6 is a horizontal line with slope 0.
What Is an Undefined Slope?
An undefined slope occurs when the run is zero. This happens for vertical lines. If two points have the same x-coordinate, x₂ − x₁ equals zero. Because the slope formula would require division by zero, the slope is undefined.
Slope of a Line That Is Perpendicular
For most nonvertical lines, the slope of a perpendicular line is the negative reciprocal of the original slope. If the original slope is 2, the perpendicular slope is −1/2. If the original slope is −3/4, the perpendicular slope is 4/3.
The rule can be written as:
m₂ = −1 / m₁
A horizontal line and a vertical line are also perpendicular to one another. In that special case, one slope is 0 and the other is undefined.
Parallel Lines and Slope
Parallel nonvertical lines have the same slope. For example, y = 3x + 2 and y = 3x − 8 never intersect because both have slope 3 but different y-intercepts.
Roof Slope Calculator
Roof slope is commonly described as rise over a 12-unit horizontal run. A roof that rises 6 inches for every 12 inches of run is called a 6:12 roof pitch.
The Roof Slope mode accepts any rise and run using the same unit, then converts the result to decimal slope, pitch per 12 units, slope percentage, and slope angle in degrees.
For a 6:12 roof, the decimal slope is 0.5, the slope percentage is 50%, and the angle is approximately 26.57°. Roof slope should not be confused with roof surface length; the latter also depends on the horizontal run and can require right-triangle calculations.
Slope Percentage
Slope percentage converts a decimal slope into a percent by multiplying by 100:
Slope Percentage = Slope × 100
A slope of 0.12 equals a 12% grade. A slope of 0.5 equals a 50% grade. A 100% grade corresponds to a rise equal to the run, which produces a 45-degree angle.
If you need to convert other values into percentages, the Percentage Calculator can help with percent change, percentage of a number, and related calculations.
Slope Angle Calculator
To convert slope to an angle, use the inverse tangent function:
Angle = arctan(slope)
For example, a slope of 1 gives an angle of 45°. A slope of 0.5 gives approximately 26.57°, and a slope of 2 gives approximately 63.43°.
Slope Equation
The phrase slope equation can refer to several related equations. The most common are the slope formula, slope-intercept form, and point-slope form.
- Slope formula: m = (y₂ − y₁)/(x₂ − x₁)
- Slope-intercept form: y = mx + b
- Point-slope form: y − y₁ = m(x − x₁)
Each form describes the same underlying relationship but starts from different information. The calculator lets you move between the forms without redoing every algebra step manually.
How to Calculate Slope From an Equation
If an equation is already written as y = mx + b, the coefficient of x is the slope. For example, in y = 7x − 3, the slope is 7.
If the equation is not solved for y, rearrange it. For example, 2x + 4y = 8 becomes 4y = −2x + 8, then y = −0.5x + 2. The slope is −0.5.
Slope Examples
Example 1: Find the Slope of Two Points
Points: (2, 3) and (6, 11). m = (11 − 3)/(6 − 2) = 8/4 = 2.
Example 2: Negative Slope
Points: (1, 8) and (5, 0). m = (0 − 8)/(5 − 1) = −8/4 = −2.
Example 3: Slope of 0
Points: (1, 5) and (9, 5). m = (5 − 5)/(9 − 1) = 0/8 = 0.
Example 4: Undefined Slope
Points: (4, 2) and (4, 10). The run is 4 − 4 = 0, so the slope is undefined.
Example 5: Point-Slope Equation
Point: (3, 4), slope: 2. The point-slope form is y − 4 = 2(x − 3). Expanding gives y = 2x − 2.
Example 6: Roof Slope
Rise: 4 inches, run: 12 inches. Decimal slope = 4/12 = 0.3333. Roof pitch = 4:12, slope percentage ≈ 33.33%, and angle ≈ 18.43°.
Why Use a Slope Calculator?
A slope calculator reduces arithmetic mistakes and makes it easier to compare several forms of the same line. It is especially useful when coordinates contain decimals or negative numbers, when you need the slope percentage or angle, or when you want to convert between point-slope and slope-intercept form.
The calculator can also help verify homework or construction calculations, but it is still useful to understand the formula. Knowing why rise over run works makes it easier to identify errors, recognize impossible values, and understand how the line should look on a graph.
Common Slope Mistakes
- Subtracting x-values in one order and y-values in the opposite order.
- Forgetting that a vertical line has undefined slope rather than slope 0.
- Confusing the y-intercept with the slope in y = mx + b.
- Forgetting a negative sign when a line falls from left to right.
- Using percentage grade as though it were an angle in degrees.
- Typing the two-point slope formula without parentheses.
Slope, Speed, and Rate of Change
Slope is a general rate-of-change concept. When y represents distance and x represents time, slope is speed. If the graph uses miles and hours, a slope of 60 means 60 miles per hour. If you are working with actual travel distance rather than graph coordinates, our Distance Calculator can compare driving and straight-line distance.
Fractional and Decimal Slopes
Slope does not have to be a whole number. A slope of 1/2 means the line rises 1 unit for every 2 units of run. A slope of 0.25 means the same thing as 1/4. Keeping a slope as a fraction can sometimes make graphing easier because the numerator directly represents rise and the denominator represents run.
Can Slope Be Greater Than 1?
Yes. A slope of 3 means the line rises 3 units for every 1 unit of run. There is no upper limit on the magnitude of a finite slope. As a line becomes more vertical, the absolute value of its slope becomes larger.
Can Slope Be Negative?
Yes. Negative slope simply means the line falls as x increases. For example, a slope of −2 means the line falls 2 units for every 1 unit it moves to the right.
How to Find Slope From a Table
You can also find slope when the x- and y-values are listed in a table instead of plotted on a graph. Choose any two rows, treat them as coordinate points, and calculate the change in y divided by the change in x. For example, suppose a table contains the points (2, 7) and (5, 16). The change in y is 16 − 7 = 9, while the change in x is 5 − 2 = 3. The slope is therefore 9 ÷ 3 = 3.
If the relationship is linear, you should get the same slope regardless of which two rows you select. This is a useful way to check whether a table represents a straight-line relationship. If different pairs produce different slopes, the relationship may be nonlinear or the data may contain rounding or measurement variation.
Finding Slope From Standard Form
A linear equation may also be written in standard form as Ax + By = C. To find the slope, solve the equation for y. Start by subtracting Ax from both sides, then divide by B:
By = −Ax + C
y = (−A/B)x + C/B
The slope is therefore −A/B, provided B is not zero. For example, 3x + 2y = 12 becomes 2y = −3x + 12, then y = −1.5x + 6. The slope is −1.5.
How to Find the Y-Intercept From Two Points
Once you know the slope between two points, you can find the y-intercept by substituting either point into y = mx + b. Rearranging gives b = y − mx. For example, if the slope is 2 and the line passes through (3, 10), then b = 10 − 2(3) = 4. The complete slope equation is y = 2x + 4.
It does not matter which of the two original points you use. If the slope was calculated correctly and both points lie on the same line, substituting either one should produce the same y-intercept.
How to Graph a Line From Its Slope
When you know a point and the slope, you can graph the line without finding a second point in advance. Start at the known point. Write the slope as a fraction if necessary. The numerator tells you how far to move vertically and the denominator tells you how far to move horizontally.
For example, a slope of 3/2 means rise 3 and run 2. From the starting point, move up 3 units and right 2 units to locate another point. A slope of −3/2 can be graphed by moving down 3 and right 2, or up 3 and left 2. Draw a straight line through the points.
Whole-number slopes can always be written over 1. A slope of 4 is the same as 4/1, so the line rises 4 units for every 1 unit of horizontal movement.
How to Find Slope From a Graph Without Exact Coordinates
When a graph does not label exact coordinates, look for two places where the line crosses clear grid intersections. The points do not have to be the x- and y-intercepts. Any two exact points on the same straight line produce the same slope.
A common mistake is measuring the visual length of the line with a ruler. Slope is not based on the physical length of the line on the page. It is based on coordinate changes. Count vertical grid units for rise and horizontal grid units for run.
Slope as a Rate of Change
In many real-world problems, slope is described as a rate of change instead of using the word slope. Suppose the cost of renting equipment rises from $120 at 2 hours to $300 at 5 hours. The cost changes by $180 while time changes by 3 hours, so the slope is $60 per hour.
The units of slope come from dividing the y-axis unit by the x-axis unit. If y is dollars and x is hours, the slope is dollars per hour. If y is kilometres and x is hours, slope is kilometres per hour. If y is elevation and x is horizontal distance, slope measures grade or steepness.
Slope in Word Problems
To solve a slope word problem, first identify the two quantities that are changing. Decide which quantity belongs on the x-axis and which belongs on the y-axis. Then identify two data points and use the slope formula.
For example, if a tank contains 500 litres at 1:00 p.m. and 380 litres at 3:00 p.m., the change in volume is −120 litres and the change in time is 2 hours. The slope is −60 litres per hour. The negative sign tells you the amount in the tank is decreasing.
Slope and Linear Functions
A linear function has a constant slope. That means equal changes in x produce equal changes in y. This constant rate of change is what creates a straight line on a graph. If the slope changes from one interval to another, the function is not linear across those intervals.
For a linear function written as f(x) = mx + b, the coefficient m is the slope. The same rules that apply to y = mx + b apply to function notation. For example, f(x) = −4x + 9 has slope −4.
Slope From Two Points With Negative Coordinates
Negative coordinates do not change the slope formula. The main challenge is keeping subtraction signs organized. Suppose the points are (−3, 4) and (2, −6). The change in y is −6 − 4 = −10. The change in x is 2 − (−3) = 5. The slope is −10/5 = −2.
Writing each subtraction inside parentheses before simplifying can prevent sign mistakes, especially when both coordinates are negative.
Slope From Decimal Coordinates
The slope formula works the same way with decimals. If the points are (1.5, 2.4) and (4.5, 8.4), the rise is 6 and the run is 3, producing a slope of 2. The Two Points mode accepts decimal coordinates directly and also reports the related line equation when the slope is defined.
Slope From Fractions
Fractional coordinates can be handled by converting them to decimals before entering them, or by doing the subtraction as fractions. A final slope such as 2/3 means the line rises 2 units for every 3 units of horizontal movement. A fractional slope is often more useful than a rounded decimal when graphing because it directly tells you the rise and run.
What Does a Steeper Slope Mean?
For lines that are not vertical, steepness is related to the absolute value of the slope. A slope of 4 is steeper than a slope of 1. A slope of −4 is also steeper than −1; the negative sign only changes the direction. As the absolute value of slope gets larger, the line approaches vertical.
A slope close to zero produces a flatter line. For example, 0.05 rises only 0.05 unit for each unit of run, while 5 rises 5 units over the same horizontal distance.
Slope Percentage vs Degrees
Slope percentage and slope angle measure steepness differently. A 100% slope is not a 100-degree angle. A 100% slope means rise equals run, which corresponds to 45 degrees. The conversion is based on the tangent relationship between the angle and rise over run.
For smaller slopes, percentage and degrees may look somewhat similar numerically, but the difference becomes larger as the slope increases. This is why road grade, roof pitch, and geometric angle should not be treated as interchangeable measurements.
Common Roof Slope Examples
| Roof Pitch | Decimal Slope | Percent Grade | Approx. Angle |
|---|---|---|---|
| 2:12 | 0.167 | 16.7% | 9.46° |
| 4:12 | 0.333 | 33.3% | 18.43° |
| 6:12 | 0.500 | 50.0% | 26.57° |
| 8:12 | 0.667 | 66.7% | 33.69° |
| 12:12 | 1.000 | 100% | 45° |
These values show why roof pitch, slope percentage, and angle can describe the same roof in different ways. The Roof Slope Calculator converts between them automatically.
Slope and Perpendicular Lines
The negative-reciprocal rule is an important shortcut in coordinate geometry. If one line has slope 5/2, a perpendicular line has slope −2/5. Multiplying the two slopes gives −1. If one line is horizontal, its perpendicular line is vertical instead of having a normal numeric reciprocal.
Slope and Parallel Lines
Parallel lines have equal slopes because they rise or fall at the same rate. Their y-intercepts are different unless the equations describe the exact same line. If you are given one line and asked to write a parallel equation through a new point, keep the original slope and use the new point to solve for the intercept.
How Slope Relates to the Equation of a Line
Slope, point-slope form, and slope-intercept form are not separate topics; they are different ways of describing the same line. The two-point formula finds m from two coordinates. Point-slope form combines m with one known point. Slope-intercept form rearranges the equation so you can immediately read m and the y-intercept.
This relationship is why a good slope calculator should do more than return one number. Seeing the slope, rise and run, equation, angle, and line type together makes it easier to understand how the values connect.
Learn More About Graphing Lines
For additional lessons and practice on slope, graphing lines, horizontal and vertical lines, and slope-intercept form, see Khan Academy’s graphing lines and slope unit.
Slope Calculator Frequently Asked Questions
What is the slope formula?
The slope formula is m = (y₂ − y₁)/(x₂ − x₁). It calculates the change in y divided by the change in x between two points.
How do you find slope?
Choose two points on the line, subtract the y-values to get the rise, subtract the x-values to get the run, then divide rise by run.
What is rise over run?
Rise over run is another name for slope. Rise is vertical change and run is horizontal change, so slope = rise ÷ run.
How do I find slope with two points?
For points (x₁, y₁) and (x₂, y₂), use m = (y₂ − y₁)/(x₂ − x₁). Keep the subtraction order consistent in the numerator and denominator.
What is the point slope formula?
The point-slope formula is y − y₁ = m(x − x₁), where m is slope and (x₁, y₁) is a known point.
What is slope-intercept form?
Slope-intercept form is y = mx + b. The coefficient m is the slope and b is the y-intercept.
What is the slope of a horizontal line?
The slope of a horizontal line is 0 because its rise is zero.
What is the slope of a vertical line?
A vertical line has undefined slope because its run is zero and division by zero is undefined.
How do you find slope on a graph?
Pick two points on the graph, count the vertical change between them, count the horizontal change, then divide rise by run.
How do you calculate slope percentage?
Multiply decimal slope by 100. A slope of 0.08 is an 8% grade.
How do you convert slope to degrees?
Use the inverse tangent: angle = arctan(slope). A slope of 1 gives a 45° angle.
What is the slope of a perpendicular line?
For ordinary nonvertical lines, the perpendicular slope is the negative reciprocal. A slope of 2 has perpendicular slope −1/2.
Do parallel lines have the same slope?
Yes. Distinct parallel nonvertical lines have equal slopes and different intercepts.
What does a negative slope mean?
A negative slope means the line falls from left to right as x increases.
What is a 4:12 roof slope?
A 4:12 roof rises 4 units for every 12 units of horizontal run. Its decimal slope is about 0.333, grade is about 33.3%, and angle is about 18.4°.
Is slope the same as angle?
No. Slope is rise divided by run, while angle is measured in degrees. They are related through the tangent function.
Final Thoughts
Slope is one of the most useful ideas in algebra and coordinate geometry because it measures rate of change in a simple way. Whether you need to find the slope of a line from two points, use the point slope formula, calculate rise over run, identify slope-intercept form, or convert roof pitch into an angle and percentage, the Slope Calculator above gives you the result and the supporting values in one place.
For best results, keep coordinate order consistent and remember the key rule: slope = change in y ÷ change in x. A positive result rises from left to right, a negative result falls, zero gives a horizontal line, and a zero run produces an undefined vertical slope.