Skip to content

Distance & Midpoint Calculator

Find the distance, midpoint and slope between two points.

Calculated instantly in your browser.

How do you calculate the distance and midpoint between two points?

Distance = √((x₂ − x₁)² + (y₂ − y₁)²), an application of the Pythagorean theorem to the horizontal and vertical gaps. Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2), and slope = (y₂ − y₁) ÷ (x₂ − x₁). Example: from (0, 0) to (3, 4) the distance is 5, the midpoint is (1.5, 2) and the slope is about 1.33.

Understanding your result

The distance formula is the Pythagorean theorem applied to the horizontal and vertical gaps. The slope is undefined when the two points share the same x-coordinate (a vertical line).

Formula and method

Distance = √((x₂ − x₁)² + (y₂ − y₁)²). Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2). Slope = (y₂ − y₁) ÷ (x₂ − x₁).

Assumptions and limitations

This tool works in two dimensions on a flat Cartesian plane, computing straight-line distance, midpoint and slope from two points. It does not handle three-dimensional coordinates or curved surfaces such as the Earth, so it is not for map latitude and longitude. The slope is undefined for a vertical line, where both points share the same x-coordinate.

Worked example

From (0, 0) to (3, 4): distance √(9 + 16) = 5, midpoint (1.5, 2), slope 4 ÷ 3 ≈ 1.33.

How to use this tool

  1. Enter the coordinates of the first point.
  2. Enter the coordinates of the second point.
  3. Read the distance, midpoint and slope.

Common mistakes to avoid

  • Mixing up the order of x and y coordinates.
  • Expecting a slope for a vertical line — it is undefined.

About the Distance & Midpoint Calculator

The Distance & Midpoint Calculator works out the straight-line distance between two points, the midpoint that sits exactly between them, and the slope of the line that joins them.

Who should use this tool

Geometry and algebra students, and anyone working with coordinates.

Benefits

  • Distance, midpoint and slope in one go.
  • Handles negative and decimal coordinates.
  • Shows the formulas behind the answers.
  • Private and instant.

Practical use cases

  • Solving coordinate-geometry problems.
  • Finding the centre point of a line segment.
  • Measuring distance on a grid or map.

Explore all Mathematics tools

Frequently asked questions

What is the distance formula?

It is the square root of the sum of the squared differences in x and y: √((x₂ − x₁)² + (y₂ − y₁)²).

Why is the slope sometimes undefined?

When both points have the same x-coordinate the line is vertical, and dividing by a zero horizontal change leaves the slope undefined.

Can I use this for distances between map coordinates?

Not accurately. This calculator measures straight-line distance on a flat plane, whereas latitude and longitude sit on a curved surface. Treating them as flat coordinates gives wrong distances over any real span. For geographic distances use a great-circle or haversine calculation that accounts for the Earth's curvature.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: