Distance & Midpoint Calculator

Calculate the straight-line distance and midpoint between two 2D points from their x and y coordinates — runs 100% in your browser with no upload.

Point A

Point B

Distance:  5
Manhattan distance:  7
Midpoint:  (1.5, 2)

🔒 Calculated instantly in your browser — nothing is uploaded.

What this tool does

Enter the x and y coordinates of two points and the calculator instantly returns the straight-line distance between them and the coordinates of their midpoint. It uses the Euclidean distance formula, the standard measure of how far apart two points are on a flat plane, so the answer matches what you would get by drawing the two points on graph paper and measuring the line that joins them. Results update live as you type, so you can adjust any coordinate and watch the distance and midpoint change immediately — handy for geometry homework, mapping simple layouts, or checking work in a design or game project.

How distance and midpoint are calculated

The distance is the square root of the sum of the squared differences in each axis: distance = √((x₂ − x₁)² + (y₂ − y₁)²). This is a direct application of the Pythagorean theorem, treating the horizontal and vertical gaps between the points as the two legs of a right triangle. The classic 3-4-5 triangle is a good sanity check: the distance from (0, 0) to (3, 4) is exactly 5. The midpoint is simply the average of the two x values and the average of the two y values: ((x₁ + x₂) / 2, (y₁ + y₂) / 2), giving the point that lies exactly halfway along the line segment. Both formulas are deterministic, so the same coordinates always produce the same result.

Frequently asked questions

What distance formula does this use?

It uses the Euclidean (straight-line) distance formula, √((x₂ − x₁)² + (y₂ − y₁)²), which is the standard distance between two points on a flat 2D plane. For example, the distance from (0, 0) to (3, 4) comes out to exactly 5.

Can I use negative or decimal coordinates?

Yes. You can enter negative numbers and decimals for any coordinate. Both the distance and the midpoint are calculated correctly for points anywhere on the plane, including fractional and negative positions.

What is the Manhattan distance shown below the straight-line distance?

Manhattan (taxicab) distance is |x₂ − x₁| + |y₂ − y₁| — the distance you travel moving only along the axes, like following city blocks. It is used in grids, pathfinding and machine learning. For (0, 0) to (3, 4) it is 3 + 4 = 7, versus the Euclidean 5; it is always greater than or equal to the straight-line distance.

Are my coordinates sent to a server?

No. The numbers you type never leave your device. The distance and midpoint are computed entirely in your browser with JavaScript — nothing is uploaded, logged, or stored.