Search tools

Find a tool by name or what it does.

Distance Between Two Points Calculator

Enter two points in 2D or 3D and get the straight-line distance, the midpoint, and the change on each axis at once.

Dimensions

Point A

Point B

Coordinates can be positive, negative, or decimal, in any unit. Everything runs in your browser. Nothing is uploaded.

Decimal places

Results

Straight-line distance
5
d = √(Δx² + Δy²)
Midpoint
(1.5, 2)
Change in x
3
Change in y
4

Everything is calculated in your browser. Nothing is uploaded.

How to find the distance between two points

  1. Choose 2D or 3D

    Pick whether your points lie on a flat plane or in three-dimensional space.

  2. Enter both points

    Type the coordinates of point A and point B into the field for each axis.

  3. Read the results

    The straight-line distance, midpoint, and change on each axis appear instantly below.

  4. Copy the summary

    Use the copy button to put the distance, midpoint, and axis changes on your clipboard.

Why use this tool

Distance in 2D and 3D

Measure the straight-line distance between two points on a plane, or add a z axis to measure through space.

Midpoint and per-axis change

Every result includes the midpoint coordinate and the signed change on each axis, not just the distance.

Updates as you type

The distance, midpoint, and axis changes recalculate the moment you edit any coordinate.

Adjustable precision

Switch between 2, 4, and 6 decimal places to keep the answers as short or as exact as you need.

Handles edge cases

Identical points return a distance of zero, and empty or non-numeric coordinates are caught with a clear message.

Runs entirely in your browser

Every calculation happens on your device. Nothing you type is uploaded.

About this tool

The straight-line distance between two points is the length of the segment that joins them, and it comes directly from the Pythagorean theorem. In two dimensions you take the change in x and the change in y, square each, add them together, and take the square root. This calculator does exactly that: enter the coordinates of point A and point B and it returns the distance the moment both points are complete.

Switch to 3D and a third axis joins the sum, so the distance becomes the square root of the squared change in x, y, and z together. Alongside the distance you also get the midpoint, the coordinate exactly halfway between the two points, and the signed change on each axis so you can see how far apart the points sit in every direction. The coordinates are unit-agnostic, so whatever unit you type in, the results come back in the same one.

Everything updates as you type, with no button to press. Identical points return a distance of zero, and empty or non-numeric fields are flagged instead of showing a broken result. For the side lengths and angles behind the theorem see the triangle calculator, and for wider math try the scientific calculator.

Frequently asked questions

How is the distance between two points calculated?
It uses the distance formula, which is the Pythagorean theorem applied to coordinates. The change in x and the change in y are each squared, added together, and the square root of the total is the straight-line distance. In 3D the squared change in z is added before the square root.
Does it work in three dimensions?
Yes. Switch the toggle to 3D and a z field appears for each point. The distance then accounts for the change along all three axes at once, and the midpoint and axis changes include z as well.
What is the midpoint?
The midpoint is the coordinate exactly halfway between the two points. Each of its values is the average of the matching coordinates of point A and point B, so it always lies on the segment joining them.
What units does it use?
The calculator is unit-agnostic. Enter coordinates in metres, pixels, inches, or anything else, and the distance, midpoint, and axis changes come back in that same unit.
What happens with empty or non-numeric input?
Every coordinate must be a number, so blank fields prompt you to finish entering the points and any text that is not a valid number is flagged with a short message instead of a wrong answer.
Is my data uploaded anywhere?
No. Everything runs in your browser; nothing is sent to a server.

Related tools