MaximCalculator Free, fun & accurate calculators
📐 Platinum math layout
🌙Dark Mode

Distance Formula Calculator

Use this free Distance Formula Calculator to find the distance between two points in 2D (coordinate plane) or 3D space. It shows the exact distance (radical form when possible), a decimal approximation, and the step-by-step substitution so you can learn or check homework fast.

🧮2D + 3D distance
Step-by-step work
🔎Exact + decimal result
📱Great for screenshots

Enter two points

Choose 2D or 3D, then enter coordinates. For 2D, you only need x and y. For 3D, add z.

🧭
🔢
Your distance result will appear here
Enter coordinates and tap “Calculate Distance”.
Tip: Use decimals or fractions (like 1.5) — everything is calculated in your browser.
Visual meter: the bar grows as the distance gets larger (relative to your inputs).
ShortMediumLong

Educational calculator: always show your steps if your teacher requires work.

📚 Formula breakdown

The Distance Formula (2D and 3D)

The distance formula is one of the most useful tools in coordinate geometry. It tells you the straight-line distance between two points. If you’ve learned the Pythagorean theorem (a² + b² = c²), the distance formula is basically the same idea — just applied to coordinate differences.

2D distance

For two points A(x₁, y₁) and B(x₂, y₂), first compute the horizontal and vertical changes:

  • Δx = x₂ − x₁
  • Δy = y₂ − y₁

These become the legs of a right triangle. The distance (the hypotenuse) is: d = √(Δx² + Δy²) = √((x₂−x₁)² + (y₂−y₁)²).

3D distance

In 3D, points are A(x₁, y₁, z₁) and B(x₂, y₂, z₂). You do the same thing, but add the depth change:

  • Δx = x₂ − x₁
  • Δy = y₂ − y₁
  • Δz = z₂ − z₁

The 3D distance is: d = √(Δx² + Δy² + Δz²).

Why it works

In 2D, the coordinate differences (Δx and Δy) form a right triangle when you draw a horizontal line from one point and a vertical line to the other. The Pythagorean theorem says the squared distance equals the sum of squares of the legs. In 3D, you can apply the 2D result twice: first find the distance in the x–y plane, then combine that with Δz using the Pythagorean theorem again.

Exact vs decimal

Many textbook problems want the exact answer (like √13) rather than a rounded decimal. This calculator shows both so you can pick the format your class expects.

🧪 Examples

Distance formula examples (fully worked)

Here are three examples you can follow step-by-step. Try typing them into the calculator above and compare your work.

Example 1 (2D): A(2, −1), B(8, 3)
  • Δx = 8 − 2 = 6
  • Δy = 3 − (−1) = 4
  • d = √(6² + 4²) = √(36 + 16) = √52 = √(4·13) = 2√13
  • Decimal ≈ 7.2111
Example 2 (2D): A(−3, 5), B(1, −7)
  • Δx = 1 − (−3) = 4
  • Δy = −7 − 5 = −12
  • d = √(4² + (−12)²) = √(16 + 144) = √160 = √(16·10) = 4√10
  • Decimal ≈ 12.6491
Example 3 (3D): A(1, 2, 3), B(4, −2, 9)
  • Δx = 4 − 1 = 3
  • Δy = −2 − 2 = −4
  • Δz = 9 − 3 = 6
  • d = √(3² + (−4)² + 6²) = √(9 + 16 + 36) = √61
  • Decimal ≈ 7.8102
Common mistake to avoid

The #1 mistake is forgetting parentheses with negatives. For example, y₂ − y₁ = −7 − 5 is −12 (not −2). Always plug negatives in parentheses.

🧭 How it works

What this calculator does (behind the scenes)

This page uses a simple sequence of steps that mirrors what you’d write by hand. When you press Calculate Distance, the calculator:

  • Reads your coordinates and checks that all required fields are filled.
  • Computes coordinate differences: Δx, Δy (and Δz for 3D).
  • Squares each difference and adds them up.
  • Takes a square root to get the distance.
  • Tries to simplify the square root (for exact form) when the result is a clean radical.
  • Formats the decimal result to your selected number of decimals.
Why show steps?

A “just the answer” calculator is useful, but it can hide where errors happen. The step display makes it easy to spot issues like swapped points, sign mistakes, or missing parentheses. It’s also great for learning because you can compare your worksheet to the exact same arithmetic.

When the radical simplifies

If the sum under the square root has a perfect square factor, the radical simplifies. Example: √52 becomes 2√13 because 52 = 4·13. If the number under the root is prime (like 61), it can’t be simplified, so the exact form stays √61.

Units note

The distance formula is unit-agnostic — if your coordinates are in meters, the distance is in meters. If your coordinates are in miles, the distance is in miles. Just keep your axes consistent.

❓ FAQ

Distance formula FAQs

  • Is the distance formula the same as the Pythagorean theorem?

    Yes — it’s the Pythagorean theorem applied to coordinate differences. The legs of the triangle are Δx and Δy, so the hypotenuse is √(Δx² + Δy²).

  • What’s the fastest way to avoid sign mistakes?

    Always subtract in the same order (x₂ − x₁, y₂ − y₁) and put negatives in parentheses before subtracting. Then square the differences — the squared values are always nonnegative.

  • Can distance ever be negative?

    No. Distance represents length, and length is never negative. The square root of a sum of squares is always ≥ 0.

  • Do I need absolute values?

    Not for the distance formula. Squaring removes negative signs automatically. For example, (−4)² = 16.

  • How do I know if the radical can simplify?

    Factor the number under the root and look for perfect squares (4, 9, 16, 25, ...). If you can pull out a perfect square, it simplifies. This calculator does that for common cases.

  • What if I’m working with fractions?

    You can enter decimals (like 0.5 for 1/2). For exact fraction work, you’d do the same steps by hand with fractions, but the formula stays identical.

  • When should I use 3D distance?

    Use 3D when points have x, y, and z coordinates — like in physics problems, 3D graphs, CAD models, or measuring movement in space.

🔥 Viral study hack

Make this go viral (without being cringe)

The distance formula is “math viral” when it’s packaged as a quick challenge. Try this: pick two random points, screenshot the exact radical + decimal result, and post “Who can solve it faster: mental math vs calculator?” Then reveal the steps. Students love seeing the clean substitution and simplification.

  • Use the Save Result button to store a few challenges.
  • Post a screenshot of the result box (it’s designed for that).
  • Challenge friends: “Simplify √(Δx²+Δy²) before I hit Calculate.”

Tip for teachers/parents: this page is designed to be transparent — it shows the exact substitution and simplification so it supports learning rather than hiding work.