Introduction
The Distance Calculator helps you find the distance between two points on a coordinate plane. In geometry, we use the distance formula to measure how far apart two points are. This formula comes from the Pythagorean theorem, which you may already know from working with right triangles. All you need to do is enter the x and y coordinates of two points, and this tool will calculate the exact distance between them. It works great for homework, classwork, or anytime you need a quick and accurate answer. No more solving by hand — just plug in your numbers and get your result in seconds!
How to Use Our Distance Calculator
Enter the coordinates of two points, and this calculator will find the distance between them with a full step-by-step solution. Choose from three modes: 2D, 3D, or Geographic distance.
2D Distance Tab: Enter the X and Y coordinates for Point 1 (X₁, Y₁) and Point 2 (X₂, Y₂). The calculator uses the distance formula to find the straight-line distance between the two points on a flat plane and displays the result on a graph.
3D Distance Tab: Enter the X, Y, and Z coordinates for Point 1 (X₁, Y₁, Z₁) and Point 2 (X₂, Y₂, Z₂). The calculator finds the straight-line distance between two points in three-dimensional space and shows them on a 3D diagram.
Geographic Distance Tab: Enter the latitude and longitude of an origin and a destination to find the real-world distance between two places on Earth. You can type a city or airport name into the search bar to auto-fill the coordinates, or enter them by hand.
Decimal Degrees or DMS: In the Geographic tab, choose whether to enter coordinates as decimal degrees (e.g., 40.7128) or as degrees, minutes, and seconds (e.g., 40° 42' 46.08" N). The calculator handles both formats and keeps them in sync.
Geographic Results: The Geographic tab gives you the distance in kilometers, miles, and nautical miles. It uses Lambert's formula on the WGS-84 ellipsoid for high accuracy and also shows the Haversine result for reference, along with the difference between the two methods.
Calculate and Reset: Click the Calculate button to see your result and a full step-by-step breakdown of the math. Click Reset to return all fields to their default values.
What Is the Distance Formula?
The distance formula is a math rule that tells you how far apart two points are. It comes from the Pythagorean theorem, which says that in a right triangle, the square of the longest side (the hypotenuse) equals the sum of the squares of the other two sides. When you want to find the straight-line distance between two points, you are really finding the length of that hypotenuse.
2D Distance Formula
In two dimensions, every point has an x-coordinate and a y-coordinate. If you have Point 1 at (x₁, y₁) and Point 2 at (x₂, y₂), the distance formula is:
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
You subtract the x-values to find the horizontal gap, subtract the y-values to find the vertical gap, square both gaps, add them together, and take the square root. The answer is the straight-line distance between the two points on a flat surface.
3D Distance Formula
When a third dimension is added, each point also has a z-coordinate for depth or height. The formula extends naturally by including the difference in z-values:
d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
This works the same way as the 2D version but accounts for the extra direction. It is useful in fields like physics, engineering, and 3D modeling where objects exist in space, not just on a flat plane.
Geographic Distance on Earth
Finding the distance between two places on Earth is more complex because Earth is not flat — it is a sphere that is slightly squished at the poles (called an oblate spheroid). Two common methods handle this:
- Haversine formula: This treats Earth as a perfect sphere with a radius of 6,371 km. It uses the latitude and longitude of two locations and applies trigonometry to find the shortest path along the surface (called a great-circle distance). It is simple and works well for most purposes, though it can be off by up to about 0.3%.
- Lambert's formula (Vincenty's method): This uses the WGS-84 ellipsoid model, which matches Earth's true shape more closely. It accounts for the flattening at the poles and is accurate to roughly 10 meters, even over thousands of kilometers. This is the method used by GPS systems and professional surveying.
Latitude and Longitude Formats
Geographic coordinates can be written in two ways. Decimal degrees use a single number like 40.7128° for latitude. Degrees-minutes-seconds (DMS) break it into parts, such as 40° 42' 46.08" N. Both formats describe the same location — decimal degrees are easier for calculations, while DMS is the traditional format seen on maps and in navigation.
Common Uses for Distance Calculations
Distance formulas are used every day in many areas. Students use the 2D and 3D formulas in geometry and algebra classes. Game developers use them to detect collisions and measure spacing between objects. Pilots, ship captains, and delivery companies use geographic distance to plan routes. Scientists use these formulas to track weather patterns, animal migration, and satellite orbits. No matter the scale — whether it is two dots on graph paper or two cities across an ocean — the core idea remains the same: find the straight-line gap between two known points.
Related Calculators
If you found this Distance Calculator useful, you may also want to try some of our other geometry and math tools. Use the Midpoint Calculator to find the exact center point between two coordinates, or the Slope Calculator to determine the steepness of the line connecting two points. For problems involving parabolas and equations, our Quadratic Formula Calculator can help you find roots quickly. You can also explore the Rate of Change Calculator to analyze how values shift over a given interval, the Percentage Calculator for quick ratio and proportion work, or the Percent Error Calculator to measure the accuracy of your results. For physics applications that build on distance concepts, check out the Displacement Calculator, the Projectile Motion Calculator, or the Free Fall Calculator. If you're working with areas and measurements for real-world projects, our Square Footage Calculator is a handy companion.