Goal
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system.
Worldwide context
Saved once here, used across the site.
Currency changes display only. Country selection guides tax input; no tax rate is guessed.
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system.
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2).A clearer path to an answer
This page keeps the calculation transparent: define the goal, enter the matching values, inspect the method, and decide what the result means in your situation.
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system.
Point 1 x · Point 1 y · Point 1 z · Point 2 x · Point 2 y · Point 2 z
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2).
Calculate, review the assumptions below, then compare a related tool when the decision needs more context.
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system.
Open the 3D Euclidean Distance pageMore math tools
Download PDFDownload Word (.doc)
Enter your values above and choose Calculate to see the result here.
Calculation map
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2).
Bounded, transparent calculation
Your recent runs stay in this browser session only.
Formula: d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2).
Subtract corresponding coordinates, square the three differences, add them, and take the nonnegative square root. The result is the straight-line distance in the same coordinate units as the inputs.
Worked example: Differences are (3, 4, 12), so the Euclidean distance is sqrt(9 + 16 + 144) = 13 coordinate units.
The displayed limits are checked before the handler runs. Model-specific domain checks may also reject impossible or non-finite inputs.
Methodology: This calculator follows the WorldCalculate input, formula, precision, and boundary policy. Read the official methodology.
Calculator usage statistics
This section counts anonymous successful Calculate submissions, not unique visitors. Counts and top tools appear only when trusted aggregate data is available; country analysis is shown only under the same condition and reporting threshold.
Answer-first guide
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system. Start with one clearly defined goal, enter values in the units shown, and keep the result attached to the assumptions below.
This tool is useful when your question includes 3D distance, Euclidean distance, Cartesian points. It returns the outputs declared in the calculator contract rather than a live quote, approval, diagnosis, or professional sign-off.
Point 1 x · Point 1 y · Point 1 z · Point 2 x · Point 2 y · Point 2 z. Keep the same time period, unit system, and currency wherever the form requires comparable values.
Run the worked example first, compare its output with the page's example, then change one input at a time. This makes an unexpected result easier to trace to a unit, boundary, or assumption.
Need a wider view? Browse Math Calculators or compare the related tools below. The WorldCalculate methodology explains how formulas, examples, limits, and revisions are reviewed.
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2).
Subtract corresponding coordinates, square the three differences, add them, and take the nonnegative square root. The result is the straight-line distance in the same coordinate units as the inputs.
Differences are (3, 4, 12), so the Euclidean distance is sqrt(9 + 16 + 144) = 13 coordinate units.
Context and background
Math calculators move from named quantities to a relation, then to a result that can be checked with substitution, units, or an alternate form.
Arithmetic, algebra, geometry, trigonometry, and number theory provide reusable structures for classroom work and everyday reasoning. Each page narrows that structure to one declared problem.
Research and review
Researched by Hassan ALRowaie, Founder and editorial researcher at WorldCalculate.
This guide follows the live calculator's declared inputs, formula, worked example, assumptions, validation boundaries, and source-backed methodology. The review date describes editorial review of the calculator explanation; it is not a promise that external facts or rates remain current.
The 3D Euclidean distance is the length of the shortest straight segment joining two points in a flat three-dimensional Cartesian space. This calculator accepts the x, y, and z coordinates of point 1 followed by the matching coordinates of point 2. It subtracts each coordinate pair, squares the three differences, adds those squared contributions, and takes a nonnegative square root. The result keeps the coordinate unit used by the inputs. This is a focused geometry calculation: it does not infer a map projection, a surface route, a time, a velocity, or a physical measurement process. The guide explains the input order, formula, units, worked arithmetic, zero and negative coordinates, numerical boundaries, interpretation, checks, and responsible limits of the result.
This page answers how far apart two specified points are when separation is measured by an ordinary straight line in three-dimensional Cartesian space. A point is represented by an ordered triple, such as (1, 2, 3), rather than by a name or an address. The calculator treats the first triple and second triple as positions in one shared coordinate system. It does not decide whether those positions describe a room, a graph, a model, a data plot, or an abstract exercise. The output is one nonnegative scalar distance, not a new point and not three separate coordinate changes.
The straight-line qualification matters because many other distances are possible. A route constrained to roads, a path restricted to a surface, and an axis-aligned walk can all be longer than the Euclidean segment. Those are separate models with different inputs or rules. Here, the segment is allowed to pass through the coordinate space, and the three coordinate differences are combined with the Pythagorean relationship. Keeping the visitor question narrow makes the answer reproducible: the same six numbers and the same coordinate assumptions produce the same distance regardless of the surrounding application.
The first three fields are x1, y1, and z1, which together form point 1 as (x1, y1, z1). The last three are x2, y2, and z2, forming point 2 as (x2, y2, z2). The numeric suffix identifies the point, while the letter identifies the axis. Entering a value in y2 does not affect the x or z difference. Writing both triples on paper before entering them is a simple way to avoid transposing a coordinate between the two points.
Every coordinate is a finite real number from -1,000,000 through 1,000,000 inclusive. Decimal and negative values are allowed. These bounds are software safeguards that keep direct browser arithmetic predictable; they are not mathematical limits on Cartesian geometry. The handler checks the same contract even when it is called without the form. A blank value, numeric text passed directly to the module, NaN, either infinity, or a value outside the range is rejected instead of silently coerced or clipped.
Subtract the first x-coordinate from the second to obtain dx = x2 - x1. Do the same for y and z. These differences form the displacement vector from point 1 to point 2. The sign of a difference tells which direction the second point lies along an axis, but the final Euclidean distance does not depend on the direction because each difference is squared. The formula is d = sqrt(dx^2 + dy^2 + dz^2). There is no absolute-value sum and no division by elapsed time in this operation.
The formula is the three-dimensional extension of the familiar two-dimensional distance formula. The z difference contributes a third perpendicular leg to the right-triangle reasoning. Squaring first prevents positive and negative axis contributions from canceling one another. After the squared terms are added, the square root returns to the original length scale. The engine uses a stable hypotenuse operation for the three differences and checks the derived value before returning it, so a valid renderer never receives an infinite or negative-zero result.
Use point 1 = (1, 2, 3) and point 2 = (4, 6, 15). The coordinate differences are dx = 4 - 1 = 3, dy = 6 - 2 = 4, and dz = 15 - 3 = 12. The squared contributions are 9, 16, and 144. Their sum is 169, and the square root of 169 is 13. The calculator therefore reports 13 coordinate units. The familiar 3-4-12 displacement is useful because it gives an exact integer result while still exercising all three axes.
Changing the order of the points reverses every signed difference but leaves the distance unchanged: (-3)^2, (-4)^2, and (-12)^2 produce the same sum. Changing just one coordinate changes only its corresponding displacement. For example, replacing z2 with 3 makes dz zero and leaves a two-dimensional 3-4 separation of 5. These comparisons are good sanity checks because they show which field controls which term without relying on a hidden geometric diagram.
If all three coordinates of point 1 equal the corresponding coordinates of point 2, every difference is zero and the distance is exactly zero. Equal points are valid; no division occurs in this formula, so the engine does not need to reject coincidence. A zero in only one axis is also ordinary. It says the points share that coordinate while potentially differing on the other two axes. These cases should not be confused with missing inputs, which are invalid because the handler cannot know whether the omitted coordinate was intended to be zero.
Negative coordinates work in exactly the same way as positive coordinates. A point such as (-4, 2.5, -1) is simply located on the negative side of two axes. The subtraction preserves the correct displacement, and squaring removes direction only at the point where the length formula requires it. Do not take absolute values before subtracting as a substitute for careful field pairing; absolute differences happen to give the same final result for this particular formula, but signed differences make the vector direction available for review steps.
The calculator does not ask for a unit selector because it cannot convert a coordinate system from context it has not been given. If all coordinates are in metres, the result is in metres. If they are in millimetres, the result is in millimetres. The same statement applies to an abstract unit used in a graph or model. Mixing metres and millimetres in the six fields without conversion creates a numerically computable but semantically inconsistent distance, so unit preparation belongs before entry.
The axes also need a common origin, orientation, and scale. A change of origin applied equally to both points does not change their distance, but a change of scale or a rotation with unequal treatment can. Coordinates from different projections or local frames should not be combined merely because each has three numbers. For a known transformation, perform and document that transformation first, then enter the resulting pair in the shared Cartesian frame. This page intentionally avoids guessing such a transformation.
The visible and direct-handler bounds include both endpoints at plus and minus 1,000,000. The largest coordinate difference in one axis is 2,000,000, and the largest three-axis Euclidean result is finite for this contract. Even so, the handler checks each subtraction and the final hypotenuse. A finite input does not justify removing derived-value checks from a reusable engine because future formula or bound changes could create a different numerical risk. Clear rejection is safer than displaying a rounded overflow or an accidental placeholder.
Results are returned in the shared renderer shape: a labeled numeric result with a format of number, a unit phrase, and a presentation precision, together with text steps and a note. The numeric value is not rounded in the pure handler. The renderer may choose how many digits to show, while a later caller can retain the underlying finite number. Inputs and outputs are normalized away from negative zero so a coincident or cancellation-like case does not appear as a confusing minus sign.
Euclidean distance measures the straight segment through the full coordinate space. Manhattan distance instead adds the absolute axis differences and represents movement constrained to axis-aligned legs. A great-circle distance follows a shortest arc on a sphere and needs angular coordinates plus a sphere radius. A distance between points on a curved surface may require yet another metric. These results can agree in special cases, but the input contract and interpretation are not interchangeable. Select this page when the geometry is flat Cartesian space and direct straight-line separation is the intended question.
The three-dimensional label also distinguishes this page from a two-dimensional distance page. If all z differences are zero, the formula reduces naturally to the planar case, but the field contract still records z for both points. Do not infer a missing third coordinate from a two-dimensional drawing unless the problem explicitly supplies z = 0. Conversely, dropping a meaningful z difference will systematically understate the separation. The result explanation keeps the three contributions visible for that reason.
A reliable manual check is to calculate each difference separately and compare the three values in the result steps. The distance cannot be smaller than the absolute difference along any one axis, because every other squared contribution is nonnegative. It also cannot change when the points are swapped. If one coordinate pair is made equal, the corresponding contribution should disappear. These checks are quick enough for classroom work and catch transposed fields, sign slips, and accidental use of a coordinate from the wrong point.
A common mistake is to add the raw signed differences. That produces a displacement component sum, not a length, and can be zero for distinct points. Another is to use x1 squared plus x2 squared without subtracting first; that measures a different quantity relative to the origin. A third is to divide by a time because the points came from a moving object. Time and trajectory belong to a velocity or path model, not to this coordinate-only distance.
This calculation is useful for analytic geometry exercises, 3D graphics checks, point-cloud comparisons, spatial indexing prototypes, and any other setting that explicitly uses a shared Cartesian metric. It can serve as one ingredient in a larger algorithm, such as a threshold comparison or a nearest-neighbor search. In those settings, document whether the threshold is inclusive, which units are used, and whether a coordinate transformation happened before the calculation. The page supplies the arithmetic, not the policy around a later decision.
The result is not evidence that two physical objects can travel directly between the points, that a collision will occur, or that a design meets a tolerance. Real systems may include obstacles, curvature, uncertainty, sensor error, calibration drift, or non-Euclidean geometry. For navigation, robotics, surveying, medical imaging, or safety-critical engineering, validate the coordinate frame and use reviewed domain tooling. Enter only the numbers needed for this formula, and do not attach private identities or sensitive location details to a shared calculator record.
A reproducible distance record should preserve both ordered triples, the coordinate unit, the axis convention, and the resulting distance. The order is not needed for the final scalar, but it helps a reviewer confirm that the intended points were compared. Keep the unrounded numeric result when it feeds another calculation, and identify the display precision separately. A short statement such as straight-line Cartesian distance in metres is enough to prevent the value from being mistaken for a route length or a surface arc.
Before relying on the output, verify that every field is finite, all six values belong to the same frame, and the result steps show the expected differences. Check a simple known case, such as a one-axis displacement or the 3-4-12 example, then test a coincident pair if zero behavior matters. The calculator intentionally finishes at one transparent scalar. Any later conversion, uncertainty estimate, threshold rule, or physical conclusion should be written as its own reviewed step rather than hidden inside the meaning of this distance.
Before entering values from a file, drawing, sensor, or simulation, identify the origin and name the three axes. Confirm whether the numbers are positions or offsets and whether positive directions follow the convention used by the source. The distance formula itself is indifferent to a common translation, but it is not indifferent to an unnoticed scale mismatch or to comparing points from different frames. A small written frame description can prevent a mathematically perfect calculation from answering the wrong spatial question.
Then check the unit attached to every coordinate. A pair measured in metres should not be compared with another pair whose z values are millimetres unless the conversion has already happened. If the source has uncertainty, keep that uncertainty with the coordinates; the calculator returns the nominal distance and does not propagate error bars. When a coordinate transformation is required, perform it once in a reviewed step and record the transformed triples that actually entered this page.
The three signed differences together form a displacement vector from point 1 to point 2. The distance is its Euclidean norm, so direction is intentionally discarded only at the final norm operation. This distinction matters when the number is passed to another calculation. A threshold test may need only the norm, while a movement command, gradient, or projection needs the signed displacement components as well. Do not reconstruct direction from the scalar; retain the three differences if a later operation needs them.
A good review record therefore includes the input triples, computed dx, dy, dz, squared contributions, sum, and final square root. The displayed steps provide the core of that audit. If another tool reports a different answer, compare these intermediate quantities before comparing formatting or rounding. This approach localizes an error to field order, unit preparation, subtraction, squaring, or presentation instead of treating the final distance as an opaque value.
A common downstream use is asking whether two points are within a tolerance. The Euclidean result can support that comparison when the tolerance is also Euclidean and uses the same coordinate unit. State whether equality counts as within the tolerance, and compare the unrounded numeric value rather than a shortened display label. A threshold selected for one axis-aligned manufacturing tolerance or one surface model should not be reused automatically for this straight-line norm.
If the distance feeds a nearest-neighbor procedure, keep the point identifiers and the coordinate frame beside the result. Equal distances can occur for different point pairs, and a scalar cannot identify which coordinates produced it. If the procedure needs a stable tie-breaker, define that rule outside the calculator. The handler's responsibility ends at a finite distance from the six supplied components.
When comparing distances from different datasets, normalize units and coordinate scale before calculation. A point cloud in millimetres and another in metres can make a nearest result appear wrong by a factor of one thousand even though each individual call is correct. Likewise, a pixel coordinate distance and a physical distance should not be compared without a documented calibration. The calculator does not guess either conversion.
For reproducible software use, serialize the input object with x1, y1, z1, x2, y2, and z2 in their named order, then retain the result value and unit phrase. Do not serialize a formatted sentence as the only source of truth. A later renderer can format the number differently without changing the mathematical contract, while a later service can validate the frame and threshold using the preserved metadata.
A final review should ask which metric was intended, whether the points share a frame, whether all values are finite, and whether the chosen tolerance has the correct dimension. Once those questions are answered, the result steps provide a short audit trail from coordinate pairs to norm. This separation keeps a small geometry page useful without making it responsible for decisions it cannot observe.
Calculate the straight-line Euclidean distance between two ordered points in a three-dimensional Cartesian coordinate system.
d = sqrt((x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2). Subtract corresponding coordinates, square the three differences, add them, and take the nonnegative square root. The result is the straight-line distance in the same coordinate units as the inputs.
Enter Point 1 x, Point 1 y, Point 1 z, Point 2 x, Point 2 y, Point 2 z, then choose Calculate.
Both points use the same Cartesian axes, origin, scale, and coordinate units. The distance is Euclidean straight-line distance through the coordinate space, not a constrained path or surface distance. Coordinates are finite real numbers within the displayed software bounds.
This calculator is part of the WorldCalculate library. Its formula, example, assumptions, input bounds, and output formatting follow the official methodology.
These WorldCalculate collections connect this tool with related questions while keeping each calculation separate and transparent.