Math

Distance Calculator

Calculate the distance between two points in 2D or 3D space, plus midpoint coordinates and slope (2D).

How to use this calculator

👉 Fill in the boxes below and your answer appears instantly — no maths needed, we do it all for you! 🎉

👶

In plain English — what does this do?

🔢 This tool does the maths for you! Just type in your numbers, and it gives you the answer right away. No need to count on your fingers or use a pen and paper.

📌 Direct Answer & Summary

The distance calculator finds the straight-line (Euclidean) distance between two points using the distance formula derived from the Pythagorean theorem. It supports both 2D (x, y) and 3D (x, y, z) coordinate systems, and also returns the midpoint and slope for 2D.

What is Distance Calculator?

The distance calculator finds the straight-line (Euclidean) distance between two points using the distance formula derived from the Pythagorean theorem. It supports both 2D (x, y) and 3D (x, y, z) coordinate systems, and also returns the midpoint and slope for 2D.

How to use it

  1. 1️⃣ Select 2D or 3D mode.
  2. 2️⃣ Enter the coordinates for the first point.
  3. 3️⃣ Enter the coordinates for the second point.
  4. 4️⃣ Click Calculate to get the distance, midpoint, and slope (2D only).
  5. 5️⃣ All coordinate inputs accept negative and decimal values.

Formula

2D distance = √((x₂−x₁)²+(y₂−y₁)²). 3D distance = √((x₂−x₁)²+(y₂−y₁)²+(z₂−z₁)²). Midpoint 2D = ((x₁+x₂)/2, (y₁+y₂)/2). Slope m = (y₂−y₁)/(x₂−x₁).

💡 See it in action — a real example

2D points (1,2) and (4,6): distance = √((4−1)²+(6−2)²) = √(9+16) = √25 = 5. Midpoint = (2.5, 4). Slope = 4/3 ≈ 1.333.

❓ Common questions

What is Euclidean distance?
Euclidean distance is the straight-line distance between two points in space, named after Greek mathematician Euclid. It is the most common distance metric and generalizes to any number of dimensions.
How is 3D distance different from 2D?
3D distance adds a third dimension (z-axis) under the square root. The formula is √((x₂−x₁)²+(y₂−y₁)²+(z₂−z₁)²), a direct extension of the Pythagorean theorem.
Can distance be negative?
No. Distance is always a non-negative value. It represents the magnitude of the displacement between two points.
What is the difference between distance and displacement?
Distance is a scalar (magnitude only). Displacement is a vector (magnitude and direction). This calculator computes scalar distance.
What units does this calculator use?
The calculator is unit-agnostic. The result is in whatever units your coordinates represent — meters, kilometers, pixels, etc.
🧩

Embed Distance Calculator

Copy & paste this snippet into your website HTML, blog post, or WordPress site to display this interactive calculator widget:

Widget Attribution Link: allcalcihub.com