Skip to content
    Geometry

    How to Use the Distance Formula (With Steps)

    Video games, maps, and navigation apps all rely on one question: how far apart are two points, in a straight line? The distance formula answers it using nothing more than the Pythagorean theorem in disguise.

    Math Solver Academic Editorial Board4 min read

    Key takeaways

    • The distance formula is d = √[(x₂ - x₁)² + (y₂ - y₁)²].
    • It's the Pythagorean theorem applied to the horizontal and vertical gaps between two points.
    • Squaring removes the effect of subtraction order, so distance is always positive.
    • It only gives the straight-line distance, not a walking or driving route.
    In this guide
    1. 01What is the distance formula?
    2. 02Why does the distance formula matter?
    3. 03The formula
    4. 04How to find the distance step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you'll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    What is the distance formula?

    When two points are plotted on a coordinate grid, the distance formula tells you exactly how far apart they are in a straight line. It's built from the Pythagorean theorem.

    Why does the distance formula matter?

    It's the foundation for measuring straight-line distance anywhere numbers can be placed on a grid: maps, games, graphics, and geometry problems alike.

    The park entrance at (0, 0) and a picnic area at (6, 8) are exactly √(6² + 8²) = √100 = 10 meters apart in a straight line — the same 6-8-10 triangle you'd get from the Pythagorean theorem, just measured on a map instead of a wall.

    The formula

    d = √[(x₂ - x₁)² + (y₂ - y₁)²]
    SymbolWhat it meansExample
    dThe distance between the two points10 m
    (x₁, y₁)The first point's coordinates(0, 0)
    (x₂, y₂)The second point's coordinates(6, 8)

    How to find the distance step by step

    1. 1Write down both points' coordinates.
    2. 2Subtract the x-coordinates. x₂ - x₁.
    3. 3Subtract the y-coordinates. y₂ - y₁.
    4. 4Square both differences and add them together.
    5. 5Take the square root. This gives you the distance.

    Now try it yourself. Change the two points in the calculator below and watch the distance update, with every step shown.

    Try it yourself

    Pre-filled with the example — change any value.

    🧮
    Geometry
    High School

    Distance Formula

    Calculate the distance between two points

    d = √[(x₂-x₁)² + (y₂-y₁)²]

    xy(0.7, 0.7)
    cos: 0.71
    sin: 0.71
    tan: 1.0
    0.120
    0.120
    120
    120

    💡 Example

    Reference
    Inputs:x1=1, y1=1, x2=4, y2=5
    Result:5
    Open the full Distance Formula calculator

    Common mistakes to avoid

    • Skipping the square root. The formula under the root sign is the squared distance, not the actual distance.
    • Mixing up x and y coordinates. Keep each point's x and y paired correctly before subtracting.
    • Expecting a walking distance. This gives the straight-line ("as the crow flies") distance only, not a route around obstacles.

    Tips and tricks

    • Recognizing a 3-4-5 or 6-8-10 style gap between coordinates lets you find the distance without a calculator.
    • To find the point exactly halfway between two points instead, use the midpoint formula calculator.

    Where you'll use it in real life

    • Mapping: finding how far apart two locations are on a coordinate map.
    • Game development: measuring distance between objects or characters on screen.
    • Geometry: checking the length of a line segment between two plotted points.
    • Data analysis: measuring how "close" two data points are in a scatter plot.

    Quick summary

    To find the distance between two points, subtract their x-coordinates and y-coordinates separately, square both differences, add them, and take the square root. It's the Pythagorean theorem in coordinate form. Use the calculator above to check your own two points instantly.

    Worked example

    On a park map marked out in meters, the entrance is at point (0, 0) and the picnic area is at point (6, 8). How far away is the picnic area in a straight line?

    1. 01d = √[(x₂-x₁)² + (y₂-y₁)²]
    2. 02d = √[(6-0)² + (8-0)²]
    3. 03d = √[6² + 8²]
    4. 04d = √[36 + 64]
    5. 05d = √100
    6. 06d = 10

    These numbers are pre-filled in the calculator above.

    Frequently asked questions

    How is the distance formula related to the Pythagorean theorem?

    The horizontal gap (x₂ - x₁) and vertical gap (y₂ - y₁) between two points form the two legs of a right triangle. The [Pythagorean theorem](/calculator/pythagorean-theorem) then gives the straight-line distance as the hypotenuse.

    Does it matter which point I call point 1 and which I call point 2?

    No. Since both differences get squared, swapping the points gives the exact same distance.

    Can the distance formula give a negative answer?

    No. Distance is always zero or positive, since it comes from a square root of a sum of squares.

    What if both points have the same x-coordinate?

    Then the distance is simply the difference between the y-coordinates, since the x-term becomes zero — the two points lie on a vertical line.

    #Geometry#High School#Distance Formula
    Updated

    Keep reading

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX