Distance Calculator – Find Distance Between Two Points On Map

From and To Distance Calculator measures distance in miles and kilometers on a map between cities, addresses, or places.

What Does the Distance Calculator on onlinecompass.net Do?

The distance calculator on onlinecompass.net is a free, easy-to-use tool designed to calculate distances between locations worldwide (road distances wherever a road or ferry connects them). Whether you’re measuring the distance between two cities, towns, villages, or even precise street addresses, this tool provides accurate results in both kilometers (km) and miles (mi).

It calculates two types of distances:

You can enter locations in three ways:

distance calculator

How to Use This Distance Calculator

This distance calculator offers two input modes, Search Mode and Coordinate Mode, allowing you to choose the one that best fits your needs and level of precision.

Search Mode

In Search Mode, you can enter the origin and destination by typing their names into the input boxes. As you type, the tool automatically suggests matching locations to help you find the correct place quickly. After selecting both the starting point and the destination, click the “Draw Route” button. The map will then display the actual travel route between the two locations along with a straight-line path for comparison. Both distances are shown in kilometers and miles.

Coordinate Mode (Latitude & Longitude)

Coordinate Mode is designed for users who require precise location input. In this mode, you manually enter the latitude and longitude of both the origin and destination using decimal degrees. Once the coordinates are entered, click “Draw Route” to generate the route. The map will display the travel route, which starts and ends at the road nearest each point, as well as the direct line between the two points. Distances are calculated and displayed in both kilometers and miles. This mode is particularly useful for remote locations, GPS-based points, or places that do not have a recognizable address.

Map Visualization

When you draw a route on the map, the tool distinguishes between the two types of distances visually:

This helps you quickly understand both the practical and theoretical distances between your two selected points.

Clearing the Map and Setting New Points

To start over with a new origin and destination, click the “Clear All” button. This removes any previously entered locations and erases the drawn routes from the map.

Keep in mind that for the distance calculation to work, both an origin and a destination must be set. If you try to draw a route without selecting both, the tool will display a warning message reminding you to complete the required inputs.

Frequently Asked Questions

Is the distance calculator completely free to use?

Yes, the tool is free, with no registration or hidden fees. The page shows ads, but they don’t block the calculator. You can perform unlimited calculations.

How accurate are the travel distance and straight-line distance results?

Straight-line (“as-the-crow-flies”) distance is highly accurate, to within about 0.5%. It’s calculated with the haversine formula, which treats the Earth as a perfect sphere. In Coordinate Mode it measures between your exact coordinates. In Search Mode it uses the single point the map assigns to each place, which for a city is usually its center. Travel distance is the length of the route the mapping provider picks along its road network. Your actual distance can differ if you take another route, or if roads have changed recently or are temporarily closed.

Why is the travel distance sometimes much longer than the straight-line distance?

Real-world routes must follow roads, highways, and ferries (where available), detouring around natural barriers like mountains or water, while the straight-line distance ignores all obstacles.

Does the tool account for traffic, tolls, or road restrictions when calculating travel distance?

Only partly. The route follows standard road rules such as one-way streets, but it doesn’t account for real-time traffic, toll costs, or restrictions that apply only to certain vehicles, such as truck bans or height and weight limits. Because it gives a fixed distance based on standard road data, it’s ideal for planning rather than live navigation.

Is elevation or terrain considered in the calculations?

No, both travel and straight-line distances are measured horizontally. Elevation gain/loss or hilly terrain effects on actual effort are not included.

Does the calculator update for new roads or construction changes?

It uses periodically updated mapping data from providers. Very recent road changes may not be reflected yet, but major updates are incorporated over time.

Can I measure distances for walking, cycling, or driving specifically?

The travel distance follows standard road networks suited for driving. It does not differentiate between modes, so pedestrian paths and bike lanes are not specifically prioritized. Straight-line distance is independent of travel mode.

Is the tool suitable for measuring running or hiking trail distances?

For trails that run along roads, the travel distance can be a reasonable approximation. Off-road trails are better measured with a dedicated hiking or GPS app, since road-based routing won’t follow footpaths. The straight-line distance is only the shortest possible distance, and a winding trail will always be longer.

Can I calculate distances at sea or in the air?

Straight-line distance is a good estimate for flights, though actual flight paths are usually somewhat longer because of air-traffic routes, winds, and restricted airspace. It isn’t reliable for sea travel, since ships have to sail around land. Travel distance may include ferry routes if available in mapping data, but it won’t show shipping routes.

Does the calculator work for international locations?

Yes, it works worldwide. Place search covers cities and towns around the globe and street addresses in many countries, though address coverage varies by region. A road distance is only available when the two points are connected by road or ferry. For places separated by sea, such as Dallas and London, use the straight-line distance.

Why might the suggested locations not include my specific town or address?

Suggestions rely on mapping database coverage. Small villages, new developments, or very specific addresses may not autocomplete. In such cases, use nearby known places or switch to Coordinate Mode with exact GPS coordinates.

Can I use airport codes or landmarks as input?

Yes, many airport codes (e.g., JFK, LHR) and famous landmarks are recognized in Search Mode suggestions.

What format should latitude and longitude be entered in?

Use decimal degrees (for example, 40.7128 for latitude and -74.0060 for longitude). Negative values represent south latitude or west longitude. Degrees/minutes/seconds are not supported, so convert them to decimal first.

Can I calculate distances between more than two points?

The current version supports only two locations (origin and destination). For multi-point routes, calculate segments separately and sum the distances manually.

Can I switch between kilometers and miles?

Both units are always shown simultaneously for the final distances, with no option to hide one.

Does the tool show an estimated travel time?

No, only distances in km and miles are provided. Time estimates would require speed assumptions, which are not included.

Can I save or share the calculated route and distances?

Currently, no built-in save or share button exists. Users typically screenshot the map with displayed distances or copy the numerical results manually.

Does the calculator work on mobile phones and tablets?

Yes, the responsive design adapts to mobile screens. Touch input works for selecting locations from suggestions, though typing coordinates on small keyboards requires care.

Can I use the tool offline?

No, an internet connection is required to load the map, retrieve location suggestions, and calculate routes using external mapping services.

What should I do if the map doesn’t load or show the route?

Check your internet connection, disable ad blockers (they can interfere with map scripts), clear your browser cache, or try a different browser. Reloading the page often resolves temporary issues.