Skip to main content

Distance Formula Calculator for Two Points

Quick answer

d=√((x₂−x₁)²+(y₂−y₁)²): points (1,2) and (4,6) are exactly 5 units apart since √(3²+4²)=5.

  • Midpoint and 3D form included.

Figures are estimates from this calculator’s standard formula — adjust the inputs in the tool below for your exact number.

How the Distance Formula Calculator Works

d = √((x₂−x₁)² + (y₂−y₁)²) | Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2)

The distance formula is the Pythagorean theorem in coordinate clothing. For points (1,2) and (4,6), the horizontal leg is Δx = 4−1 = 3 and the vertical leg is Δy = 6−2 = 4, so the straight-line distance is √(3²+4²) = √25 = 5. The calculator prints both legs, squares them, sums and roots — every intermediate value. It also returns the midpoint ((1+4)/2, (2+6)/2) = (2.5, 4), handy for geometry proofs and for locating the center between two locations. The same computation generalizes to 3D by adding (z₂−z₁)² under the root, and to map coordinates once you know the scale. Because it reduces to a²+b²=c², any 3-4-5 or 5-12-13 triangle can be recognized instantly from its coordinates.

  1. 1

    Enter both points

    Type (x₁,y₁) and (x₂,y₂) for the two endpoints

  2. 2

    Compute the legs

    Δx = x₂−x₁ and Δy = y₂−y₁ are displayed

  3. 3

    Apply Pythagoras

    Square, sum and take the square root for d

  4. 4

    Read the midpoint

    Average the coordinates: ((x₁+x₂)/2, (y₁+y₂)/2)

Use Cases

Geometry Homework

Side lengths of polygons from vertex coordinates, e.g. verifying a 3-4-5 triangle

Route Estimation

Straight-line distance between two map grid references before road routing

Game Development

Collision and targeting checks between sprite coordinates

Tips

  • 1

    Squaring kills the sign of Δx and Δy, so point order never matters

  • 2

    A 3-4-5 coordinate pair like (1,2)→(4,6) signals a right angle

  • 3

    Distance is symmetric: d(P,Q) = d(Q,P)

Common Mistakes

  • Subtracting mixed directions, e.g. x₂−x₁ for one leg and y₁−y₂ for the other

  • Forgetting to square before adding, computing √3+4 instead of √(9+16)

  • Mixing up distance with slope — slope is Δy/Δx, distance is the hypotenuse

  • Averning coordinates without dividing by 2 when finding the midpoint

FAQs

What is the distance between (1,2) and (4,6)?

Δx=3, Δy=4, so d=√(9+16)=5 units.

How do I find the midpoint?

Average each coordinate: ((1+4)/2, (2+6)/2) = (2.5, 4).

Does point order matter?

No. Squaring makes signs irrelevant: (4−1)² and (1−4)² both equal 9.

How does this relate to Pythagoras?

The two legs Δx and Δy form a right triangle; d is its hypotenuse, so d² = Δx² + Δy².

How do I extend it to 3D?

Add the z-leg: d = √(Δx² + Δy² + Δz²). Points (0,0,0) and (2,3,6) are 7 units apart.