Distance Calculator

Distance Calculator

Calculate the distance between two points on Earth by entering their latitude and longitude coordinates. This distance calculator gives you the shortest great-circle distance in miles, kilometers, and nautical miles, plus the initial compass direction from the first point toward the second.

The calculator is designed for geographic coordinates. It measures direct surface distance rather than road mileage, so the result may differ from the distance you would actually drive between the same locations.

Free to useInstant calculationTransparent formulas
Distance Calculator
Calculate the straight-line distance between two points on Earth using latitude and longitude coordinates. The calculator uses the great-circle distance method to measure the shortest path across Earth’s surface.
Simple by design

Calculate in three steps

Choose the right tool, enter your locations or coordinates, and receive a clearly explained result.

1

Choose a calculator

Select coordinate, driving, address, map, radius, or midpoint measurement.

2

Enter your points

Provide coordinates, addresses, locations, or click directly on the map.

3

Review the result

See distance units, direction, travel estimates, or geographic output instantly.

Engineered for clarity,
built around real tasks.
Multiple distance methodsStraight-line, road network, map, radius, and midpoint calculations.
Explanations includedEvery primary tool documents its mathematics and limitations.
Independent calculatorsEach tool stays focused on one specific measurement problem.
A clearer path through distance

Learn what your result really means

Start with the essentials, then explore the method, units, accuracy, and practical limits behind the calculation.

Choose the right measurement

One distance question can have different answers

The best calculator depends on whether you need a direct geographic line, a road route, or an area around one point.

Straight-line distance

The shortest path across Earth's surface between two coordinates—the method used by the main calculator.

Use the main calculator

Driving distance

The route you can travel by road, with mileage and an estimated travel time between locations.

Calculate a road route

Radius coverage

Every point within a fixed direct distance of one selected map location, including approximate area.

Draw a map radius

How to Use the Distance Calculator

Enter the latitude and longitude for both points, then select Calculate Distance.

  1. Enter the latitude for Point 1.
  2. Enter the longitude for Point 1.
  3. Enter the latitude for Point 2.
  4. Enter the longitude for Point 2.
  5. Select Calculate Distance.

The result shows:

  • distance in miles;
  • distance in kilometers;
  • distance in nautical miles;
  • the general initial direction from Point 1 toward Point 2.

For example, New York City can be represented approximately by:

Latitude: 40.7128
Longitude: -74.0060

Los Angeles can be represented approximately by:

Latitude: 34.0522
Longitude: -118.2437

Entering those two coordinate pairs gives a great-circle distance of about 2,445.56 miles, or 3,935.75 kilometers.

If you are trying to understand the mathematics of finding the distance between two points, that guide explains how geographic and Cartesian point calculations differ.

What Type of Distance Does This Calculator Calculate?

This calculator measures the great-circle distance between two latitude and longitude coordinates.

Great-circle distance is the shortest path between two points along the surface of a sphere. Because Earth is curved, calculating geographic distance this way is more appropriate than applying a simple flat-plane distance formula to latitude and longitude values.

This measurement is often described as straight-line distance, air distance, or as-the-crow-flies distance. You can explore that concept in more detail in our guide to as-the-crow-flies distance.

The calculator does not follow roads, highways, bridges, or other transportation routes.

If your real question is how far you would travel by car, use the Driving Distance Calculator instead.

How Does the Distance Calculator Work?

The calculator uses the Haversine formula to determine the angular separation between the two coordinate points and then converts that angular separation into distance using a spherical Earth radius of 6,371 kilometers.

The process is:

  1. Convert latitude and longitude from degrees to radians.
  2. Calculate the difference in latitude.
  3. Calculate the difference in longitude.
  4. Apply the Haversine equation.
  5. Calculate the central angle between the two points.
  6. Multiply the angle by the assumed Earth radius.
  7. Convert the kilometer result into miles and nautical miles.

The mathematical implementation used by this calculator is:

Δφ = φ₂ − φ₁
Δλ = λ₂ − λ₁

a = sin²(Δφ / 2)
    + cos(φ₁) × cos(φ₂) × sin²(Δλ / 2)

c = 2 × atan2(√a, √(1 − a))

Distance = R × c

Where:

  • φ₁ is the latitude of Point 1;
  • φ₂ is the latitude of Point 2;
  • λ₁ is the longitude of Point 1;
  • λ₂ is the longitude of Point 2;
  • R is the assumed radius of Earth;
  • c is the central angle between the points.

The calculator uses R = 6,371 km.

For a step-by-step explanation of why this equation works, see our Haversine formula guide.

Why Are Latitude and Longitude Converted to Radians?

The trigonometric functions used in the Haversine calculation operate on angles measured in radians.

The conversion from degrees to radians is:

Radians = Degrees × π / 180

For example:

40° × π / 180 ≈ 0.6981 radians

The calculator performs this conversion automatically. You enter ordinary decimal-degree coordinates, and the JavaScript calculation converts them internally before applying the formula.

How Does the Calculator Convert Kilometers to Miles?

The Haversine calculation first produces a distance in kilometers because the calculator uses an Earth radius expressed in kilometers.

The source code then converts that value using:

Miles = Kilometers × 0.621371

It also calculates nautical miles using:

Nautical Miles = Kilometers × 0.539957

For the New York City to Los Angeles example:

Kilometers:     3,935.75 km
Miles:          2,445.56 miles
Nautical miles: 2,125.13 nm

These are three unit representations of the same geographic distance.

Miles

Miles are commonly used for general distance and road travel in the United States.

Kilometers

Kilometers are the standard metric unit for longer geographic distances.

Nautical Miles

Nautical miles are commonly used in marine and aviation navigation.

Example: Distance From New York City to Los Angeles

Using these approximate coordinates:

Location Latitude Longitude
New York City 40.7128 -74.0060
Los Angeles 34.0522 -118.2437

the calculator produces approximately:

Result Value
Distance 3,935.75 km
Distance 2,445.56 miles
Distance 2,125.13 nautical miles
Initial bearing 273.69°
Displayed direction West

The mileage above is not driving mileage. It represents the shortest great-circle path between the two coordinate points using the calculator's spherical Earth model.

For a detailed explanation of why road mileage can be longer, read Driving Distance vs Straight-Line Distance.

What Does the Direction Result Mean?

The calculator determines an initial bearing from Point 1 toward Point 2 and converts that bearing into one of eight general compass directions.

Bearings are measured clockwise from north:

Bearing Direction
North
90° East
180° South
270° West

The calculator groups the full 360-degree range into:

  • North
  • Northeast
  • East
  • Southeast
  • South
  • Southwest
  • West
  • Northwest

The New York City to Los Angeles example produces an initial bearing of approximately 273.69°, which the calculator classifies as West.

The direction describes the initial geographic bearing from the first coordinate. It is not a driving direction and should not be interpreted as turn-by-turn navigation.

What Is the Difference Between Straight-Line Distance and Driving Distance?

Straight-line geographic distance measures the shortest surface path between coordinates, while driving distance follows the available road network.

Road travel may need to follow:

  • highways;
  • local streets;
  • bridges;
  • mountain passes;
  • border crossings;
  • permitted routes.

That means two places can be relatively close geographically while requiring a much longer road journey.

Use this calculator when you want direct geographic separation.

Use the Driving Distance Calculator when you want road mileage and estimated route duration.

Our guide to how driving distance is calculated explains how route-based distance differs from a coordinate-based calculation.

Can You Calculate the Distance Between Two Locations?

Yes. Two geographic locations can be compared with this calculator when you know the latitude and longitude coordinates representing each location.

A location may be:

  • a city;
  • a landmark;
  • a GPS position;
  • an airport;
  • a point selected from a map;
  • another geographic coordinate.

If you want a deeper explanation of how geographic places are represented and compared, read Distance Between Two Locations.

This calculator does not currently convert place names into coordinates automatically.

For a calculator where you can enter locations directly and obtain a road route, use the Driving Distance Calculator.

Can You Calculate Distance Between Two Addresses?

This calculator requires coordinates rather than street addresses.

If you have two addresses, use the Distance Between Addresses Calculator. That calculator first converts the addresses into geographic coordinates and then provides straight-line distance, driving distance, and estimated route time.

If you want to understand how an address becomes a coordinate pair, our guide to finding latitude and longitude from an address explains the geocoding process.

What Latitude and Longitude Values Should You Enter?

Latitude normally ranges from:

-90° to +90°

Longitude normally ranges from:

-180° to +180°

Positive latitude values indicate locations north of the Equator. Negative latitude values indicate locations south of the Equator.

Positive longitude values indicate locations east of the Prime Meridian. Negative longitude values indicate locations west of the Prime Meridian.

For example:

New York City
40.7128, -74.0060

The negative longitude indicates that New York City is west of the Prime Meridian.

The calculator expects decimal degrees.

What If You Do Not Know the Coordinates?

If you know approximately where the two points are but do not have their latitude and longitude, use the Map Distance Calculator.

The map tool lets you select two points visually and calculates the direct distance between those clicked coordinates.

If you have a street address instead, use the Distance Between Addresses Calculator.

This separation keeps each calculator focused on a different user task:

What you have Best tool
Two latitude/longitude coordinates Distance Calculator
Two street addresses Distance Between Addresses Calculator
Two places for road travel Driving Distance Calculator
Two points you want to select visually Map Distance Calculator

Is Great-Circle Distance the Same as Distance on a Flat Map?

No. A flat-map calculation and a great-circle calculation use different geometric assumptions.

A simple Cartesian calculation treats points as though they lie on a flat plane. Geographic coordinates describe positions on Earth's curved surface, so long-distance calculations require a spherical or ellipsoidal geographic model.

For ordinary x/y coordinates, the relevant mathematics is explained in our Euclidean distance formula guide.

For a broader overview of the different formulas used to calculate distance, see the Distance Formula hub.

How Accurate Is the Distance Calculator?

The calculator provides a great-circle distance based on a spherical Earth model with a radius of 6,371 km.

This is appropriate for general geographic calculations, but several limitations matter.

Earth Is Not a Perfect Sphere

The Haversine calculation assumes a spherical Earth. The real Earth is better represented by an oblate ellipsoid, so a more advanced geodesic calculation can produce a slightly different result.

Coordinate Accuracy Affects the Result

The result can only be as representative as the coordinates you enter.

A coordinate could refer to:

  • the center of a city;
  • an airport reference point;
  • a building;
  • a map marker;
  • a ZIP code centroid;
  • another chosen location.

Changing the coordinates changes the distance.

Straight-Line Distance Is Not Route Distance

The calculation does not account for roads, traffic, terrain, bridges, borders, weather, or transportation restrictions.

For route-based travel, use the Driving Distance Calculator.

It Is Not a Surveying Tool

The calculator is suitable for general geographic distance calculations and educational use. It should not replace professional surveying or precision geodesic software when centimeter-level or survey-grade accuracy is required.

When Should You Use the Distance Calculator?

Use this calculator when your main question is:

How far apart are these two geographic coordinates?

Typical uses include:

  • comparing two GPS positions;
  • checking direct distance between locations;
  • estimating geographic separation between cities;
  • calculating approximate air distance;
  • checking a Haversine calculation;
  • comparing coordinates from mapping data.

If your task changes, use the calculator designed for that job.

To measure distance by clicking directly on a map, use the Map Distance Calculator.

To find road mileage, use the Driving Distance Calculator.

To calculate distance between street addresses, use the Distance Between Addresses Calculator.

To find the geographic halfway point between two coordinates, use the Midpoint Calculator.

How Do You Find the Halfway Point Between the Same Coordinates?

Distance tells you how far apart the two points are. A midpoint calculation answers a different question: where is the geographic halfway point between them?

Our Midpoint Calculator uses the two coordinate pairs to calculate a geographic midpoint.

This distinction matters because the midpoint between two coordinates is not automatically the best road-trip stopping point or meeting location.

For city-based applications, see How to Find the Halfway Point Between Two Cities.

Frequently Asked Questions

What does a distance calculator do?

A distance calculator determines how far apart two points are. This calculator specifically measures the great-circle distance between two latitude and longitude coordinate pairs and displays the result in miles, kilometers, and nautical miles.

How do I calculate distance between two points?

Enter the latitude and longitude coordinates for both points and select Calculate Distance. The calculator converts the coordinates to radians and applies the Haversine formula to determine their great-circle distance.

For the broader mathematics behind different point types, see how to calculate the distance between two points.

Can I calculate distance in miles and kilometers?

Yes. The calculator displays the same result in kilometers, statute miles, and nautical miles.

Does the calculator show driving distance?

No. This calculator measures direct great-circle distance between geographic coordinates. Use the Driving Distance Calculator when you need road mileage.

Can I enter city names instead of coordinates?

No. This calculator currently requires latitude and longitude values. For route calculations using place names, use the Driving Distance Calculator.

Can I enter street addresses?

No. Use the Distance Between Addresses Calculator when your starting point and destination are addresses.

Can I select the points from a map?

Use the Map Distance Calculator if you prefer to select the two points visually instead of entering coordinates manually.

Why is the calculated distance shorter than my road trip?

The calculator measures the shortest great-circle path between the coordinate points. Driving routes must follow the road network, so the actual travel distance can be longer.