Skip to main content

Distance Formula Calculator

Calculate distance between two points in 2D or 3D.

Reviewed for accuracy by the Math Ora X team Last updated

Result

About Distance Formula Calculator

Distance formula derives from the Pythagorean theorem. In 3D: d = √((x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²).

$$d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}$$

How to use this calculator

  1. Enter the coordinates of the first point.
  2. Enter the coordinates of the second point.
  3. Choose 2D or 3D based on the points you have.
  4. Click calculate to see the distance and the formula used.

The formula explained

$$ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \text{ in 2D}, \quad d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \text{ in 3D} $$

  • \(d\) = distance between the two points
  • \(x_1\) = first point x-coordinate
  • \(y_1\) = first point y-coordinate
  • \(z_1\) = first point z-coordinate in 3D
  • \(x_2\) = second point x-coordinate
  • \(y_2\) = second point y-coordinate
  • \(z_2\) = second point z-coordinate in 3D

Step by step method

  1. Find the difference in each matching coordinate between the two points.
  2. Square each difference so negative values do not cancel out.
  3. Add the squared differences together, then take the square root of the sum.
  4. Read the result as the straight-line distance between the points.

Worked example

Suppose you want to find the straight-line distance between the points (2, 3) and (8, 15) in 2D.

  1. Use the 2D formula \(d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\).
  2. Substitute the values: \(d = \sqrt{(8 - 2)^2 + (15 - 3)^2}\).
  3. Compute the differences and squares: \(d = \sqrt{6^2 + 12^2} = \sqrt{36 + 144} = \sqrt{180}\).

Answer. The distance is \(\sqrt{180}\), which is about 13.42 units.

Tips and common mistakes

  • Make sure you match x with x, y with y, and z with z.
  • Use the 3D version only when both points have a z-coordinate.
  • Do not forget to square each coordinate difference before adding them.
  • The answer is a straight-line distance, not a path distance along axes.

Frequently asked questions

Can I use this for 3D points?+

Yes. If both points have x, y, and z coordinates, the calculator uses the 3D distance formula. If your points are only in a plane, use the 2D version instead.

What if one coordinate is negative?+

That is fine. The formula handles negative values correctly because it uses differences and then squares them. The final distance is always nonnegative.

Why is the result sometimes a decimal?+

The square root of the squared coordinate differences is not always a whole number. In those cases, the calculator gives an exact form and a decimal approximation if needed.

Is this the same as measuring along a grid or map path?+

No. This tool gives the direct straight-line distance between two points. It does not measure travel distance along roads, edges, or a grid route.

More Coordinate Geometry Tools

Explore related calculators in this category

You Might Also Like

Popular tools from other categories

Can't Find the Right Calculator?

Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.

Try AI Solver

Browse All Categories

Home Coordinate Geometry Current Tool
Facebook Twitter WhatsApp