Free Tools · Math & School
Slope Calculator
Enter two points to get the slope as a reduced fraction and a decimal, the equation of the line in three forms, and a quick graph — with every step shown.
Slope (m)
2/3 ≈ 0.6667
Rising left to right
- Rise / run
- 4 / 6
- Slope-intercept form
- y = (2/3)x + 7/3
- Point-slope form
- y − 1 = 2/3(x + 2)
- Standard form
- 2x − 3y = −7
- y-intercept
- 7/3 ≈ 2.3333 (0, 7/3)
- x-intercept
- (−7/2, 0)
- Angle of inclination
- 33.69°
- Distance between points
- √52 ≈ 7.2111
- Midpoint
- (1, 3)
Steps
- Rise = y₂ − y₁ = 5 − (1) = 4
- Run = x₂ − x₁ = 4 − (−2) = 6
- m = rise ÷ run = 4 ÷ 6 = 2/3
- b = y₁ − m·x₁ = 1 − (2/3)(−2) = 7/3
- Distance = √(run² + rise²) = √52 ≈ 7.2111
- Midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2) = (1, 3)
- Angle = arctan(2/3) ≈ 33.6901°
How the slope calculator works
Given two points (x₁, y₁) and (x₂, y₂), the calculator finds the rise (change in y) and the run (change in x), then divides:
m = (y₂ − y₁) ÷ (x₂ − x₁)
All the arithmetic is done with exact fractions, so 4/6 becomes 2/3 rather than 0.666… From the slope, it builds the rest:
- y-intercept: b = y₁ − m·x₁ (where the line crosses the y-axis)
- Distance: √((x₂ − x₁)² + (y₂ − y₁)²), the Pythagorean theorem
- Midpoint: ((x₁ + x₂)/2, (y₁ + y₂)/2)
- Angle of inclination: arctan(m), in degrees
Slope-intercept form: y = mx + b
Slope-intercept form shows the slope and y-intercept directly, which makes it the easiest form to graph: start at (0, b) and move "run" units right and "rise" units up.
Point-slope form: y − y₁ = m(x − x₁)
Point-slope form is the quickest way to write an equation when you know one point and the slope — no need to find b first. Use the Point + slope → equation tab to turn a point and a slope into all three forms.
Standard form: Ax + By = C
Standard form uses whole-number coefficients with A ≥ 0. It's handy for finding both intercepts and for solving systems of equations, and it's the only form that can describe a vertical line along with every other line.
Horizontal and vertical lines
If y₁ = y₂ the rise is 0, the slope is 0 and the line is horizontal: y = b. If x₁ = x₂ the run is 0, division is impossible, and the slope is undefined: the line is vertical, x = x₁.
Worked examples
Example 1: Slope through (−2, 1) and (4, 5)
Rise = 5 − 1 = 4 and run = 4 − (−2) = 6, so m = 4/6 = 2/3 ≈ 0.6667. Then b = 1 − (2/3)(−2) = 1 + 4/3 = 7/3, giving y = (2/3)x + 7/3. In point-slope form that's y − 1 = 2/3(x + 2), and in standard form 2x − 3y = −7. The distance is √(6² + 4²) = √52 ≈ 7.2111, the midpoint is (1, 3), and the angle is about 33.69°.
Example 2: Slope through (2, 3) and (6, 11)
m = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2. b = 3 − 2·2 = −1, so the line is y = 2x − 1 (standard form 2x − y = 1). The points are √(4² + 8²) = √80 ≈ 8.9443 apart, with midpoint (4, 7).
Example 3: Point (1, −2) with slope 3/4
Point-slope form is y + 2 = 3/4(x − 1). Solving for b: b = −2 − (3/4)(1) = −11/4, so y = (3/4)x − 11/4. Multiplying by 4 gives 4y = 3x − 11, or 3x − 4y = 11 in standard form. Check: 3(1) − 4(−2) = 3 + 8 = 11 ✓.
Frequently asked questions
What is the formula for slope?
Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). It tells you how much y changes for every 1-unit step in x. It doesn't matter which point you call the first one, as long as you subtract in the same order on top and bottom.
What does an undefined slope mean?
When both points have the same x-value, the run is 0 and you would have to divide by zero, so the slope is undefined. The line is vertical, and its equation is simply x = (that x-value). A vertical line has no slope-intercept form.
What's the difference between zero slope and undefined slope?
A zero slope means the line is horizontal: y never changes, and the equation is y = b. An undefined slope means the line is vertical: x never changes. Zero slope is a perfectly good number; undefined slope isn't a number at all.
How do I convert slope-intercept form to standard form?
Start with y = mx + b, move the x-term to the left side, and multiply through by the denominators to clear fractions. For y = (2/3)x + 7/3, multiply by 3 to get 3y = 2x + 7, then rearrange to 2x − 3y = −7. By convention A is made non-negative and A, B and C share no common factor.
Can I enter fractions or decimals?
Yes. Type whole numbers, decimals like 1.5, fractions like 3/4 or mixed numbers like 1 1/2. The calculator works with exact fractions internally, so the slope is reduced to lowest terms instead of being rounded.
How is slope related to the angle of a line?
The slope equals the tangent of the angle the line makes with the positive x-axis, so the angle is arctan(m). A slope of 1 is 45°, a slope of 0 is 0°, and negative slopes give negative angles (the line falls to the right).