NumbarnNumbarn

Distance Calculator

Adjust the inputs below. Results update as you type.

How it works

Haversine formula: d = 2r × arcsin(√(sin²(Δlat/2) + cos(lat₁)cos(lat₂)sin²(Δlon/2))). Earth's mean radius is 6,371 km. This gives the great-circle distance, which differs from driving distance due to roads. 1 nautical mile = 1 minute of arc of latitude = 1.852 km. For driving distances, use a routing API that accounts for road networks.

Input guidance

  • Check units and decimal placement before running calculations.
  • For percentage and ratio tasks, define the baseline value clearly.
  • Use rounded output carefully and keep full precision for intermediate steps.

The formula

Between two points, distance = √((x₂ − x₁)² + (y₂ − y₁)²), the Pythagorean theorem applied to coordinates. In 3-D, add the (z₂ − z₁)² term.

Worked example

From (1, 2) to (4, 6): √((3)² + (4)²) = √(9 + 16) = √25 = 5 units.

More examples to test

  • Baseline example: solve with clean numbers first to verify formula direction.
  • Edge-case example: test near-zero or boundary values to avoid interpretation errors.

How to interpret results

Use outputs as quick checks, then verify with step-by-step work for graded or high-stakes use.

When this can be inaccurate

Errors usually come from unit mismatch, wrong baseline assumptions, or rounding too early in multistep problems.

Change history

  • July 2026: Quality-reviewed for publication with formula checks and explanatory copy updates.

Site-wide corrections also appear on the corrections log.

Sponsored

Build math and logic skills with guided lessons

Educational platform recommendation.

Frequently asked questions

How is straight-line distance found?+

With the distance formula, which is the Pythagorean theorem: the square root of the sum of squared coordinate differences.

Does this work in 3-D?+

Yes. Add the squared difference of the z-coordinates inside the square root for three-dimensional distance.

What about distance on a map?+

For latitude/longitude, the haversine formula accounts for Earth's curvature, which the flat distance formula ignores.

Why do my classroom and calculator results differ?+

Differences usually come from rounding conventions, order-of-operations handling, or different baseline assumptions.

What is the safest way to validate an answer?+

Recompute with units shown and check against a second method or manual arithmetic for critical problems.

Related calculators