Slope Calculator
Use this free Slope Calculator to find the slope of a straight line from two coordinate points. Enter the X and Y coordinates to calculate the slope, angle, distance between the points, percentage grade, Y-intercept, and equation of the line.
You can also start from one known point and a slope, angle, or percentage grade, then use a horizontal change to calculate another point on the line. In Two Points mode, you can lock known coordinates and edit the slope, angle, or percentage grade to solve one missing coordinate.
How to Use the Slope Calculator
The calculator offers two ways to define a straight line.
Method 1: Two Points
Use this method when you know two points on the line.
- Enter Point 1. Provide the X₁ and Y₁ coordinates.
- Enter Point 2. Provide the X₂ and Y₂ coordinates.
- Review the results. The calculator returns the slope, angle, distance, percentage grade, horizontal change, vertical change, Y-intercept, and line equation.
- Use the coordinate graph. The graph shows both points, the line through them, the horizontal and vertical changes, and the x and y axes.
Coordinates may be positive, negative, zero, or decimal. Both axes belong to the same Cartesian system. The calculator does not apply separate physical units. Distance is reported in coordinate units.
Method 2: Point and Slope
Use this method when you know one point and the direction of the line, and you want another point.
- Enter the known point. Provide its X and Y coordinates.
- Choose one line definition. Select Slope, Angle, or Percentage Grade.
- Enter that value. Provide the slope, the angle in degrees, or the percentage grade.
- Enter the horizontal change. ΔX is the signed change from the first point to the second point.
- Read the results. The calculator finds Point 2 and the same set of line properties used in Two Points mode.
ΔX may be positive or negative. It cannot be zero. The angle must be greater than -90° and less than 90°. This mode does not accept a vertical line as a finite slope.
What Is Slope?
Slope describes how steep a straight line is and whether it rises or falls from left to right. It is the vertical change divided by the horizontal change between two points.
- A positive slope means the line rises from left to right.
- A negative slope means the line falls from left to right.
- A slope of 0 is a horizontal line.
- A vertical line has an undefined slope.
A larger absolute value is a steeper line. A slope of 2 is steeper than a slope of 0.5. A slope of -2 is steeper than a slope of -0.5.
Slope Formula
For two points (x₁, y₁) and (x₂, y₂):
ΔX = x₂ − x₁
ΔY = y₂ − y₁
m = ΔY / ΔX
This applies when ΔX is not zero.
Example: Slope Between (3, 4) and (6, 8)
Point 1 = (3, 4)
Point 2 = (6, 8)
ΔX = 6 − 3 = 3
ΔY = 8 − 4 = 4
Slope = 4 / 3 = 1.333333
The displayed slope 1.333333 is the six-decimal form of 4/3. For every 1 unit of horizontal movement to the right, the line rises 1.333333 units.
The same points also give:
- Angle = 53.130102°
- Distance = 5
- Percentage Grade = 133.333333%
- Y-intercept = 0
- Line equation: y = 1.333333x
Positive, Negative, Zero, and Undefined Slope
The sign comes from ΔX and ΔY. When they have the same sign, the slope is positive. When they have opposite signs, the slope is negative.
Positive Slope
Point 1 = (1, 2)
Point 2 = (4, 8)
ΔX = 3
ΔY = 6
Slope = 6 / 3 = 2
Angle = 63.434949°
Percentage Grade = 200%
Y-intercept = 0
Line equation: y = 2x
The line rises from left to right.
Negative Slope
Point 1 = (1, 5)
Point 2 = (4, -1)
ΔX = 3
ΔY = -6
Slope = -6 / 3 = -2
Angle = -63.434949°
Distance = 6.708204
Percentage Grade = -200%
Y-intercept = 7
Line equation: y = -2x + 7
The line falls from left to right. The negative sign is part of the result.
Zero Slope
Point 1 = (2, 5)
Point 2 = (8, 5)
ΔX = 6
ΔY = 0
Slope = 0
Angle = 0°
Percentage Grade = 0%
Distance = 6
Y-intercept = 5
Line equation: y = 5
The line is horizontal.
Undefined Slope
Point 1 = (3, 4)
Point 2 = (3, 8)
ΔX = 0
ΔY = 4
The slope formula would divide by zero, so the slope is undefined. The percentage grade and Y-intercept are not defined either.
Distance = 4
Angle = 90°
Line equation: x = 3
The calculator shows 90° for a vertical line. It does not display -90° when the second point is below the first. A vertical line cannot be entered as a finite slope in Point and Slope mode.
Identical Points
Point 1 = (3, 4)
Point 2 = (3, 4)
ΔX = 0 and ΔY = 0. The distance is 0. These points do not determine one straight line, so the slope, angle, percentage grade, Y-intercept, and line equation are undefined. Identical points are not treated as a horizontal or vertical line.
Slope Angle
The angle is the inclination of the line from the positive horizontal direction.
Angle = arctan(m) × 180 / π
For the points (3, 4) and (6, 8):
Angle = arctan(4 / 3) × 180 / π = 53.130102°
A positive slope gives a positive angle. A negative slope gives a negative angle. For a finite slope, the angle is greater than -90° and less than 90°. A vertical line is reported separately as 90°.
In Point and Slope mode, an entered angle must also be greater than -90° and less than 90°. The calculator converts it with:
m = tan(Angle × π / 180)
The displayed angle 63.434949° converts back to a slope of 2.
Percentage Grade
Percentage grade is the slope written as a percentage.
Percentage Grade = m × 100
Slope = 1.333333 gives 133.333333%.
Slope = -2 gives -200%.
The result may be negative and may be greater than 100%. In Point and Slope mode, a percentage is converted back to a slope by dividing by 100. For example, 200% is a slope of 2, and -50% is a slope of -0.5.
Distance Between Two Points
Distance = √(ΔX² + ΔY²)
For (3, 4) and (6, 8):
Distance = √(3² + 4²) = √(9 + 16) = √25 = 5
The result is in the same coordinate units as the input. If both coordinates were measured in meters, the distance is 5 meters. The calculator does not convert between meters, feet, or other units.
For (1, 5) and (4, -1), the distance is 6.708204.
Y-Intercept and Line Equation
A nonvertical line can be written as:
y = mx + b
The Y-intercept is:
b = y₁ − m × x₁
For (3, 4) and (6, 8), the slope is 4/3, displayed as 1.333333:
b = 4 − 1.333333 × 3 = 0
Line equation: y = 1.333333x
When the displayed intercept is 0, the equation omits the constant term. A displayed slope of 1 is written as x, and a displayed slope of -1 is written as -x.
For (3, 4), slope 2, and ΔX 3, Point 2 is (6, 10) and the equation is:
y = 2x − 2
A vertical line has no Y-intercept. Its equation is x = c, where c is the shared X coordinate. The vertical line through X = 3 is x = 3.
Find Another Point from a Slope, Angle, or Grade
Point and Slope mode uses one known point, one line definition, and ΔX.
X₂ = X₁ + ΔX
Y₂ = Y₁ + m × ΔX
Slope is used directly. An angle is converted with m = tan(Angle × π / 180). A percentage grade is converted with m = Percentage Grade / 100.
Example: Point, Slope, and Horizontal Change
Point 1 = (3, 4)
Slope = 2
ΔX = 3
X₂ = 3 + 3 = 6
Y₂ = 4 + 2 × 3 = 10
Point 2 = (6, 10)
The calculator then reports:
- Slope = 2
- Angle = 63.434949°
- Distance = 6.708204
- ΔY = 6
- Percentage Grade = 200%
- Y-intercept = -2
- Line equation: y = 2x − 2
A negative ΔX moves Point 2 to the left of Point 1. A slope of 0 keeps the same Y coordinate, so the line is horizontal.
Solve One Coordinate from a Target Slope
In Two Points mode, Slope, Angle, and Percentage Grade are three ways to state one target. Edit one of them. The calculator converts that entry to a slope and changes only the first solvable unlocked coordinate, in this order:
X₁ → Y₁ → X₂ → Y₂
Locked coordinates stay as they are. If the target cannot be reached, every coordinate stays at its previous value.
Start with:
Point 1 = (3, 4)
Point 2 = (6, 8)
The current slope is 1.333333. Change the target slope to 2.
- With every coordinate unlocked, X₁ changes from 3 to 4. The points become
(4, 4)and(6, 8). - With X₁ locked, Y₁ changes from 4 to 2. The points become
(3, 2)and(6, 8). - With X₁ and Y₁ locked, X₂ changes from 6 to 5.
- With X₁, Y₁, and X₂ locked, Y₂ changes from 8 to 10.
- With all four coordinates locked, nothing changes.
Each of the first two results has slope 2 and the equation y = 2x − 4.
A target slope of 0 cannot be solved by dividing to find an X coordinate. The calculator skips the X fields and changes a Y coordinate so both points have the same height. From (3, 4) and (6, 8), that changes Y₁ from 4 to 8.
A target angle must be greater than -90° and less than 90°. A target percentage may be negative or greater than 100%. The calculator divides the percentage by 100 before solving. A target of 200% is the same slope as 2.
Coordinate Graph
The graph uses one scale for both axes, so the slope you see matches the calculated slope. It shows:
- The x-axis and y-axis, labeled
xandyat their positive ends. - Point 1 and Point 2, labeled in the form
Point 1 (3, 4)andPoint 2 (6, 8). - The line through the points.
- The horizontal change, ΔX, and the vertical change, ΔY.
- The slope.
- An angle mark when the angle can be shown clearly.
ΔX and ΔY are the perpendicular sides of a right triangle. The segment between the points is the hypotenuse. The graph follows the current result, including Point and Slope mode, horizontal lines, vertical lines, and identical points. Identical points are drawn as one point, without a line.
Frequently Asked Questions
How do I calculate the slope between two points?
Subtract the X coordinates to get ΔX. Subtract the Y coordinates to get ΔY. Divide ΔY by ΔX.
Slope = (y₂ − y₁) / (x₂ − x₁)
What does a slope of 1 mean?
The vertical change equals the horizontal change. The angle is 45°, and the percentage grade is 100%.
What does a slope of 0 mean?
The line is horizontal. The Y coordinate stays constant, the angle is 0°, and the percentage grade is 0%.
Can a slope be negative?
Yes. A negative slope falls from left to right. For (1, 5) and (4, -1), the slope is -2, the angle is -63.434949°, and the percentage grade is -200%.
Why is the slope of a vertical line undefined?
Both points have the same X coordinate, so ΔX is 0. The slope formula would divide by zero. The calculator reports the slope as undefined, the angle as 90°, and the equation as x = c.
What happens if two points are identical?
The distance is 0. One repeated point does not define a unique line, so the slope, angle, percentage grade, Y-intercept, and line equation are undefined.
How do I find the angle from the slope?
Angle = arctan(m) × 180 / π
For a slope of 4/3, the calculator displays 53.130102°. Finite slopes use an angle greater than -90° and less than 90°.
Is slope the same as percentage grade?
They describe the same tilt in different units. Percentage Grade = Slope × 100. A slope of 0.5 is a grade of 50%. A slope of 2 is a grade of 200%.
How do I find the Y-intercept?
For a nonvertical line:
b = y₁ − m × x₁
The line is y = mx + b. A vertical line uses x = c and has no Y-intercept.
How do I calculate the distance between two points?
Distance = √[(x₂ − x₁)² + (y₂ − y₁)²]
For (3, 4) and (6, 8), the distance is 5 coordinate units.
Can I find a second point from a slope?
Yes. In Point and Slope mode, enter the known point, choose slope, angle, or percentage grade, and enter a nonzero ΔX. For (3, 4), slope 2, and ΔX 3, Point 2 is (6, 10).
Can I keep some coordinates fixed while changing the slope?
Yes. In Two Points mode, lock the coordinates that must stay unchanged, then edit the slope, angle, or percentage grade. The calculator changes only the first unlocked coordinate it can solve, in the order X₁, Y₁, X₂, Y₂.
Calculate a Line with the Slope Calculator
Enter two points to calculate the slope, angle, distance, percentage grade, Y-intercept, and line equation. Or enter one point, a slope, angle, or percentage grade, and a horizontal change to find the second point.
The coordinate graph shows the points, the line, and the horizontal and vertical changes on equal X and Y scales. In Two Points mode, lock the known coordinates and edit one target value to solve a single missing coordinate.