Distance Calculator
Distance and midpoint between two points, in 2D or 3D — with the formula shown step by step.
Point A
Point B
The formula box shows your values substituted in, so you can follow every step.
How to use the distance calculator
- Pick 2D or 3D. The toggle shows or hides the z coordinates.
- Enter both points. Decimals and negatives are fine.
- Press Calculate. You get the distance, the midpoint, the per-axis deltas, and the formula with your values plugged in.
- Check the work. The substituted formula is exactly what a teacher expects to see on paper.
Frequently asked questions
What is the distance formula?
d = √((x2−x1)² + (y2−y1)²). It is the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
How do you find distance in 3D?
Add the z term: d = √((x2−x1)² + (y2−y1)² + (z2−z1)²) — Pythagoras applied twice.
What is the midpoint formula?
Average the coordinates: M = ((x1+x2)/2, (y1+y2)/2), and add (z1+z2)/2 for 3D. The midpoint sits exactly halfway between the points.
Can distance be negative?
No. A square root is never negative, and squaring the deltas erases their signs — distance is always zero or positive.
What units does the answer use?
Whatever units your coordinates use — meters in, meters out; pixels in, pixels out. The formula itself is unit-agnostic.
More from the codex
Distance Calculator
2D/3D distance and midpoint.
Graphing Calculator
Plot up to 3 functions with pan and zoom.
Open tool → LiveMatrix Calculator
Add, multiply, invert matrices up to 4×4.
Open tool → LiveSystem of Equations Solver
Solve 2×2 and 3×3 systems step by step.
Open tool → LiveDerivative & Integral Calculator
Numeric derivatives and Simpson’s-rule integrals.
Open tool → LiveTriangle Solver
SSS, SAS, ASA, AAS with diagram.
Open tool → LivePythagorean Calculator
Solve any side of a right triangle.
Open tool → LiveCircle Calculator
Radius, diameter, circumference, area from any one.
Open tool → LiveArea & Volume Calculator
Areas and surface/volume for common shapes.
Open tool → LiveSlope Calculator
Slope and line equation from two points, graphed.
Open tool → LiveBitwise Calculator
AND, OR, XOR, NOT, shifts in binary/hex.
Open tool → LiveHalf-Life Calculator
Decay math plus a decay chart.
Open tool → LiveScientific Calculator
Trig, logs, powers, factorials — full keypad.
Open tool → LiveQuadratic Solver
Solve ax²+bx+c=0 — roots, vertex, and steps shown.
Open tool →Support the codex
This tool is free, with no account and no ads. If it saved you some time, consider supporting the indie dev behind it.