Distance Calculator

Find the Euclidean distance between two points in 2D or 3D — plus midpoint, slope, Manhattan and Chebyshev distances with step-by-step working.

Your two points

Pick 2D or 3D and enter coordinates — distance updates live.

(x₁, y₁)
(x₂, y₂)
Mode2D Euclidean
Live calculation

Euclidean distance

5

From (1, 2) to (4, 6) — Δx = 3, Δy = 4

Midpoint

(2.5, 4)

average of endpoints

Slope (2D only)

1.333

Δy / Δx

Manhattan

7

|Δx| + |Δy|

Chebyshev

4

max(|Δx|, |Δy|)

Δx

3

x₂ − x₁

Δy

4

y₂ − y₁

Δz

z₂ − z₁

Angle (from +x)

53.13°

atan2(Δy, Δx)

Diagram points · midpoint
Metric2D formulaUse case
Euclidean√(Δx² + Δy²)geometry, straight-line distance
Manhattan (L¹)|Δx| + |Δy|city grids, taxi routes
Chebyshev (L∞)max(|Δx|, |Δy|)chessboard king's moves
Minkowski (Lᵖ)(|Δx|ᵖ + |Δy|ᵖ)^(1/p)general L-norm family
Midpoint((x₁+x₂)/2, (y₁+y₂)/2)centre of segment
Slope(y₂ − y₁)/(x₂ − x₁)line steepness

The Method

How distance between points is computed

The Euclidean distance between two points is the straight-line length of the segment that joins them. It comes directly from the Pythagorean theorem: treat Δx and Δy as the legs of a right triangle, and the hypotenuse d = √(Δx² + Δy²) is the distance. In three dimensions the same trick repeats: d = √(Δx² + Δy² + Δz²). Other distance metrics — Manhattan, Chebyshev, Minkowski — change how the coordinate differences are combined, but every one of them assigns a non-negative number to every pair of points and equals zero iff the points coincide.

Working for current points

d = √(Δx² + Δy²)

About This Tool

What Is a Distance Calculator?

A distance calculator finds the straight-line (Euclidean) length between two points in two or three dimensions. Enter the coordinates of Point 1 and Point 2 and the calculator returns the distance, the midpoint, the slope (2D only), the per-axis differences Δx, Δy, Δz, the angle from the +x axis, and two non-Euclidean cousins — Manhattan and Chebyshev distance.

The Euclidean formula d = √(Δx² + Δy²) follows from the Pythagorean theorem: Δx and Δy form the legs of a right triangle whose hypotenuse is the distance you want. In three dimensions the same idea extends naturally to d = √(Δx² + Δy² + Δz²). This calculator evaluates the formula in IEEE 754 double precision — accurate to about 15 significant digits, far beyond the precision of any real-world measurement.

Beyond the textbook Euclidean metric, the calculator reports two important alternatives. Manhattan distance (|Δx| + |Δy|) measures distance along axis-aligned moves — the path a taxi takes through a city grid. Chebyshev distance (max(|Δx|, |Δy|)) measures the minimum number of moves for a chess king. Both are Lᵖ-norm generalisations of the same idea and show up across machine learning, robotics, computer graphics, and pathfinding algorithms.

Use this free distance calculator for geometry homework, computer graphics, GIS, route-planning sketches, or any time you need a quick read on how far apart two points are. All computation runs locally — no sign-up, no tracking, no data sent to any server.

2D and 3D Distance

Toggle between (x, y) and (x, y, z) — formula and stats update automatically.

Midpoint & Slope

Reports midpoint coordinates and (in 2D) line slope from Δy / Δx.

Manhattan & Chebyshev

Two non-Euclidean metrics for grid-based and chessboard-style problems.

Live Diagram

SVG plot shows both points, segment, and midpoint marker.

100% Free & Private

No account, no tracking — every calculation runs locally in your browser.

Step-by-Step Working

Each formula substitution shown — ideal for homework or revision.

How to Use This
Distance Calculator

From points to full geometry in seconds.

1

Pick 2D or 3D

Use the tabs to toggle between 2D (x, y) and 3D (x, y, z). The z-input appears only when 3D is selected.

2

Enter Point 1

Type the coordinates of the first point — negative numbers are fine, just use the minus sign.

3

Enter Point 2

Type the second point. The distance, midpoint, and slope all update the moment you change a value.

4

Read the Distance

The headline shows the Euclidean distance. Stat tiles include Manhattan, Chebyshev, midpoint, slope, Δx, Δy, Δz and the angle.

5

Inspect the Diagram

In 2D mode the SVG plots both points, the segment between them, and the midpoint — useful for sanity-checking your input.

6

Read the Formula Working

The formula card shows the substitution (Δx, Δy, …) and final answer — ideal for assignment write-up.

Frequently Asked Questions

Everything you need to know about distance between points.

In 2D: d = √((x₂ − x₁)² + (y₂ − y₁)²). In 3D add (z₂ − z₁)² inside the root. Both come from the Pythagorean theorem — the legs are the per-axis differences and the hypotenuse is the distance.

Manhattan distance (also called L¹ or taxicab distance) is the sum of absolute differences along each axis: |Δx| + |Δy| (+ |Δz|). It models the path of a taxi in a city grid where you can only move along streets. It's never smaller than the Euclidean distance.

Chebyshev distance (also called L∞ or chessboard distance) is the maximum absolute difference along any axis: max(|Δx|, |Δy|). It models the minimum number of moves a chess king needs since each move can change x and y by 1 simultaneously.

The midpoint is the average of the two endpoints: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). In 3D add the z-average. It's equidistant from both endpoints and lies on the segment joining them.

Slope measures the line's steepness — how much y changes per unit of x — and is computed as (y₂ − y₁) / (x₂ − x₁). Distance measures how far apart the points are along the segment. Two points can be the same distance apart but lie on lines of very different slope.

Distance is a non-negative scalar — just a length. Displacement is a vector that includes direction. Two points always have the same distance no matter which is "first", but their displacement reverses sign when you swap them.

The Minkowski distance with parameter p is (|Δx|ᵖ + |Δy|ᵖ)^(1/p). It generalises every standard metric: p = 1 is Manhattan, p = 2 is Euclidean, p → ∞ is Chebyshev. It's widely used in machine learning for k-nearest-neighbour distance metrics.

Common causes: (1) mixing up signs — remember Δx² and Δy² are always positive; (2) swapping x and y — the order of subtraction doesn't matter under the square because of the squaring; (3) forgetting the square root. The calculator shows Δx and Δy separately so you can verify your inputs.

Yes — just type the negative sign. The formula works for all real coordinates, in any quadrant or octant. The distance is always non-negative no matter which sign the coordinates have.