Life Calculator
MAKE THE FORMULA CLEAR

Distance and midpoint between two points

Calculate distance, midpoint and displacement for two points in a plane or three-dimensional space.

Start with your own numbers

Editable example

An example is filled in. Replace it with your own data to calculate.

Choose plane or space, use the same axes and length unit for both points, and enter z for space.

Loading calculator…

Choose a plane or three-dimensional Cartesian coordinates.
Enter the first horizontal coordinate, which may be negative, using a consistent unit.
Enter the first vertical coordinate, with up to six decimal places.
Enter the second horizontal coordinate in the same coordinate system.
Enter the second vertical coordinate in the same coordinate system.

Results update when inputs are complete. A plan is kept only when you save it. Inputs and results are not uploaded.

Saved plans →

Saved in this browser. Before changing devices, export a backup from My tools.

Example result

Straight-line distance (approx.)

5

Distance is the straight line between points; midpoint averages coordinates, and displacement points from first to second.

Midpoint x1
Midpoint y3.5
Horizontal displacement Δx4
Vertical displacement Δy3
Line in general form3x − 4y + 11 = 0
Line slope3/4

Worked steps

  1. Horizontal displacement is x₂−x₁; vertical displacement is y₂−y₁.
  2. Distance is the square root of the sum of squared displacements.
  3. Each midpoint coordinate is the average of the corresponding point coordinates.
  4. Set A = y₂−y₁, B = x₁−x₂ and C = x₂y₁−x₁y₂, then scale and reduce the coefficients to integers.
  5. Results are floating-point approximations; use the same length unit as the coordinates.

Plane mode uses the 2D distance and midpoint formulas and provides a reduced integer line equation for distinct points; coincident points do not determine one line and vertical slope is undefined. Space mode adds a z coordinate for distance and midpoint; no plane line is calculated. Use one unit, coordinates between −1,000,000 and 1,000,000 and at most six decimals. Results are floating-point approximations, not measurement precision, navigation or Earth-surface distance.

Method and scope

Coordinates must use the same Cartesian coordinate system and length unit; each is limited to −1,000,000 through 1,000,000 with at most six decimal places.

The result is a floating-point approximation; this is not a latitude/longitude, road-route or Earth-surface distance.

References:openstax.org reference、OpenStax: distance and midpoint formulas、NEHS: two points and a line

Purpose

Find the straight-line distance and midpoint of two points in a Cartesian plane or three-dimensional space.

Inputs

Enter x and y for each point; in space mode also enter z. Preserve signs and use one consistent unit.

Formula

Distance is the square root of the sum of squared coordinate differences; midpoint coordinates are the averages. In 3D include the z coordinate. For distinct points the line is given in reduced integer form Ax + By + C = 0.

Example

For A(−1,2) and B(3,5), distance is 5 and midpoint (1,3.5). In space, (1,2,3) to (4,6,15) has distance 13 and midpoint (2.5,4,9).

Reading the result

Distance is nonnegative and uses the coordinate length unit; displacement is directed from first to second.

Limits

In plane mode identical points do not determine a unique line and vertical slope is undefined. In space mode the plane line and slope are not computed. This is not a route or latitude/longitude distance.

Keep it handy for next time

Add Distance and midpoint between two points to your home screen

This icon opens this tool. Confirm installation in your browser.

  1. iPhone: Open in Safari, tap Share → Add to Home Screen, then confirm.
  2. Android: Open in Chrome and choose Install app or Add to Home screen from the menu.
  3. In an in-app browser such as LINE or Facebook, use its menu to open the page in Safari or Chrome first.

Browser options vary. A shortcut does not provide cross-device synchronization, and an installed app may have separate storage. Export a backup from My tools first. The first load requires a connection.

Checking offline data.