Skip to main content

Calcu.fit

Distance Calculator: Between Two Points, Two Locations, or from Speed and Time

Use this free distance calculator to find a distance in three ways. Find the distance between two points on a graph, find the straight-line distance between two places from their latitude and longitude, or find the distance you travel from your speed and time. The result is shown in kilometers, miles, meters, feet, and nautical miles. No signup needed.

Distance Calculator

Calculate distance between two points, two geographic locations, or using speed and time.

Point 1

Point 2

Enter positive or negative coordinates. All coordinates must use the same unit.

Location 1

Location 2

Use negative latitude for south and negative longitude for west. This calculates straight-line great-circle distance, not road distance.

Calculation Results

Distance—

Formula & Calculation Steps

Distance Unit Conversions

Kilometers—
Miles—
Meters—
Feet—
Nautical Miles—

Common Distance Formulas

2D: d = √[(x₂ − x₁)² + (y₂ − y₁)²]
3D: d = √[Δx² + Δy² + Δz²]
Geographic: d = 2R × asin(√a)
Distance = Speed × Time
Speed = Distance ÷ Time
Time = Distance ÷ Speed

Earth's mean radius is approximately 6,371 kilometers.

How to Use This Distance Calculator

Between two points (x, y):

  1. Choose “Two points.”
  2. Enter the coordinates (x₁, y₁) and (x₂, y₂), and z for 3D, if needed.
  3. Click Calculate.

Between two locations (latitude and longitude):

  1. Choose “Latitude and longitude.”
  2. Enter the latitude and longitude of the two places, in decimal degrees. Use negative numbers for south and west.
  3. Click Calculate to see the straight-line distance.

From speed and time:

  1. Choose “Speed and time.”
  2. Enter any two of distance, speed, and time to find the third.
  3. Click Calculate.

What You’ll See in Your Results

  • The distance in kilometers, miles, meters, feet, and nautical miles
  • For coordinates: the midpoint and the formula steps
  • For speed and time: the distance, speed, or time you asked for
  • Conversions between units

Important: This Is Not a Route or Driving Distance

The distance for two locations is the straight-line (great-circle) distance over the surface of the Earth, also called “as the crow flies.” It is shorter than the distance by road, rail, or sea, because roads curve, and they follow terrain and borders. For driving or walking directions, use a map or navigation service.

The Distance Formulas

Distance between two points in 2D:
d = √((x₂ − x₁)² + (y₂ − y₁)²)

Distance between two points in 3D:
d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)

Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

Manhattan (grid) distance: |x₂ − x₁| + |y₂ − y₁|

Distance between two latitude and longitude points (Haversine formula):

  • a = sin²(Δφ ÷ 2) + cos φ₁ × cos φ₂ × sin²(Δλ ÷ 2)
  • d = 2 × R × arcsin(√a)

where φ is latitude, λ is longitude (both in radians), and R is the Earth’s mean radius, about 6,371 km (3,959 miles).

Distance, speed, and time:

  • Distance = Speed × Time
  • Speed = Distance ÷ Time
  • Time = Distance ÷ Speed

Distance Examples

Example 1: Two Points in 2D

Point A is (1, 2) and point B is (4, 6).

  • d = √((4 − 1)² + (6 − 2)²) = √(9 + 16) = √25 = 5
  • Midpoint: ((1 + 4) ÷ 2, (2 + 6) ÷ 2) = (2.5, 4)
  • Manhattan distance: 3 + 4 = 7

Example 2: Two Points in 3D

Point A is (1, 2, 3) and point B is (4, 6, 15).

  • d = √(3² + 4² + 12²) = √(9 + 16 + 144) = √169 = 13

Example 3: Points with Negative Coordinates

Point A is (−3, 4) and point B is (5, −2).

  • d = √(8² + (−6)²) = √(64 + 36) = √100 = 10

Example 4: Distance Between Two Cities (Latitude and Longitude)

Multan (about 30.1575° N, 71.5249° E) and Lahore (about 31.5497° N, 74.3436° E).

  • Straight-line distance: about 310 km, or about 193 miles

The road distance is longer than this, because it follows the road network.

Example 5: A Long-Distance Flight Path

New York JFK airport (40.6413° N, 73.7781° W) and London Heathrow (51.4700° N, 0.4543° W).

  • Straight-line (great-circle) distance: about 5,540 km, or 3,442 miles, or 2,991 nautical miles
  • At a cruising speed of 900 km/h: 5,540 ÷ 900 = about 6.2 hours of flying, before taking into account wind, taxiing, climbing, and routing

Example 6: Distance from Speed and Time

  • You drive at 60 mph for 2.5 hours: distance = 60 × 2.5 = 150 miles
  • You travel at 80 km/h for 3 hours 30 minutes (3.5 hours): distance = 280 km

Example 7: Find the Speed

You travel 450 km in 5 hours.

  • Speed = 450 ÷ 5 = 90 km/h

Example 8: Find the Time

You need to drive 300 miles at 55 mph.

  • Time = 300 ÷ 55 = 5.4545 hours, or 5 hours 27 minutes

Example 9: A Run

You run at a pace of 5:30 per km for 45 minutes.

  • 45 minutes ÷ 5.5 minutes per km = 8.18 km

Example 10: A Walk

You walk at 5 km/h for 20 minutes.

  • 20 minutes = 1/3 hour, so distance = 5 × 1/3 = 1.67 km

A Quick Fact About Latitude and Longitude

  • One degree of latitude is always about 111 km (69 miles).
  • One degree of longitude is about 111 km at the equator, and gets smaller toward the poles. At 30° latitude it is about 96 km, and at 60° latitude about 56 km.
  • The Earth’s circumference is about 40,030 km (24,874 miles).

Common Distance Conversions

FromToMultiply by
1 milekilometers1.609344
1 kilometermiles0.621371
1 nautical milekilometers1.852
1 nautical milemiles1.15078
1 meterfeet3.28084
1 footmeters0.3048
1 yardmeters0.9144
1 inchcentimeters2.54

Examples:

  • 100 km = 100 × 0.621371 = 62.14 miles
  • A marathon of 26.2 miles = 26.2 × 1.609344 = 42.16 km (the official distance is 42.195 km)

Using the Distance Formula

The 2D distance formula comes from the Pythagorean theorem. The horizontal difference and the vertical difference form two sides of a right triangle, and the distance between the points is the longest side (the hypotenuse): d² = (Δx)² + (Δy)².

It is used in:

  • Geometry and algebra problems
  • Computer graphics and games
  • Maps, navigation, and delivery planning
  • Data science, such as finding the nearest neighbors
  • Physics and engineering

Tips for Calculating Distance

  • Use the same unit for all measurements before you calculate.
  • For speed and time, convert minutes to hours (divide by 60) when speed is per hour.
  • For latitude and longitude, use decimal degrees. South latitudes and west longitudes are negative.
  • Check that latitude is between −90 and 90, and longitude is between −180 and 180.
  • Remember that straight-line distance is shorter than travel distance.
  • Use a map or navigation service for routes, travel time, and traffic.
  • Round at the end, to keep the answer accurate.
  • The Haversine formula treats the Earth as a perfect sphere, so the result can be off by up to about 0.5% compared with more precise models.

Distance Calculator vs. Other Tools

  • Speed Calculator: speed from distance and time.
  • Pace Calculator: running pace and finish times.
  • Time Calculator: add and subtract hours and minutes.
  • Unit Converter: convert between units.
  • Area Calculator: area of shapes.
  • Scientific Calculator: general math and functions.

Frequently Asked Questions (FAQ)

How do I calculate the distance between two points?

Use the distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). For (1, 2) and (4, 6), the distance is √(9 + 16) = 5.

Use the Haversine formula, which gives the great-circle distance over the Earth’s surface. The straight-line distance from New York JFK to London Heathrow is about 5,540 km.

Straight-line distance is the shortest path over the Earth’s surface. Driving distance follows the road network, so it is longer. Use a map service for routes.

Multiply speed by time. At 60 mph for 2.5 hours, you travel 150 miles.

 Divide distance by speed. For 300 miles at 55 mph, the time is 5.45 hours, or about 5 hours 27 minutes.

Multiply by 1.609344. A distance of 26.2 miles is about 42.16 km.

A unit used in air and sea travel, equal to 1.852 km (about 1.15 miles). It is based on one minute of latitude.

A formula for the great-circle distance between two points on a sphere, based on their latitude and longitude.

It is accurate to within about 0.5% when the Earth is treated as a sphere. It does not include roads, terrain, or altitude.

 The distance when you can only move along a grid, calculated as |x₂ − x₁| + |y₂ − y₁|. It is often used for city blocks.

Yes. It is free, with no registration and no limits.

 No. It gives the straight-line distance and simple speed-based times. For directions, use a map or navigation app.

Disclaimer

This calculator is for general informational purposes only. Straight-line distances are estimates and do not show road, flight, or sea routes. For navigation, travel planning, aviation, or other safety-related uses, rely on official maps, charts, and navigation tools.