Distance Calculator
Find the straight-line distance between two coordinate points using the distance formula, with a plotted diagram and full step-by-step solution.
Enter the coordinates of Point 1 (x₁, y₁) and Point 2 (x₂, y₂) to find the straight-line distance between them.
Coordinate Plane Diagram
Both points, the connecting segment, and the Δx / Δy right-triangle legs used to find it.
Step-by-Step Solution
Here's exactly how this answer was calculated, one step at a time.
- 1
Identify the two points
(x₁, y₁) = (1, 2), (x₂, y₂) = (5, 6)
Label the first point's coordinates x₁, y₁ and the second point's coordinates x₂, y₂.
- 2
Find the horizontal distance (Δx)
Δx = x₂ − x₁ = 5 − 1 = 4
This is how far apart the two points are along the x-axis.
- 3
Find the vertical distance (Δy)
Δy = y₂ − y₁ = 6 − 2 = 4
This is how far apart the two points are along the y-axis.
- 4
Square each difference
Δx² = 4² = 16, Δy² = 4² = 16
Squaring removes any negative signs, matching the Pythagorean theorem's a² + b² = c² pattern.
- 5
Add the squares
Δx² + Δy² = 16 + 16 = 32
This sum represents the squared length of the straight-line segment joining the two points.
- 6
Take the square root to find the distance
d = √32 = 5.6569
The square root gives the actual straight-line distance between the two points.
✓ Final Answer: Distance d = 5.6569
Free Online Distance Calculator
This distance calculator finds the exact straight-line distance between any two points on a coordinate plane. Simply enter the x and y coordinates of both points, and the calculator instantly returns the distance, along with a plotted diagram and a complete step-by-step solution showing exactly how the distance formula was applied.
Whether you're a student solving coordinate geometry or algebra problems, a teacher preparing worked examples, a game or graphics developer measuring distances between screen coordinates, or a GIS analyst calculating separation between mapped points, this distance formula calculator handles the entire calculation for you — no manual squaring, adding, or square-rooting required.
The Distance Formula
The distance formula for two points on a coordinate plane is derived directly from the Pythagorean theorem, treating the horizontal and vertical separation between the points as the two legs of a right triangle:
- Distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²)
- Horizontal difference: Δx = x₂ − x₁
- Vertical difference: Δy = y₂ − y₁
- The distance is the hypotenuse of the right triangle formed by Δx and Δy: d² = Δx² + Δy²
How to Use This Distance Calculator
Using the calculator takes just two steps. First, enter the coordinates of Point 1 (x₁, y₁) and Point 2 (x₂, y₂) into the four input fields. Second, read the results: the calculator instantly displays Δx, Δy, and the final distance, along with a coordinate-plane diagram showing both points, the straight-line segment between them, and dashed orange and blue lines marking the Δx and Δy legs that form the underlying right triangle.
Because the diagram is drawn to scale from your actual coordinates, you can visually confirm the result: the green line is the distance you're solving for, and it's always the longest side (the hypotenuse) of the dashed right triangle formed by the horizontal and vertical legs.
Worked Example
Suppose Point 1 is at (1, 2) and Point 2 is at (5, 6). First find the differences: Δx = 5 − 1 = 4 and Δy = 6 − 2 = 4. Squaring each gives Δx² = 16 and Δy² = 16, and adding them gives 16 + 16 = 32. Taking the square root gives d = √32 ≈ 5.66 units.
This same process works for any pair of coordinates, including negative values — the squaring step in the formula automatically removes any negative signs, so it doesn't matter which point you label as Point 1 or Point 2; the distance between them comes out the same either way.
How the Distance Formula Relates to the Pythagorean Theorem
The distance formula is really just the Pythagorean theorem, a² + b² = c², written in coordinate-geometry language. Δx plays the role of leg a, Δy plays the role of leg b, and the distance d plays the role of the hypotenuse c. Drawing a horizontal line from Point 1 and a vertical line from Point 2 (or vice versa) always creates a right angle where they meet, which is exactly why this formula works for any two points on a flat coordinate plane.
Where the Distance Formula Is Used
Finding the distance between two coordinate points is one of the most widely used calculations in mathematics, science, and technology:
- Students and teachers use it constantly in coordinate geometry, algebra, and pre-calculus coursework.
- Game developers and computer graphics programmers use it to measure distances between objects, detect collisions, and control movement on screen.
- GIS analysts, surveyors, and mapping applications use it to calculate straight-line distances between mapped or GPS coordinates.
- Physics and engineering problems use the same formula to find displacement between two positions in a 2D system.
- Data scientists use a generalized version of this formula (Euclidean distance) to measure similarity between data points in machine learning.
Frequently Asked Questions
What is the distance formula?
The distance formula finds the straight-line distance between two points on a coordinate plane: d = √((x₂ − x₁)² + (y₂ − y₁)²), where (x₁, y₁) and (x₂, y₂) are the two points.
Does it matter which point I label as Point 1 or Point 2?
No. Because the formula squares both differences (Δx and Δy), any negative sign is removed automatically, so the calculated distance is identical no matter which point you call Point 1 or Point 2.
How is the distance formula related to the Pythagorean theorem?
The distance formula is the Pythagorean theorem applied to coordinates. Δx and Δy form the two legs of a right triangle, and the distance between the points is the hypotenuse, so d² = Δx² + Δy² is exactly a² + b² = c².
Can this calculator handle negative coordinates?
Yes. Enter negative x or y values exactly as they are — the formula's squaring step handles negative differences correctly, giving the same accurate distance.
What units will the distance be in?
The distance is returned in whatever unit your coordinates are already using — if your x and y values are in meters, the distance is in meters; if they're pixels, the distance is in pixels, and so on.