Distance Formula Calculator
Compute distances in 2D, 3D, or on Earth using latitude and longitude, with formula steps and midpoint results.
Point A (x₁, y₁)
Point B (x₂, y₂)
Distance formula (2D)
Formula:
d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
This is derived from the Pythagorean theorem: the straight-line distance is the hypotenuse of a right triangle whose legs are the differences in x and y.
Distance formula (3D)
d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}
Haversine formula (lat/long)
d = 2R \arcsin \left(\sqrt{\sin^2\left(\frac{\varphi_2 - \varphi_1}{2}\right) + \cos(\varphi_1)\cos(\varphi_2)\sin^2\left(\frac{\lambda_2 - \lambda_1}{2}\right)}\right)
Where φ is latitude in radians, λ is longitude in radians, and R is Earth’s radius.
FAQs
What is the midpoint between two points?
Midpoint M between (x₁, y₁) and (x₂, y₂) is: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). Our tool shows it for 2D/3D.
Can I use this for physics problems?
Yes. If your problem involves straight-line distance between two points in Cartesian space, this formula is standard.
What if I only have one coordinate different?
The formula still works — the other difference will be zero, so it reduces to the absolute difference on one axis.
Formula (LaTeX) + variables + units
','\
Formula: d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} This is derived from the Pythagorean theorem: the straight-line distance is the hypotenuse of a right triangle whose legs are the differences in x and y.
d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2}
d = 2R \arcsin \left(\sqrt{\sin^2\left(\frac{\varphi_2 - \varphi_1}{2}\right) + \cos(\varphi_1)\cos(\varphi_2)\sin^2\left(\frac{\lambda_2 - \lambda_1}{2}\right)}\right) Where φ is latitude in radians, λ is longitude in radians, and R is Earth’s radius.
- No variables provided in audit spec.
- NIST — Weights and measures — nist.gov · Accessed 2026-01-19
https://www.nist.gov/pml/weights-and-measures - FTC — Consumer advice — consumer.ftc.gov · Accessed 2026-01-19
https://consumer.ftc.gov/
Last code update: 2026-01-19
- Initial audit spec draft generated from HTML extraction (review required).
- Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
- Confirm sources are authoritative and relevant to the calculator methodology.