A distance calculator finds the straight-line distance between two points using the distance formula, the square root of the squared horizontal change plus the squared vertical change. It comes straight from the Pythagorean theorem. From the point (0, 0) to the point (3, 4), the distance works out to exactly 5 units.
Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.
Saved results (0)
How to Use the Distance Calculator
- Enter the x and y of the first point.
- Enter the x and y of the second point.
- Read the distance, the straight line between them.
- See the horizontal and vertical change that make up that line.
Here is what each result means:
| Result | What it means |
|---|---|
| Distance | The straight-line length between the two points. |
| Horizontal change | The difference in the x coordinates. |
| Vertical change | The difference in the y coordinates. |
What Is the Distance Between Two Points?
The distance between two points is the length of the straight line joining them. On a coordinate grid, it is found from the horizontal and vertical gaps between the points using the distance formula. From (0, 0) to (3, 4), the distance is 5.
This is really the Pythagorean theorem in disguise. The horizontal and vertical changes are the two legs of a right triangle, and the distance is its hypotenuse. That link makes the distance formula easy to remember and applies to maps, physics and computer graphics alike.
The result is always positive or zero, because a length cannot be negative. It does not matter which point you call first, and swapping them leaves the distance unchanged. What matters is the size of the gap in each direction, since those two gaps set the length of the line between the points.
How Does the Distance Calculator Work?
It squares the horizontal and vertical changes, adds them, and takes the square root.
- Subtract the x values for the horizontal change, and the y values for the vertical change.
- Square each change and add them.
- Take the square root of the total for the distance.
Because the two changes form a right triangle, the Pythagorean theorem calculator gives the same length from the legs.
Distance Example
Find the distance from (0, 0) to (3, 4).
Calculation: the horizontal change is 3 and the vertical change is 4, so d = sqrt(3^2 + 4^2) = sqrt(9 + 16) = sqrt(25) = 5. The two points are exactly 5 units apart, the classic 3-4-5 right triangle.
Distance vs Horizontal and Vertical Change
The straight-line distance is always at least as long as either single change, and never longer than their sum.
| From to | dx, dy | Distance |
|---|---|---|
| (0,0) to (3,4) | 3, 4 | 5 |
| (0,0) to (5,0) | 5, 0 | 5 |
| (1,1) to (4,5) | 3, 4 | 5 |
| (0,0) to (1,1) | 1, 1 | 1.4142 |
When one change is zero, the distance equals the other change, since the line lies straight along an axis.
Distance and the Pythagorean Theorem
The distance formula and the Pythagorean theorem are the same idea in two guises.
| Concept | Role |
|---|---|
| Horizontal change | One leg of the right triangle |
| Vertical change | The other leg |
| Distance | The hypotenuse |
So if you can use the Pythagorean theorem, you already know the distance formula.
What Affects the Distance
The Gaps in Each Direction
Larger horizontal or vertical gaps make a longer line. Both count toward the total through their squares.
Diagonal Versus Straight
A diagonal path is longer than either axis gap alone but shorter than walking along both, the triangle inequality.
The Order of the Points
Swapping the two points does not change the distance, since squaring removes the sign of each change.
When to Use a Distance Calculator
Geometry Homework
Find the length of a segment between two coordinates.
Maps and Design
Measure straight-line gaps on a grid, plan or screen layout.
Physics and Graphics
Compute how far apart two positions are for motion or collision checks.
Common Mistakes
1. Forgetting to Square
Each change must be squared before adding. Adding the raw changes gives the wrong length.
2. Skipping the Square Root
The sum of squares is the distance squared. Take the square root for the actual distance.
3. Sign Slips with Negatives
Subtracting a negative coordinate adds. Track the signs, though squaring fixes the final sign.
4. Mixing Up the Coordinates
Pair x with x and y with y. Crossing them changes the answer.
5. Using It on a Globe
The formula assumes a flat plane. Long distances on Earth need a great-circle method instead.
Accuracy and Limitations
The distance formula is exact; only the displayed decimals are rounded.
What it calculates accurately
- Straight-line distance on a plane
- The horizontal and vertical change
- The midpoint between the points
What it does not do
- Measure distance on a curved surface
- Handle three-dimensional points
- Follow a road or path, only the straight line
- Draw the segment to scale
How We Find Your Distance
Frequently Asked Questions
How do you find the distance between two points?
Subtract the x values and the y values, square each result, add them, and take the square root. From (0, 0) to (3, 4), that is the square root of 9 plus 16, which is 5.
What is the distance formula?
It is d equals the square root of the squared horizontal change plus the squared vertical change. It comes straight from the Pythagorean theorem applied to the two coordinate gaps.
Is the distance formula the same as the Pythagorean theorem?
Yes, in effect. The horizontal and vertical changes are the two legs of a right triangle, and the distance is the hypotenuse, so the distance formula is the theorem written for coordinates.
Does the order of the points matter?
No. Swapping the two points gives the same distance, because each change is squared, which removes its sign. Distance is always positive or zero.
What if the two points are the same?
The distance is zero. Both changes are zero, so the square root of zero is zero. The tool reports this case directly.
Can I use it for distance on a map of the Earth?
Only for short distances where the ground is nearly flat. Long distances on the globe follow a curved great-circle path and need a different formula.
How is distance different from displacement?
Distance here is the straight-line length between two points and is always positive. Displacement in physics also has a direction, though its size equals this distance.
Does this handle three-dimensional points?
This tool works in two dimensions. In three dimensions you add the squared change in z under the same square root before taking the root.
Is my information saved?
No. The calculation runs in your browser and nothing you enter is stored or sent anywhere, unless you choose Save, which keeps the result only on this device.
Sources
- Distance (Wikipedia).
- The distance between two points (Maths Is Fun).
- Pythagorean theorem (Wikipedia).
Related Guides
Related Calculators
Looking for more math tools?
Explore all math calculatorsThis calculator finds the straight-line distance between two points on a plane. It uses the distance formula, which assumes flat coordinates, not curved surfaces such as the globe. Results are rounded for display. Spotted an error? Let us know.
Author
Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.




