Example 1: A 2D distance that simplifies neatly
Suppose:
Find the coordinate differences:
Square and add them:
Take the square root:
The distance between the points is \(10\) coordinate units. The midpoint is:
Use this Distance Between Points Calculator to enter values, adjust options, and review results in a compact responsive workspace.
Results are calculated automatically as you enter data.
▼ See explanations and tips below ▼
Euclidean distance is the straight-line distance between two points in a flat coordinate system. In everyday language, it answers the question: “How far apart are these two points if you could travel directly from one to the other?”
In a 2D coordinate plane, each point has an \(x\)-coordinate and a \(y\)-coordinate. In 3D space, each point also has a \(z\)-coordinate. The distance between the points is found by comparing the coordinates axis by axis, then using the Pythagorean theorem to combine those differences into one straight-line length.
For two points \(A\) and \(B\), the result is the length of the segment connecting them. It is always nonnegative. A distance of \(0\) means the two active-coordinate points are the same point.
The distance formula connects geometry and algebra. Instead of measuring a line segment with a ruler, you can calculate its length from coordinates.
This is useful in coordinate geometry, algebra, analytic geometry, vectors, graphing, 3D modeling, physics, computer graphics, and many classroom problems. It also helps you distinguish between direct distance and path distance. A direct distance is the length of the straight segment between two points; a route or path distance may be longer because it follows roads, grid paths, obstacles, or curved surfaces.
The distance formula is the Pythagorean theorem applied to coordinate differences.
In 2D, imagine two points connected by a diagonal segment. The horizontal difference is one leg of a right triangle, and the vertical difference is the other leg. The distance between the points is the hypotenuse.
Let the two points be:
First find the coordinate differences:
Then square and add the differences:
Finally, take the square root:
Written directly with coordinates, the 2D distance formula is:
In 3D, the idea is the same, but there is one more coordinate difference:
The 3D distance formula is:
The midpoint is found by averaging matching coordinates. In 2D:
In 3D:
Suppose:
Find the coordinate differences:
Square and add them:
Take the square root:
The distance between the points is \(10\) coordinate units. The midpoint is:
Suppose:
Find the coordinate differences:
Square and add:
Take the square root:
The negative signs in \(dy\) and \(dz\) do not make the distance negative, because each coordinate difference is squared. The signs only show direction from Point A to Point B along each axis.
The midpoint is:
If both active-coordinate points are the same, such as:
then:
A zero distance means there is no separation between the two points.
If only one coordinate changes, the distance is simply the absolute size of that one change. For example:
Here \(dx = 0\) and \(dy = 6\), so:
The main distance result is the straight-line length from Point A to Point B. It uses the same implied unit as the coordinate axes. If the coordinates represent meters, the distance is in meters. If the coordinates represent grid units, the distance is in grid units. If no physical unit is assigned, the result is unitless coordinate distance.
A smaller distance means the points are closer together. A larger distance means the points are farther apart in the coordinate system. A distance of \(0\) means the two active-coordinate points match exactly.
The exact radical or exact-style square-root form shows the distance before converting it fully into a decimal. For example, \(\sqrt{61}\) is more exact than a rounded decimal approximation. The decimal form is often easier to compare, estimate, or use in practical calculations.
Distance squared is the value inside the square root. It is not the final distance unless the square root happens to equal the same number, which is uncommon. For example, if \(d^2 = 61\), then \(d = \sqrt{61}\), not \(61\).
Coordinate differences show how Point B differs from Point A along each axis. Reversing Point A and Point B changes the signs of these differences, but the final distance stays the same.
The midpoint tells you the coordinate exactly halfway between the two points. It is useful when you need the center of a segment, the center of a diameter, or a halfway location in a coordinate model.
A common mistake is confusing distance with distance squared. The squared value is an intermediate step. The final distance requires taking the square root.
Another mistake is expecting all coordinate differences to be positive. A coordinate difference can be negative because it includes direction, but distance itself is never negative.
In 3D problems, make sure the calculation is actually using 3D mode. If a point has \(z\)-coordinates but the calculation is in 2D, the \(z\)-values do not affect the result.
Do not mix units across axes. If \(x\) is measured in meters but \(y\) is measured in feet, the distance formula does not automatically fix the mismatch. Convert all coordinates to the same unit system before calculating.
Do not use this flat Cartesian formula for latitude and longitude on Earth unless the coordinates have first been converted into an appropriate flat coordinate model for the purpose. Distances on a sphere or curved surface require different methods.
The order of Point A and Point B does not change the distance. It only changes the signs of \(dx\), \(dy\), and \(dz\).
Use Euclidean distance when you need the direct straight-line distance between two points in a flat coordinate system.
It is especially useful for:
The formula assumes a flat Cartesian coordinate system. It does not account for curved surfaces, geographic latitude and longitude, road networks, obstacles, map projections, or non-Euclidean geometry.
All coordinate axes should use the same implied unit. The result uses that same unit. There is no meaningful unit conversion unless the coordinates themselves have already been converted.
Only the active dimensions matter. In 2D, the calculation uses \(x\) and \(y\). In 3D, it uses \(x\), \(y\), and \(z\).
Very large or very small values may be displayed in scientific notation. Coordinates are limited to 15 significant digits, and inputs that cannot be represented distinctly are rejected. Decimal results may be rounded for display and should be treated as numerical approximations.
Exact radical simplification is used only when every active coordinate is a safe integer. Decimal inputs receive a numerical approximation. If a finite distance has a square above or below the floating-point range, the distance remains available while the Distance squared card reports that range limitation.
For schoolwork, follow your teacher’s instructions about exact form, decimal approximation, and rounding. For engineering, surveying, mapping, physics, or safety-related work, make sure the coordinate system, units, measurement accuracy, and model assumptions are appropriate for the task.
The distance is always nonnegative. It is positive when the two points are different, and it is \(0\) when the active-coordinate points are exactly the same.
The differences are squared because the distance formula comes from the Pythagorean theorem. Squaring also removes sign, so a difference of \(-4\) contributes the same length as a difference of \(4\).
The final distance does not change if you swap Point A and Point B. The coordinate differences change sign, but their squares stay the same.
Distance is a length. It tells you how far apart the two points are. The midpoint is a coordinate point, not a length; it tells you where the halfway point of the segment is.
The square-root form can preserve the exact or exact-style structure of the answer. The decimal form is an approximation that is easier to read and compare, especially when the square root is not a whole number.
Not directly. Latitude and longitude describe positions on the Earth’s curved surface, while this formula assumes flat Cartesian coordinates. Geographic distance problems usually need a method designed for spherical or ellipsoidal Earth models, or coordinates converted into a suitable flat projection.
Books and Open Textbooks
Online and Official Sources