Free Math Calculator

Distance & Midpoint Calculator

Use this distance and midpoint calculator for 2D or 3D Cartesian points. Get exact midpoints, straight-line distance, fraction support and distance-formula steps.

✓ Free to use✓ Dynamic calculation steps✓ Input validation✓ Mobile friendly

Calculator

Enter your values

Enter your own values. The result starts blank and clears whenever an input changes.

Point A
Point B

Choose 2D or 3D. Enter every coordinate, including zero; all axes need the same unit scale. Integers, up to 6 decimal places, or fractions within ±10,000. Not for latitude/longitude.

About this distance and midpoint calculator

This distance and midpoint calculator uses two Cartesian points to find their straight-line separation and the point halfway between them. Select 2D for x and y coordinates or 3D to include z. The result contains an exact midpoint, exact squared distance and the distance formula with your values substituted.

This is a coordinate-geometry tool, not a route planner or geographic-distance tool. For latitude and longitude, use the existing Distance Between Coordinates Calculator or Geographic Midpoint Calculator. Those geographic tools account for the Earth-based interpretation of the inputs rather than treating degrees as equal Cartesian lengths.

How to enter 2D or 3D coordinate points

  1. Select the dimension. A 2D point has x and y; a 3D point adds z.
  2. Enter all coordinates for point A and point B. Use zero for a zero coordinate, not an empty field.
  3. Use the same length scale for every axis. Enter fractions such as −2/3 directly if an exact rational coordinate is intended.
  4. Calculate and review the distance together with the midpoint tuple. The coordinate order in the tuple follows the selected axes.

Switching dimension hides and disables the unused z fields in 2D mode. Editing any input clears the old result. Reset returns to the initial 2D form; Copy, Download and Print include the full working. For line steepness rather than segment length, use the Slope Calculator.

Affiliate disclosure: As an Amazon Associate I earn from qualifying purchases.

For a separate arithmetic check, you may browse scientific calculators (paid link). Check the model’s supported functions; match the input notation, coordinate units and display precision. A handheld display may round a value or hide an exact fraction; it is not a guarantee of the correct mathematical model. No purchase is required.

Distance formula and midpoint formula

For two-dimensional points, distance is the nonnegative square root of (x₂ − x₁)² + (y₂ − y₁)². In three dimensions, add (z₂ − z₁)² inside the square root. A negative coordinate difference is valid; squaring removes its sign from the distance sum.

The midpoint averages each pair of coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2), with (z₁ + z₂)/2 appended in 3D. Distance uses differences, while midpoint uses sums. Reversing A and B leaves both results unchanged. For a separate square-root calculation, use the Square Root Calculator.

Worked coordinate-distance examples

In 2D, enter A = (1, 2) and B = (4, 6). The changes are 3 and 4, giving squared distance 9 + 16 = 25 and distance 5. The midpoint is (5/2, 4), equivalently (2.5, 4).

In 3D, A = (0, 0, 0) and B = (2, 3, 6) give squared distance 4 + 9 + 36 = 49, so the distance is 7. The midpoint is (1, 3/2, 3).

For A = (0, 0) and B = (1, 1), the distance is √2, not an exact decimal. This tool retains the radical and shows a labelled approximation. If both points are identical, distance is zero and the midpoint is that same point. The Triangle Calculator addresses triangle geometry rather than directly averaging two endpoints.

Exact fractions, distance approximations and verification

Coordinates written as supported decimals or fractions are represented with exact rational arithmetic. The midpoint and squared distance therefore remain exact. When the squared distance has a rational square root, the distance is also displayed exactly as an integer or reduced fraction. Otherwise the result retains √(squared distance) and a decimal approximation rounded to 12 significant digits.

The working includes a midpoint check: its squared distance from A equals its squared distance from B, and both equal one quarter of the full squared distance. This also covers identical endpoints. If you compare the result with another calculator, compare exact fractions or radicals before comparing rounded decimals.

Use the Fraction Calculator to explore a rational-coordinate calculation separately. An irrational radical is exact notation even when it is not simplified into a shorter radical expression; the accompanying decimal is only an approximation.

Coordinate limits, units and appropriate use

Each input has a 30-character limit. Integers, decimals with up to six places and simple fractions are accepted. Coordinate magnitudes must be within −10,000 to 10,000. Fraction numerators and denominators must also be within that range, with a nonzero denominator. Scientific notation, commas, coordinate expressions and units inside the fields are not accepted.

The calculation assumes perpendicular axes using a common length scale. It does not convert between units or account for a projection, obstacle, slope of terrain or travel route. If x is in feet while y is in meters, converting one axis before calculation is necessary. Use a suitable Conversion Calculator to reconcile units.

The tool can support geometry practice, layout checks or coordinate-based code verification. It does not certify a survey, building measurement or navigation result. Your coordinate values and choice of model determine whether the answer matches the real problem.

Distance & Midpoint Calculator FAQs

Sources and methodology

These educational references explain the mathematical ideas. This independently implemented calculator is not affiliated with their publisher. Its supported methods, exact checks and limits are documented above.