
Distance Calculator
Calculate the exact distance between two points in a 2D plane, 3D space, or across the Earth's surface using our fast and accurate Distance Calculator.
Result
d = 26.19637
There was an error with your calculation.
Last updated: June 26, 2026
Table of Contents
- How to Use the Distance Calculators
- 2D Distance Calculator
- 3D Distance Calculator
- Distance Between Coordinates Calculator - Distance Based on Latitude and Longitude
- Map Distance Calculator: Distance Between Two Points on a Map
- Distance Formulas
- Calculating Geographical Distance Based on Latitude and Longitude
- Real-Life Applications of Distance Calculation
Welcome to our comprehensive suite of Distance Calculators. Whether you need to find the distance between two points in a two-dimensional space (2D plane) or three-dimensional space (3D space), or calculate the precise geographical distance between two places using latitude and longitude coordinates on a world map, our tools have you covered.
This page features three specialized calculators:
- 2D Distance Calculator
- 3D Distance Calculator
- Distance Between Coordinates Calculator
Bonus functionality: The 2D Distance Calculator goes a step further by helping you determine the exact line equation, slope, and angle of the line connecting your two chosen points.
How to Use the Distance Calculators
2D Distance Calculator
This tool computes the exact distance between two points on a 2D Cartesian plane: Point 1 with coordinates (X₁, Y₁) and Point 2 with coordinates (X₂, Y₂). To find the distance between your two points, simply enter the coordinates for both (X₁, Y₁, X₂, Y₂) into the designated fields and click “Calculate.”
The calculator will instantly return the final answer, provide a detailed step-by-step solution algorithm, and generate a clear graphical representation of the points on the coordinate plane. Additionally, the tool will calculate the slope and angle of the connecting line, determining the corresponding line equation for you.
3D Distance Calculator
Use this tool to find the spatial distance between two points in a 3D coordinate space: Point 1 with coordinates (X₁, Y₁, Z₁) and Point 2 with coordinates (X₂, Y₂, Z₂). To execute the calculation, input the exact coordinates for both points (X₁, Y₁, Z₁, X₂, Y₂, Z₂) into the corresponding fields and press “Calculate.” The calculator will promptly display the final result alongside a comprehensive breakdown of the mathematical steps.
To reset the form and empty all fields, simply press “Clear.”
Distance Between Coordinates Calculator - Distance Based on Latitude and Longitude
This geographical calculator helps you find the precise distance between two locations on the Earth's surface using their known coordinates (latitude and longitude). It calculates the distance between Point 1 (Latitude 1, Longitude 1) and Point 2 (Latitude 2, Longitude 2) based on the highly accurate assumption that the Earth's shape is an ellipsoid. We utilize Lambert’s formulas to guarantee maximum precision in these geographical calculations.
To use this latitude and longitude distance calculator, input your known values for Latitude 1, Longitude 1, Latitude 2, and Longitude 2 into the respective fields, and press “Calculate.” The tool will automatically generate the geographic distance between the two points in both kilometers and miles.
Input values
You can enter your geographical coordinates using two distinct formats:
- Degree-minute-second format, followed by a compass direction from the convenient drop-down menus – N(orth) or S(outh) for Latitude, and E(ast) or W(est) for Longitude. Note that valid latitudes must be represented by values between -90 and 90, while longitudes must fall between -180 and 180.
- Decimals without a compass direction. In this format, the mathematical sign of the value dictates the compass direction: Latitude is positive in the North (above the equator) and negative in the South. Longitude is positive in the East (of the Prime Meridian) and negative in the West. As with the previous format, latitudes should be represented by values between -90 and 90, and longitudes by values between -180 and 180.
To reset the calculator and empty all fields, simply press “Clear.”
Map Distance Calculator: Distance Between Two Points on a Map
This interactive map distance calculator also determines the distance between two points on the Earth's surface. It operates under the same accurate assumption that the Earth is an ellipsoid, employing Lambert’s formulas for all geographical measurements.
To use this tool, simply select two points directly on the provided interactive map. The calculator will automatically extract the decimal coordinates of your chosen locations and instantly compute the precise distance in both kilometers and miles.
Note: All of our distance calculators fully support integers, decimals, and numbers in e-notation as valid inputs.
Distance Formulas
In all of the mathematical equations presented below, the calculated distance is represented by the variable d.
2D distance formula

The shortest distance between two points with coordinates (X₁, Y₁) and (X₂, Y₂) on a two-dimensional plane is calculated using the principles of the Pythagorean theorem. The standard 2D distance formula is:
$$d=\sqrt{(X₂ - X₁)²+(Y₂ - Y₁)²}$$
3D distance formula
The standard 2D formula can be easily extrapolated into three dimensions to find the distance between Point 1 (X₁, Y₁, Z₁) and Point 2 (X₂, Y₂, Z₂). The 3D distance equation is as follows:
$$d=\sqrt{(X₂ - X₁)²+(Y₂ - Y₁)²+(Z₂ - Z₁)²}$$
Calculating Geographical Distance Based on Latitude and Longitude
In this section, we use specific mathematical symbols to represent coordinates: ϕ stands for latitude, and λ stands for longitude. A specific location defined by Latitude 1 and Longitude 1 is described mathematically as (ϕ₁, λ₁).
To accurately calculate the geographical distance between two points on Earth, we must measure the distance along the planet's curved surface. Therefore, we have to choose an appropriate mathematical approximation for the shape of the Earth. The three most common approximations in cartography are:
- Flat surface. This approach works reasonably well for very short distances, allowing you to use the standard 2D distance formula. However, to account for the variation in distance between meridians when projecting the Earth’s spherical surface onto a flat plane, several further complex approximations are required.
- Spherical surface. This formula is based on the assumption that the Earth’s shape is a perfect sphere. By utilizing spherical trigonometry, we can derive a much more precise equation suitable for considerable distances, maintaining a high accuracy rate with a margin of error of only about 5%. This is widely known as the great-circle distance formula, or the haversine formula, because its derivation relies on the haversine—a specialized trigonometric function. A haversine of angle θ is defined as follows: $hav\ θ=\frac{(1-cosθ)}{2}$. Using this, the haversine formula for calculating the distance between two points with coordinates (ϕ₁, λ₁) and (ϕ₂, λ₂) looks like this:
$$d=2r\ arcsin\sqrt{hav(φ₂-φ₁ )+(1-hav(φ₁-φ₂ )-hav(φ₁+φ₂ ))× hav(λ₂-λ₁)}$$
$$d=2r\ arcsin\left(\sqrt{sin²\left( \frac{φ₂-φ₁}{2} \right)+cos\ φ₁×cos\ φ₂ × sin²\left( \frac{λ₂-λ₁}{2} \right)}\right)$$
Where r is the radius of the sphere being measured (in our case, the average radius of the Earth).
- Ellipsoidal surface. This approximation is the most precise method available, as the actual shape of the Earth is an oblate spheroid (closer to an ellipsoid than a perfect sphere). The shortest path connecting two points on the surface of an ellipsoid is known as the geodesic. The precise length of that path is calculated using Lambert’s formulas. These highly accurate equations use reduced latitudes, β₁ and β₂, instead of the standard ϕ₁ and ϕ₂. The conversion is: tan β = (1 - f) × tan ϕ, where f represents the Earth's flattening. The exact distance is found using the following calculation:
d = a (σ – f/2(X + Y))
Where a is the equatorial radius of the ellipsoid (the Earth), and σ is the central angle between point 1 (β₁, λ₁) and point 2 (β₂, λ₂) in radians. This central angle is calculated using the haversine formula described above, operating on the assumption that longitudes remain consistent whether plotted on a sphere or a corresponding ellipsoid. The variables X and Y are calculated using the following advanced formulas:
$$X=(σ-sinσ)\frac{sin²P\ cos²Q}{cos²\frac{σ}{2}}$$
$$Y=(σ-sinσ)\frac{cos²P\ sin²Q}{sin²\frac{σ}{2}}$$
where, P = (β₁ + β₂)/2 and Q = (β₂ – β₁)/2
Real-Life Applications of Distance Calculation
When we talk about measuring distance, we typically refer to 2D or 3D spatial distances. Everyday examples of these calculations include:
- Finding the precise distance between the back of a queue and the front (a classic straight-line or 1D/2D scenario).
- Calculating the exact length of a snowy hill's slope before skiing down.
- Determining the vast astronomical distances between the sun and the various planets within our solar system.
Conversely, calculating distance based on latitude and longitude—or determining the map distance between two distinct points—is heavily utilized in real-world navigation and logistics. For instance, commercial airlines constantly use these geographical measurements to calculate the optimal flight path from point A to point B. Because an airplane travels along the actual curved, ellipsoidal surface of the Earth, this aviation scenario perfectly demonstrates Lambert’s formulas in action!



