Skip to calculator
Calculate This

Slope Calculator

Enter two points to find the slope (rise over run), the y-intercept and the line's equation in slope-intercept, point-slope and standard form, plus the angle, distance and midpoint — all shown step by step.

Defaults to your region. Switch to compare any other scale.

Point 1 (x₁, y₁)

Point 2 (x₂, y₂)

Result

3/2 = 1.5

Slope m

y = (3/2)x − 2

  • Run Δx and rise ΔyΔx = 6 − 2 = 4, Δy = 7 − 1 = 6
  • Slope = rise ÷ runm = 6 ÷ 4 = 3/2
  • Slope as a decimal1.5
  • Grade (%)150%
  • Y-intercept bb = 1 − 3/2 × 2 = −2
  • Slope-intercept formy = (3/2)x − 2
  • Same with decimalsy = 1.5x − 2
  • Point-slope formy − 1 = (3/2)(x − 2)
  • Standard form3x − 2y = 4
  • X-intercept(4/3, 0)
  • Angle of inclination θarctan(3/2) = 56.31° (0.9828 rad)
  • Distance between the points√(4² + 6²) = √52 = 2√13 ≈ 7.2111
  • Midpoint((2 + 6) ÷ 2, (1 + 7) ÷ 2) = (4, 4)

Rising line

For every 1 unit to the right, y goes up by 3/2 (1.5).

About this tool

How the slope is found: the slope of the line through (x₁, y₁) and (x₂, y₂) is the rise divided by the run, m = (y₂ − y₁) ÷ (x₂ − x₁). For (2, 1) and (6, 7) that is 6 ÷ 4 = 3/2: the line climbs 1.5 units for every unit to the right. The calculator keeps exact fractions, so decimals such as 0.1 and 0.4 give clean results without rounding noise.

The equation of the line: the y-intercept is b = y₁ − m·x₁, so the slope-intercept form is y = mx + b (here y = (3/2)x − 2). The point-slope form y − y₁ = m(x − x₁) uses one of your points directly, and the standard form Ax + By = C uses whole numbers (3x − 2y = 4). A horizontal line has slope 0 (y = c); a vertical line has an undefined slope because Δx = 0, and its equation is x = c.

Angle, distance and midpoint: the angle of inclination is θ = arctan(m), measured from the positive x-axis; the distance is √(Δx² + Δy²) by Pythagoras, simplified as a surd when possible (√52 = 2√13); the midpoint is the average of the coordinates. For other school maths try the ratio calculator and the statistics calculator; for coursework marks see the grade calculator and the GPA calculator.

Formula

  • m = (y₂ − y₁) ÷ (x₂ − x₁)
  • b = y₁ − m·x₁ → y = mx + b
  • Point-slope: y − y₁ = m(x − x₁)
  • θ = arctan(m)
  • d = √((x₂ − x₁)² + (y₂ − y₁)²)
  • M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
  • Vertical line (x₁ = x₂): slope undefined, x = x₁

How it is calculated

  1. Enter the coordinates of two points (negative numbers and decimals are fine).
  2. Find the run Δx = x₂ − x₁ and the rise Δy = y₂ − y₁.
  3. Divide: m = Δy ÷ Δx, reduced to a fraction in lowest terms. If Δx = 0 the line is vertical and the slope is undefined.
  4. Put one point into b = y₁ − m·x₁ to get the y-intercept and write y = mx + b, the point-slope form and the standard form.
  5. Read the angle θ = arctan(m), the distance √(Δx² + Δy²) and the midpoint.

Questions

How do you find the slope from two points?

Subtract the y-values and the x-values in the same order and divide: m = (y₂ − y₁) ÷ (x₂ − x₁). For (2, 1) and (6, 7): (7 − 1) ÷ (6 − 2) = 6 ÷ 4 = 3/2 = 1.5.

How do I write the equation of the line?

Find b = y₁ − m·x₁ and write y = mx + b. With m = 3/2 and the point (2, 1): b = 1 − 3/2 × 2 = −2, so y = (3/2)x − 2. The point-slope form y − 1 = (3/2)(x − 2) and the standard form 3x − 2y = 4 describe the same line.

What is the slope of a vertical or horizontal line?

A horizontal line has Δy = 0, so its slope is 0 and its equation is y = c. A vertical line has Δx = 0; dividing by zero is impossible, so its slope is undefined (not infinite and not 0) and its equation is x = c.

How do I turn a slope into an angle or a percentage grade?

The angle is θ = arctan(m): a slope of 1 is 45°, a slope of 3/2 is about 56.31°. The grade in percent is m × 100, so 3/2 is a 150 % grade and a road with a 10 % grade has slope 0.1 (about 5.71°).

Why does the calculator show fractions?

Homework and exams usually expect exact answers such as m = 2/3 or b = −7/3, not 0.6667. The calculator computes with exact fractions, reduces them to lowest terms and shows the decimal next to them, so both forms are always available.

Sources

Related calculators