1. Home
  2. Math
  3. Distance Calculator

Distance Calculator

The distance between two points is d = โˆš((xโ‚‚ โˆ’ xโ‚)ยฒ + (yโ‚‚ โˆ’ yโ‚)ยฒ). From (1, 2) to (4, 6) it is โˆš(9 + 16) = 5. For places on Earth, use the latitude and longitude tab.

Lahore to Karachi is about 1,030 km in a straight line, but the road is longer. The map tab gives the straight โ€œas the crow fliesโ€ distance between any two coordinates.

Distance between two points

Answer โ€”

How we got this

    Your next step

    Your answer carries over, so you donโ€™t have to type it again.

    The distance formula

    It comes from Pythagoras: the horizontal and vertical gaps are the two short sides of a right triangle, and the distance is the long side.

    Formula
    2Dโˆš((xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ)
    3Dโˆš((xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ + (zโ‚‚โˆ’zโ‚)ยฒ)
    On Earth (haversine)2R ร— asin(โˆš(sinยฒ(ฮ”ฯ†/2) + cos ฯ†โ‚ cos ฯ†โ‚‚ sinยฒ(ฮ”ฮป/2)))

    Distances on the Earth

    The Earth is round, so a flat formula is wrong over long distances. We use the haversine formula with a mean Earth radius of 6,371 km. It assumes a perfect sphere, which is accurate to about 0.5%. Road and flight distances are longer than this straight line.

    Finding coordinates

    In most map apps, press and hold (or right-click) a place to see its latitude and longitude. Use decimal degrees such as 31.5204, 74.3587.

    Frequently asked questions

    How do I find the distance between two points?

    Subtract the x values and y values, square both, add them and take the square root.

    How do I calculate distance between latitude and longitude?

    Use the haversine formula, or enter both coordinates in the Latitude & longitude tab.

    Why is the road distance longer?

    Roads bend and follow terrain. This calculator gives the shortest straight path over the Earthโ€™s surface.

    What is a nautical mile?

    Exactly 1,852 metres, used at sea and in the air.

    Last updated ยท Written and checked by the AzCalculator team ยท Calculations run in your browser with full precision and are rounded only for display. How we build calculators