Home Math Distance Calculator

Distance Calculator

The distance and midpoint between two points on a plane.

Advertisement

How it works

Enter the coordinates of two points. The distance is the hypotenuse of the right triangle whose legs are the horizontal and vertical differences, and the midpoint is the average of the two x values and the two y values. Works with negative and decimal coordinates alike.

Advertisement

Formula

Distance = sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2).
Midpoint = ((x1 + x2) / 2, (y1 + y2) / 2).

Example

Example in plain words. From (1, 2) to (4, 6).

Legs: 3 and 4, so the distance is sqrt(9 + 16) = 5.

Midpoint: (2.5, 4).

From (-3, -4) to the origin the distance is also 5.

Frequently asked questions

Is this the 3-4-5 triangle?

Exactly. The default example is the famous right triangle with legs 3 and 4 and hypotenuse 5.

Can I use it on a map?

Only for short distances on a flat projection. Across countries the Earth curves, and you need the haversine formula on latitude and longitude instead.

Advertisement

Related calculators

Percentage Calculator

Find a percent of a number, what percent one number is of another, and percent change, all at once.

Fraction Calculator

Add, subtract, multiply and divide fractions, with the answer simplified.

Scientific Calculator

Online scientific calculator with trig, logs, powers, roots, factorial and degree or radian mode.

Quadratic Formula Calculator

Solve ax² + bx + c = 0, with the discriminant and the vertex.