Skip to content
Tezmy Tools

Distance Calculator

Distance between two points on a plane, in 3D, or between two places on Earth

Distance

5

√(9 + 16)

Midpoint
(2.5, 4)
Slope of the line
1.3333333
Change in x, y
3, 4

Earth distances are straight-line (great-circle) distances over a sphere, so they are a little off for the real shape of the Earth and ignore roads and flight paths.

Runs in your browser. Nothing is uploaded.

About the Distance Calculator

This distance calculator handles three kinds of question. For maths and graphs, it gives the distance between two points on a flat plane using the distance formula, along with the midpoint and slope of the line joining them. For geometry and design in three dimensions, it measures the straight line between two points with x, y and z coordinates. For maps, it takes the latitude and longitude of two places and finds the shortest distance over the Earth's surface, in kilometres, miles and nautical miles, plus the starting compass bearing and the point halfway between.

Updated October 2026

How to use the Distance Calculator

  1. 1Choose 2D points, 3D points or places on Earth.
  2. 2Enter the coordinates of the two points.
  3. 3For Earth distances use degrees, with south and west as negative numbers.
  4. 4Read the distance and the extra figures such as midpoint, slope or bearing.
  5. 5Copy the result.

Uses for each mode

  • 2D: school maths, graph paper problems, game and screen coordinates.
  • 3D: CAD sketches, game worlds, physics problems and drone routes.
  • Earth: flight distances, shipping routes, hiking planning and geography homework.
  • Midpoints: finding a fair meeting place between two locations.

Accuracy notes

The Earth is not a perfect sphere: it is slightly wider at the equator than pole to pole. The spherical formula is accurate to within about half a percent, which is fine for planning and teaching but not for surveying. For long distances over water or high latitudes the great-circle route can look surprising on a flat map, because flat maps stretch the poles.

Useful companions

Use the Pythagorean Theorem Calculator for right triangles, the Slope Calculator for gradients, the Speed Calculator for travel time, the Unit Converter for kilometres and miles, and the Mileage Calculator for claiming trip costs. Rounding long results is easy with the Rounding Calculator.

Features

  • Distance formula for 2D and 3D points
  • Midpoint of the two points
  • Slope of the line in 2D
  • Great-circle distance between places
  • Kilometres, miles and nautical miles
  • Initial bearing with compass direction
  • Runs in your browser

Frequently asked questions

What is the distance formula?

For two points (x1, y1) and (x2, y2) the distance is the square root of (x2 minus x1) squared plus (y2 minus y1) squared. It comes from the Pythagorean theorem. For (1, 2) and (4, 6) the differences are 3 and 4, and the distance is 5. In 3D, add the squared difference in z.

How do I find the midpoint between two points?

Average each coordinate. The midpoint of (1, 2) and (4, 6) is ((1 + 4) / 2, (2 + 6) / 2), which is (2.5, 4). The tool shows the midpoint for 2D and 3D points.

How is the distance between two cities calculated?

It uses the haversine formula, which treats the Earth as a sphere and finds the shortest path along its surface, called the great-circle distance. London to Paris comes out at about 343 kilometres. Roads, flight routes and the Earth's slightly squashed shape make real journeys longer.

How do I enter latitude and longitude?

Use decimal degrees. Latitude runs from -90 (south pole) to 90 (north pole) and longitude from -180 to 180. North and east are positive, south and west negative. New York is about 40.7128, -74.0060. You can copy coordinates from most map apps.

What does the bearing tell me?

It is the compass direction you would head in at the start to follow the great-circle path, measured clockwise from north. Because the path curves over the globe, the direction changes along the way. The tool also names the nearest compass point, such as SSE.

Is this the driving distance?

No. It is the straight-line distance, sometimes called as the crow flies. Driving distance depends on roads and is usually longer. For travel time use the Speed Calculator.

Related tools