The slope of a line measures its steepness or inclination. It tells us how quickly the line rises or falls as we move along the positive x-axis. A line with a higher slope is steeper, while one with a lower slope is flatter.
In two-dimensional coordinates, the slope is defined as the ratio of the change in the y-coordinate to the change in the x-coordinate.
Slope(m) =
\frac{Change \ in \ y \ coordinate}{Change \ in \ x \ coordinate }= \frac {Δy}{Δx}

If the inclination of the line with a positive x-axis is θ, then the slope is given as follows:
m = tan θ
Slope of a Line Equation
The slope of a line is given by the equation
y - y1 = m(x - x1)
⇒ y = mx + C where m is slope and C is the y-intercept
Finding the Slope of a Line
1. Calculation of Slope Between Two Points
If the given points are (x1, y1) and (x2, y2), then the slope of a line passing through both points is given by:
\text{Slope} = \frac{y_2 - y_1}{x_2 - x_1}

Example: Find the slope if the points are (4, 2) and (8, 12).
Given:
Point A (4,2) and point B (8,12)
Coordinate x1 and y1 is 4 and 2
Coordinate x2 and y2 is 8 and 12
Thus,
m=\frac{(y_2-y_1)}{(x_2-x_1 )} ⇒ m = (12 - 2)/(8 - 4)
⇒ m = 10/4 = 2.5
2. Calculation of Slopes from Graph
Step 1: Mark two points on the line with their coordinates.
Step 2: Use the Formula for the Slope between two points to calculate the slope.

Example: Find the slope of the following line in the graph.

Solution:
We have to find Δx (change in x) and Δy (change in y)
So, change in Δx = 6 and change is Δy= ( -3)
Now slope m is given as follows:
m = Δy/Δx
⇒ m = -3/6 = -1/2
3. Calculation of Slope from Table
Step 1: Choose two values of x and its corresponding values of y from the table.
Step 2: Calculate the change in x value and change in y value.
Step 3: Calculate the slope using the formula, Slope = change in y-values/change in x-values.
Example 1: Calculate the slope between x = 1 and x = 3 of the following table.
x-value | y-value |
|---|---|
1 | 5 |
2 | 7 |
3 | 9 |
4 | 11 |
5 | 13 |
Solution:
Change in x-values = 3 - 1 = 2
Change in y-values = 9 - 5 = 4
As we know, Slope = change in y-values/change in x-values
⇒ Slope = 4/2 = 2
So, the slope between x = 1 and x = 3 in this table is 2.
Example 2: Calculate the slope of the following table.
| x | y |
|---|---|
| 2 | 5 |
| 3 | 10 |
| 4 | 15 |
| 5 | 20 |
Solution:
Identify change in each consecutive pair of y so change in the y is 5, 5 and 5.
Identify change in each consecutive pair of x so change in the x is 1, 1 and 1.
Now writing the ratio using slope formula 5/1, 5/1 and 5/1.
So, slope from table is 5.
Positive and Negative Slope
A line is said to have a positive slope if it rises from left to right, and a line is said to have a negative slope if it falls from left to right.
In other words, a line with a positive slope looks tilted upward in the direction of the positive x-axis, and a line with a negative slope looks tilted downward in the direction of the positive x-axis.
Slopes of Different Lines
There can be various different lines that can be named, such as
- Horizontal Line & Vertical Line
- Perpendicular Lines
- Parallel Lines
Slope of Horizontal Line
The line that is parallel to the x-axis is called a horizontal line, and the slope of a horizontal line is 0, as there is no change in the y-coordinate throughout the line for any change in the x-coordinate. Since the slope of the horizontal line is zero, it is also called a zero-slope line. Thus mathematically we can represent this as
Slope of Horizontal Line = 0/change in x-coordinate = 0
Slope of Vertical Line
The line parallel to the y-axis is called a vertical line, and the slope of a vertical line is not defined, as there is no change in the x-coordinate throughout the line for any change in the y-coordinate. The vertical line is also called the undefined slope line. Thus mathematically we can represent this as
Slope of Vertical Line = Change in y-coordinate/0 = Not Defined
Slope of Perpendicular Lines
The slopes of perpendicular lines are negative reciprocals to each other, and their product is -1. In other words, if we have two lines with slopes m1 and m2, then the condition for those two lines to be perpendicular is
m1 = -1/m2
OR
m1 × m2 = -1

Slope of Parallel Lines
The slope of parallel lines is the same, as both the lines are at the same inclination with the positive x-axis. In other words, if the slope of one line is m then the slope of a line parallel to that line is also m.
Equation of Line in Slope-Intercept Form
The equation of a line in the slope-intercept form is given as follows:
y = mx + c
Where,
- m is the slope of the line
- c is the y-intercept cut by the line

Equation of Line Using Slope
If a line is passing through a point (x₁, y₁) and its slope is m, then the equation of a line is given as follows:
y - y1 = m(x - x1)
Where x and y represent all the coordinates of the line.
We can also write the same equation using the two points from which the line is passing. If the line passes through (x1, y1) and (x2, y2), then its equation is given by
\bold{y - y_1 = \frac{y_2 - y_1}{x_2 - x_1}\cdot \left(x - x_1\right)}
Example 1: Find the equation of a line given in the graph.

Solution:
Slope of the graph is, m = 8/2 = 4
and we know the equation of line passing through (x1, y1) with slope m is given by
y – y1 = m (x – x1)
Thus, equation of line (4,2) with slope 4 is
y – 2 = 4 (x – 4)
⇒ y – 2 = 4x – 16
⇒ y = 4x – 16 +2
⇒ y = 4x – 14
Example 2: Find the equation of the line given in the graph.

Solution:
Two given points (x1, y1) and (x2, y2) are A (2,3) and B (5,7)
y-y_1= \frac{(y_2-y_1)}{(x_2-x_1)}\times (x-x_1 ) ⇒ y-3= {(7 -3)/(5-2)} (x-2)
⇒
y-3= \frac{(7-3)}{(5-2)}\times(x-2) ⇒
y-3= \frac{(4)}{(3)}\times (x-2) ⇒ 3y-9 = 4x-8
⇒ 3y = 4x+1
Related Articles
Sample Problems on Slope of a Line
Problem 1: Find the slope of points (1,2) and (2,3).
Solution:
As slope is given as m = (y2 - y1)/(x2 - x1)
⇒ m = (3 - 2)/(2 - 1)
⇒ m = 1
Problem 2: Find the value of x if the slope is 2 and the points are (2,2) and (x,6).
Solution:
m = (y2 - y1)/(x2 - x1)
⇒ 2 = (6 - 2)/(x - 2)
⇒ 4 = 2(x-2)
⇒ x-2 = 2
⇒ x = 4
Problem 3: Find the value of y if the slope is 3 and the points are (2,13) and (4, y).
Solution:
m = (y2 - y1)/(x2 - x1)
⇒ 3 = (y - 13)/(4 - 2)
⇒ y - 13 = 3(2)
⇒ y - 13 = 6
⇒ y = 6 + 13 = 19
Problem 4: Find the line passing from coordinates (2,5) and the slope of a line is 5.
Solution:
Slope m = 5
y – y1= m (x – x1)
We know slope m = 5 and point (x1, y1) = (2,5)
Now putting these value in equation
⇒ y – 5 = 5 x (x – 2)
⇒ y – 5 = 5x – 10
⇒ y = 5x – 10 + 5
⇒ y = 5x -5
Practice Questions of Slope of a Line
Problem 1: Find the slope of points (3, 4) and (5, 7).
Problem 2: Find the value of x if the slope is -1 and the points are (x, 4) and (2, 6).
Problem 3: Find the value of y if the slope is 2 and the points are (1, y) and (3, 8).
Problem 4: Find the equation of the line passing through the coordinates (4, 6) with a slope of -2.