Loona Calculators
Loona Calculators › Maths › Slope Calculator

📉 Slope Calculator

Enter two points (x₁, y₁) and (x₂, y₂) to get everything about the line between them: slope, distance, midpoint, angle and the equation y = mx + b — with each formula's substitution shown.

Quick answer: Slope = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 8): slope = 6 ÷ 3 = 2, distance = √(3² + 6²) = √45 ≈ 6.71, and the midpoint is (2.5, 5).

How to use the Slope Calculator

  1. Enter the coordinates of the first point.
  2. Enter the coordinates of the second point.
  3. Read the slope, distance, midpoint and the line's equation.
Example: Points (1, 2) and (4, 8): slope 2, distance √45 ≈ 6.708, midpoint (2.5, 5), and the line equation y = 2x + 0 — it passes through the origin, which you can check: at x = 1, y = 2 ✓.

Frequently Asked Questions

What does a slope of 2 mean?

For every 1 unit you move right, the line rises 2 units. A slope of 0 is flat, a negative slope falls to the right, and an undefined slope (division by zero) is a vertical line.

How is distance between two points calculated?

With Pythagoras: distance = √((x₂ − x₁)² + (y₂ − y₁)²). The coordinate differences are the two legs of a right triangle and the distance is its hypotenuse.

What is the midpoint formula?

Average the coordinates: midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). It is the point exactly halfway along the segment.

What if both x values are the same?

The line is vertical: slope is undefined and there is no y = mx + b equation. The calculator reports the vertical line x = that value, plus the distance and midpoint as normal.

Related Calculators

%

Percentage Calculator

Maths

📊

Statistics Calculator

Maths

½

Fraction Calculator

Maths

🧮

Equation Solver

Maths

🔬

Scientific Calculator

Maths

📐

Average Calculator

Maths

📈

Graphing Calculator

Maths

How it works — the formula

Slope: m = (y₂ − y₁) ÷ (x₂ − x₁). Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). Line equation: using point 1, b = y₁ − m·x₁, giving y = mx + b. Angle: θ = arctan(m), in degrees from the positive x-axis.

Worked example

Inputs: (1, 2) and (4, 8).

Steps: Slope = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. Distance = √((4−1)² + (8−2)²) = √(9 + 36) = √45 = 6.708. Midpoint = ((1+4)÷2, (2+8)÷2) = (2.5, 5). Intercept: b = 2 − 2×1 = 0, so the line is y = 2x.

Result: Slope 2, distance 6.708, midpoint (2.5, 5), equation y = 2x.

Embed this calculator on your website — free

Add this calculator to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the calculator to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.