Enter the coordinates of the first and second port into the calculator to determine the distance.

Port Distance Calculator

Great-circle distance between two ports

Port Distance Formula

The following formula (the haversine / great-circle formula) is commonly used to calculate the shortest distance over the Earthโ€™s surface between two ports given their latitude and longitude.

D = 2R \arcsin\left(\sqrt{\sin^2\left(\frac{\varphi_2-\varphi_1}{2}\right)+\cos(\varphi_1)\cos(\varphi_2)\sin^2\left(\frac{\lambda_2-\lambda_1}{2}\right)}\right)

Variables:

  • D is the great-circle distance between the two ports (in the same units as R; commonly nautical miles)
  • R is the Earthโ€™s radius (approximately 3440.065 nautical miles, 6371.0088 km, or 3958.7613 miles)
  • ฯ†1 and ฯ†2 are the latitudes of the first and second port (in radians)
  • ฮป1 and ฮป2 are the longitudes of the first and second port (in radians)

To calculate the distance between two ports, convert latitude/longitude from degrees to radians, compute ฮ”ฯ† = ฯ†2 โˆ’ ฯ†1 and ฮ”ฮป = ฮป2 โˆ’ ฮป1, evaluate the haversine expression above, and multiply the resulting central angle by R. This gives the great-circle distance (the shortest path on a spherical Earth). Actual sailing routes may be longer due to routing, weather, traffic separation schemes, and other constraints.

What is a Port Distance?

A Port Distance refers to the measurement of the distance between two seaports. This measurement is typically used in the shipping and logistics industry to calculate the time and cost of transporting goods from one port to another. The distance is usually measured in nautical miles and can be influenced by factors such as the route chosen, weather conditions, and maritime regulations.

How to Calculate Port Distance?

The following steps outline how to calculate the Port Distance using the haversine (great-circle) formula:


  1. Gather the latitude and longitude of each port (in degrees).
  2. Convert each latitude/longitude value from degrees to radians.
  3. Compute ฮ”ฯ† = ฯ†2 โˆ’ ฯ†1 and ฮ”ฮป = ฮป2 โˆ’ ฮป1.
  4. Compute a = sinยฒ(ฮ”ฯ†/2) + cos(ฯ†1)cos(ฯ†2)sinยฒ(ฮ”ฮป/2).
  5. Compute the central angle c = 2ยทatan2(โˆša, โˆš(1 โˆ’ a)).
  6. Multiply to get distance: D = Rยทc, using an Earth radius R in your desired units (e.g., nautical miles).

Example Problem:

Use the following variables as an example problem to test your knowledge:

ฯ†1 = 40ยฐ (latitude of the first port)

ฮป1 = โˆ’73ยฐ (longitude of the first port)

ฯ†2 = 35ยฐ (latitude of the second port)

ฮป2 = โˆ’80ยฐ (longitude of the second port)

Using R = 3440.065 nautical miles, the great-circle distance is approximately D โ‰ˆ 448.6 nautical miles (โ‰ˆ 830.7 km).