Distance Between Two Points Calculator

The distance between two points (x₁, y₁) and (x₂, y₂) is calculated using the Euclidean formula: d = √((x₂ - x₁)² + (y₂ - y₁)²). For 3D, add (z₂ - z₁)² under the radical. Example: (0,0) to (3,4) = 5. Manhattan distance sums absolute differences: |3| + |4| = 7.

Calculate the distance between two points in 2D or 3D space. Computes Euclidean (straight-line) and Manhattan (taxicab) distances with step-by-step solutions and formulas.

Works OfflineDark ModeNo Ads

Enter coordinates for two points to calculate the Euclidean and Manhattan distance between them.

Euclidean: d = √((x₂-x₁)² + (y₂-y₁)²)

Point 1

Point 2

Presets:

Worked Examples

1. Distance from (0, 0) to (3, 4)

Problem: Find the straight-line distance between the origin and point (3, 4).

d = ((3 - 0)² + (4 - 0)²)
d = (9 + 16)
d = (25)
d = 5

This is the classic 3-4-5 Pythagorean triple

2. 3D Distance from (1, 2, 3) to (4, 6, 3)

Problem: Find the Euclidean distance between two points in 3D space.

d = ((4 - 1)² + (6 - 2)² + (3 - 3)²)
d = (9 + 16 + 0)
d = (25)
d = 5

Switch to 3D mode and enter these coordinates to verify

3. Manhattan vs Euclidean: (-1, -1) to (2, 3)

Problem: Compare both distance metrics between two points.

Euclidean: d = ((2-(-1))² + (3-(-1))²) = (9+16) = 5
Manhattan: d = |2-(-1)| + |3-(-1)| = 3 + 4 = 7

Manhattan distance is always Euclidean distance

Distance Formulas

Euclidean Distance (Straight Line)

d = ((x - x)² + (y - y)²)

The shortest path between two points. Extends to 3D by adding (z - z)² under the radical.

Manhattan Distance (Taxicab / City Block)

d = |x - x| + |y - y|

Distance along axes only (like walking city blocks). Always Euclidean distance.

Common Distance Reference

Point 1Point 2EuclideanManhattan
(0, 0)(1, 0)11
(0, 0)(1, 1)√2 ≈ 1.4142
(0, 0)(3, 4)57
(0, 0)(5, 12)1317
(0, 0)(8, 15)1723
(0, 0, 0)(1, 1, 1)√3 ≈ 1.7323

What Is Coordinate Distance?

Coordinate distance measures how far apart two points are in a coordinate system. The most common measure is Euclidean distance, which gives the straight-line (as-the-crow-flies) distance derived from the Pythagorean theorem. In 2D, it uses the familiar distance formula taught in algebra and geometry.

Manhattan distance (also called taxicab or city-block distance) measures the distance along grid lines, as if walking through a city with a block layout. It sums the absolute differences of each coordinate rather than computing the diagonal.

Real-World Applications

Navigation and GPS

GPS systems calculate straight-line distance between latitude/longitude coordinates using the Haversine formula, which accounts for Earth's curvature. For short distances on a flat surface, the Euclidean formula provides a good approximation.

Machine Learning and Data Science

Distance metrics are fundamental to algorithms like k-nearest neighbors (KNN), clustering (k-means), and anomaly detection. Euclidean distance is the default for continuous data, while Manhattan distance is preferred for high-dimensional spaces or grid-like data.

Game Development

Video games use distance calculations constantly: collision detection between objects, pathfinding algorithms (A*), range checks for attacks, and proximity triggers. Manhattan distance is often used for tile-based games.

Engineering and Physics

Engineers calculate distances between components in 3D space for structural analysis, robotics, and manufacturing. Physics problems involving displacement, velocity vectors, and force calculations all rely on the distance formula.

How to Use

  1. 1

    Choose dimension mode

    Select 2D Cartesian (x, y) or 3D Cartesian (x, y, z) depending on your coordinates

  2. 2

    Enter Point 1 coordinates

    Type the x, y (and z for 3D) coordinates for the first point

  3. 3

    Enter Point 2 coordinates

    Type the x, y (and z for 3D) coordinates for the second point

  4. 4

    View the distances

    See both Euclidean (straight-line) and Manhattan (taxicab) distances with step-by-step calculations

  5. 5

    Copy or try a preset

    Copy the results to clipboard or click a preset like (0,0) to (3,4) to see a worked example

Frequently Asked Questions

What is the distance formula between two points?
The distance formula between two points (x₁, y₁) and (x₂, y₂) in 2D is d = √((x₂ - x₁)² + (y₂ - y₁)²). This is derived from the Pythagorean theorem. The horizontal and vertical differences form the legs of a right triangle, and the distance is the hypotenuse.
What is the distance between (0,0) and (3,4)?
The distance between (0,0) and (3,4) is exactly 5. Using the distance formula: d = √((3-0)² + (4-0)²) = √(9 + 16) = √25 = 5. This is the classic 3-4-5 Pythagorean triple, one of the most well-known right triangle side ratios.
What is Euclidean distance vs Manhattan distance?
Euclidean distance is the straight-line distance between two points (the shortest path). Manhattan distance (also called taxicab or city-block distance) is the sum of the absolute differences of coordinates — the distance you would travel along grid lines. For example, from (0,0) to (3,4): Euclidean = 5, Manhattan = 7. Manhattan distance is always greater than or equal to Euclidean distance.
How do you calculate distance in 3D?
The 3D distance formula extends the 2D formula by adding a third coordinate: d = √((x₂ - x₁)² + (y₂ - y₁)² + (z₂ - z₁)²). For example, the distance from (0,0,0) to (1,1,1) is √(1 + 1 + 1) = √3 ≈ 1.732. This measures the straight-line distance through 3D space.
What is the distance between two points on a number line?
On a 1D number line, the distance between two points a and b is simply |a - b| (the absolute value of their difference). For example, the distance between -3 and 5 is |5 - (-3)| = |8| = 8. This is the simplest case of the general distance formula.
How is coordinate distance used in real life?
Coordinate distance is used in GPS navigation (calculating distances between latitude/longitude points), machine learning (k-nearest neighbors, clustering algorithms), game development (collision detection, pathfinding), robotics (motion planning), computer graphics (ray tracing), and engineering (structural analysis, surveying). Manhattan distance is especially useful for city navigation and grid-based pathfinding.

Related Tools