Connect via MCP →

Enter Calculation

Accepts integers, decimals, negatives, and fractions like 3/4 or 2 1/2.

Formula

Formula: Distance Between Two Points (2D) Calculator
Show calculation steps (1)
  1. Exact Radical Form

    Exact Radical Form: Distance Between Two Points (2D) Calculator

    Let S = (x2 - x1)^2 + (y2 - y1)^2; factor the largest perfect square k^2 so that S = k^2 m, giving d = k sqrt(m).

Advertisement

Results

Distance
11.661904
Exact form: 2 √34
Point 1 (x1, y1) (-2, 3)
Point 2 (x2, y2) (4, -7)
dx = x2 - x1 6
dy = y2 - y1 -10
Distance Solution
d = √((x2 - x1)² + (y2 - y1)²)
d = √((4 - (-2))² + (-7 - (3))²)
d = √((6)² + (-10)²)
d = √(136)
d = 2 √34
d ≈ 11.661904

What This Calculator Does

This tool computes the straight-line, or Euclidean, distance between two points on a two-dimensional Cartesian plane. Enter the coordinates of point 1 as (x1, y1) and point 2 as (x2, y2), and the calculator returns the distance as both an exact simplified radical (for example, \(2\sqrt{34}\)) and a decimal rounded to six places, along with the full step-by-step working.

How to Use It

Type each coordinate into its box. Values are unitless coordinates on the same plane, so no unit selection is needed. You can enter integers, decimals, negative numbers, and fractions. Simple fractions like 3/4 and mixed fractions like 2 1/2 are parsed to decimals automatically before the formula is applied. The order of the two points does not matter — squaring the differences removes any sign.

The Formula Explained

The distance formula is a direct application of the Pythagorean theorem. The horizontal change is \(dx = x_2 - x_1\) and the vertical change is \(dy = y_2 - y_1\). These form the two legs of a right triangle whose hypotenuse is the distance:

$$d = \sqrt{dx^2 + dy^2}$$

To express the answer exactly, let \(S = dx^2 + dy^2\). When \(S\) is a whole number we find the largest integer \(k\) whose square divides \(S\), write \(S = k^2 \cdot m\), and report \(d = k\sqrt{m}\). If \(m = 1\) the distance is the whole number \(k\) (a perfect square); if \(k = 1\) it stays as \(\sqrt{m}\).

Advertisement
Two points on a coordinate plane connected by a diagonal line forming a right triangle
The distance between two points is the hypotenuse of a right triangle with horizontal and vertical legs.

Worked Example

For \((x_1, y_1) = (-2, 3)\) and \((x_2, y_2) = (4, -7)\): \(dx = 4 - (-2) = 6\) and \(dy = -7 - 3 = -10\). So $$S = 6^2 + (-10)^2 = 36 + 100 = 136.$$ Since \(136 = 4 \cdot 34\) and \(4 = 2^2\), we get \(k = 2\) and \(m = 34\), so the exact distance is \(2\sqrt{34} \approx 11.661904\).

Right triangle showing horizontal and vertical differences with the distance as hypotenuse
The horizontal change and vertical change become the squared terms under the radical.

FAQ

Does the order of points matter? No. The differences are squared, so swapping the two points gives the same distance.

What if both points are the same? The distance is simply 0, with no error.

Can I enter fractions? Yes — both simple fractions (3/4) and mixed fractions (2 1/2) are supported. When inputs are fractional and \(S\) is not a whole number, only the decimal value is shown.

Last updated: