Close Menu
Vents MagazineVents Magazine

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Funny Birthday Wishes That Won’t Backfire

    What Is a Self-Hosted Learning Management System? Benefits, Drawbacks, and When It Makes Sense

    Donna Sicuranza: Complete Biography and TEAM Career

    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Vents MagazineVents Magazine
    Subscribe
    • News
    • Tools
      • Financial
      • Health
      • Math
      • Everyday
      • Engineering
      • Text & Fonts
    • Tech
      • AI & Tools
      • Software
    • Science
    • Business
      • Entrepreneurship
    • Health
    • Lifestyle
    • Travel
    • Home & Living
    • Blog
    • About Us
    • Contact Us
    • Privacy Policy
    Vents MagazineVents Magazine
    You are at:Home»Free Online Calculators and Tools»Distance Calculator

    Distance Calculator

    All tools › Math Calculators › Algebra

    Find the distance between two points on a plane, in space, or between two places by latitude and longitude.

    Distance between two points: on a plane, in space, or on the globe

    This distance calculator measures the straight-line distance between two points from their coordinates. It works for points on a flat plane (x, y), for points in three dimensions (x, y, z), and for two places on Earth given by latitude and longitude.

    For plane and space points it shows every step of the distance formula, the exact answer as a simplified square root when the coordinates are whole numbers, and the midpoint. For latitude and longitude it returns the great-circle distance in miles, kilometers and nautical miles.

    How to use the distance calculator

    1. Pick the Type of distance: two points on a plane, two points in space, or latitude and longitude.
    2. For plane points, fill in x1, y1, x2 and y2. For points in space, also fill in z1 (3D only) and z2 (3D only).
    3. For places on Earth, fill in Latitude 1, Longitude 1, Latitude 2 and Longitude 2 in decimal degrees. South latitudes and west longitudes are negative.
    4. Press the button. In the latitude and longitude mode, the US / metric switch sets whether the large figure is in miles or kilometers; both always appear in the rows.

    The formulas

    d = sqrt((x2 – x1)^2 + (y2 – y1)^2)

    This is the Pythagorean theorem: the changes in x and y are the two legs of a right triangle and the distance is its hypotenuse. In three dimensions a third term, (z2 – z1)^2, is added under the square root. The midpoint is the average of each coordinate.

    a = sin^2(dLat / 2) + cos(lat1) x cos(lat2) x sin^2(dLon / 2); d = R x 2 x atan2(sqrt(a), sqrt(1 – a))

    This is the haversine formula. dLat and dLon are the differences in latitude and longitude, all angles are in radians, and R is the mean radius of the Earth, taken as 6,371 km. Kilometers are converted with 1 mile = 1.609344 km and 1 nautical mile = 1.852 km.

    Worked example: from (-2, -1) to (4, 2)

    Choose two points on a plane and enter x1 = -2, y1 = -1, x2 = 4, y2 = 2.

    RowResult
    Change in x6
    Change in y3
    Sum of the squares45
    Exact formsqrt(45) = 3 x sqrt(5)
    Distance between the two points6.708203932
    Midpoint(1, 0.5)
    Distance along the axes (taxicab)9

    The Steps row writes out the same working line by line.

    A 3D example: from (1, -2, 3) to (4, 2, -2) the changes are 3, 4 and -5, the sum of the squares is 50, and the distance is 7.071067812, or 5 x sqrt(2).

    Worked example with latitude and longitude

    The page loads with the coordinates of New York City (40.7128, -74.006) and Los Angeles (34.0522, -118.2437). In the latitude and longitude mode the result is 2,445.56 miles, shown in the rows as 2,445.559 mi, 3,935.746 km and 2,125.133 nmi. The initial bearing from the first point is 273.69 degrees clockwise from north, which is just north of due west.

    How to read the results

    • Exact form keeps the square root instead of rounding. It appears in simplified form when the coordinates are whole numbers.
    • Distance along the axes (taxicab) adds the absolute changes in each coordinate. It is the distance if you may only move parallel to the axes, like driving on a grid of streets, and it is never shorter than the straight line.
    • Initial bearing is the compass direction you would start out in. Along a great circle the heading changes as you travel, so it is only the starting direction.

    Limits and assumptions

    • Plane and space distances have no units. The answer is in whatever unit your coordinates use.
    • The great-circle result treats the Earth as a perfect sphere. The real Earth is slightly flattened, so surveying-grade methods give slightly different figures.
    • It is the distance over the surface in a direct line, not a driving distance or a real flight route, and it ignores elevation.
    • Coordinates must be decimal degrees. Convert degrees, minutes and seconds first: degrees + minutes / 60 + seconds / 3600.

    Frequently asked questions

    Does the order of the two points matter?

    Not for the distance or the midpoint, because the differences are squared. Only the signs of the changes and the bearing depend on which point comes first.

    Can a distance be negative?

    No. A distance is zero when the two points are the same and positive otherwise.

    Why is the great-circle route curved on a flat map?

    A flat map stretches the globe, so the shortest path over the sphere usually looks like an arc on the map even though it is the most direct route on the surface.

    How do I enter a west longitude or a south latitude?

    Type it as a negative number. For example, 74.006 degrees west is entered as -74.006.

    Related calculators

    • Slope Calculator – slope and equation of the line through the same two points.
    • Root Calculator – square roots and other roots on their own.
    • Unit Converter – change the result into feet, yards, meters or other length units.
    • Speed Calculator – turn a distance into a travel time at a given speed.
    Top Posts

    Henry Golding Ethnicity: Complete Heritage Guide

    October 15, 202679 Views

    Why Petrol Prices Keep Rising in USA: Expert Guide

    May 17, 202673 Views

    5 Proven Side Hustles With Just a Phone in 2026

    May 16, 202673 Views

    ChatGPT vs Claude vs Gemini: Expert 2026 Guide

    May 30, 202655 Views
    Don't Miss
    Lifestyle November 3, 2026

    Funny Birthday Wishes That Won’t Backfire

    A good joke in a birthday message makes someone’s day. A bad one can sting…

    What Is a Self-Hosted Learning Management System? Benefits, Drawbacks, and When It Makes Sense

    Donna Sicuranza: Complete Biography and TEAM Career

    Henry Golding Ethnicity: Complete Heritage Guide

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    Demo
    Our Picks

    Funny Birthday Wishes That Won’t Backfire

    What Is a Self-Hosted Learning Management System? Benefits, Drawbacks, and When It Makes Sense

    Donna Sicuranza: Complete Biography and TEAM Career

    Most Popular

    How Do Fireflies Glow? The Complete Science Explained

    May 15, 20260 Views

    5 Best Free AI Background Remover Tools in 2026 (Tested on 30 Real Images)

    May 16, 20260 Views

    Why You Feel Tired After Eating Rice: The Real Science and What to Do

    May 16, 20260 Views
    © 2026 Vents Magazine. All Rights Reserved.
    • Home
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Write for Us
    • DMCA Policy
    • Terms and Conditions
    • Tools

    Type above and press Enter to search. Press Esc to cancel.