d = √(Δx² + Δy² + Δz²)Reviewed 28 Sep 2026Runs in your browser

3D Distance Calculator

Find the distance between two points in 3D space, the distance from a point to a plane, a vector’s length, or the dimensions of a bounding box — with the midpoint, exact radical form, direction angles and alternative distance measures (Manhattan, Chebyshev, Minkowski).

Who wrote it

Written by Suhaib Hassan. The formulas are standard analytic geometry, and each worked example is re-derived by hand. Our methodology.

How the engine works

It subtracts coordinates, squares and adds the differences, and takes the square root; whole-number and simplified radical forms are found exactly.

Why we built it

3D distance is the Pythagorean theorem applied twice. This page shows that working and the related measures used in graphics, robotics and CAD.

Two points in 3D

Presets
p = 1 Manhattan, 2 Euclidean, ∞ Chebyshev
Symbolic vector—
Euclidean distance—
—

—

Exact radical—
Squared distance—

3D diagram

Oblique projection with the bounding box of the two points.

—

Step-by-step working

—

—

    Distance metrics compared

    Different ways to measure “how far”, shown for the displacement (Δx, Δy, Δz) = (1, 2, 3).

    MetricFormulaPathValue for (1, 2, 3)Used in
    Euclidean (L²)√(Δx² + Δy² + Δz²)Straight line√14 ≈ 3.7417Physics, graphics, CAD
    Manhattan (L¹)|Δx| + |Δy| + |Δz|Along axes only6Grid routing, warehouse paths
    Chebyshev (L∞)max(|Δx|, |Δy|, |Δz|)Independent axis moves3Gantry machines, chessboard king
    Minkowski (p = 3)(|Δx|³ + |Δy|³ + |Δz|³)^(1/3)Generalised36^(1/3) ≈ 3.3019Machine learning, clustering

    Worked examples

    Two aircraft

    Positions (1, 2, 3) and (5, 6, 9) km.

    Δ = (4, 4, 6)
    d² = 16 + 16 + 36 = 68
    d = √68 = 2√17 ≈ 8.2462 km

    Box diagonal

    The longest straight item that fits in a 3 × 4 × 12 cm box.

    d = √(9 + 16 + 144) = √169 = 13 cm

    Point to plane

    Distance from (1, 2, 3) to the plane 2x − y + 2z − 4 = 0.

    |2·1 − 2 + 2·3 − 4| ÷ √(4 + 1 + 4)
    = 2 ÷ 3 = 0.6667

    What is 3D distance?

    The straight-line distance between (x₁, y₁, z₁) and (x₂, y₂, z₂) is d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. It follows from applying the Pythagorean theorem twice: first across the floor (Δx, Δy), then up the height (Δz).

    Point-to-plane distance

    For a plane Ax + By + Cz + D = 0 and a point (x₀, y₀, z₀), the shortest distance is |Ax₀ + By₀ + Cz₀ + D| ÷ √(A² + B² + C²). The foot of the perpendicular is the point minus the signed distance times the unit normal.

    By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →

    Sources

    • Euclid, Elements, Book XI — foundations of solid geometry and orthogonal spatial projection.
    • ISO 80000-2:2019, Quantities and units — Part 2: Mathematics.
    • NIST Special Publication 811, Guide for the Use of the International System of Units (SI) — length units.

    Frequently asked questions

    How does 3D distance differ from 2D distance?

    In 2D you use √(Δx² + Δy²). In 3D a third term Δz² is added under the root. Geometrically, the 2D distance becomes one leg of a right triangle whose other leg is the height difference.

    What is the difference between Euclidean and Manhattan distance?

    Euclidean distance is the straight-line “as the crow flies” length. Manhattan distance sums the absolute coordinate differences, the length of a path that moves along the axes only, like streets in a grid. Manhattan is never shorter than Euclidean.

    What are direction cosines?

    They are the cosines of the angles the displacement makes with the x, y and z axes: cos α = Δx ÷ d, cos β = Δy ÷ d, cos γ = Δz ÷ d. They always satisfy cos²α + cos²β + cos²γ = 1 and give the unit vector along the line.

    What are the spherical coordinates of a displacement?

    The distance r = d, the azimuth θ = atan2(Δy, Δx) measured in the xy-plane, and the polar angle φ = arccos(Δz ÷ d) measured from the +z axis.

    What if the plane equation is entered as ax + by + cz = k?

    Move k to the left: enter D = −k. For example 2x − y + 2z = 4 becomes A = 2, B = −1, C = 2, D = −4.

    Does the unit matter?

    No, as long as all coordinates use the same unit. The unit box is only a label copied into the results; the arithmetic is unit-free.

    Related calculators

    Continue with geometry and vectors.

    All Math Calculators

    Embed This 3D Distance Calculator

    Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

    <iframe src="https://www.calculatepilot.com/embed/distance-3d-calculator.html" width="100%" height="560" loading="lazy" title="3D Distance Calculator"></iframe>
    For website owners

    Want this calculator on your own website?

    Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

    • All 159 calculators, unlimited embeds
    • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
    • Runs in your visitor's browser, so nothing is sent to a server
    • License key emailed automatically after checkout, cancel anytime
    $7.99 / month
    or $89.99 / year · white-label Pro
    Get the white-label license Embed free with attribution