Distance and Midpoint Calculator (2D and 3D)

Find the distance, midpoint, slope and angle between two points in 2D or 3D.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Step 1: Open Distance and Midpoint Calculator (2D and 3D) and add your input

    Type your numbers or text, add your file, or pick the options you need. Nothing is uploaded: everything stays in your browser.

  2. 2
    Step 2: What Distance and Midpoint Calculator (2D and 3D) does

    Find the distance, midpoint, slope and angle between two points in 2D or 3D.

  3. 3
    Step 3: Read the result and compare

    The result appears at once. Change one value to see how the answer moves, then keep the figure that fits your case.

  4. 4
    Step 4: Copy or save it

    Copy the result or download it. For an important decision, confirm it with the official source or an adviser.

About this tool

Choose 2D or 3D and enter the coordinates of A and B separated by spaces. The calculator gives the distance, the midpoint, the squared distance, the Manhattan distance, the differences and the point a fraction t of the way from A to B. In 2D it also gives the slope and the angle of the line.

Formulas

Distance = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2). The point at fraction t is A + t(B − A); t = 0.5 is the midpoint.

Other values

The Manhattan distance is the sum of the absolute coordinate differences. In 3D the unit direction vector from A to B is also shown.

Worked example

A = (1, 2, 3) and B = (4, 6, 15) in 3D: distance 13, midpoint (2.5, 4, 9), and the point a quarter of the way along is (1.75, 3, 6).

Tips for best results

Check every box before you rely on a result, because one wrong digit changes the whole answer. Use the exact figures from your payslip, bill, certificate or contract, and keep a note of the date you calculated. Rates, thresholds and rules change from time to time, so for tax, fees and legal matters treat the output as an estimate and confirm with the official source named on this page. You can run as many scenarios as you like; nothing is saved or sent, and refreshing the page clears the boxes.

Quick facts

Embed this calculator on your site

Copy this code to show the calculator on your own page. A link back to shobfree.com is included.

Frequently asked questions

What is the t value?

A fraction along the segment: 0 is A, 1 is B, 0.5 the midpoint.

Can t be outside 0–1?

Yes, to extend the line beyond the points.

What is Manhattan distance?

The distance along grid lines: |Δx| + |Δy| + |Δz|.

How do I enter points?

Coordinates separated by spaces, such as 1 2 3.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages