Math Calculators
Distance Formula Calculator


Distance Formula Calculator

Calculate the exact distance between two points on a coordinate plane instantly. Our free Distance Formula Calculator uses the Euclidean distance formula.

Answer

d = 26.196373794859472

There was an error with your calculation.

Last updated: June 26, 2026

Table of Contents

  1. How to Use the Distance Calculator
  2. The Distance Formula
  3. Deriving the Euclidean Distance Formula
  4. Distance Calculation Examples
    1. Example 1: Standard Coordinates
    2. Example 2: Negative Coordinates
  5. Real-Life Applications
    1. Example 3: Ladder Against a Wall
  6. Calculating Distance in 3D Space

Distance Formula Calculator

Easily calculate the distance between two points on a 2D coordinate plane with this intuitive distance calculator. By utilizing the specific coordinates of any two points, the tool instantly computes the exact distance between them. Since a straight line represents the shortest path between two points, this tool also functions perfectly as a line length calculator.

How to Use the Distance Calculator

This tool finds the exact distance between Point 1 (X₁, Y₁) and Point 2 (X₂, Y₂). To determine the distance between your two points, simply input their coordinates into the designated fields following these guidelines:

  • Use a comma to separate the x and y coordinates for each point. For example, enter “4,5” into the (X₁, Y₁) field to set Point 1 with an x-coordinate of 4 and a y-coordinate of 5. If your coordinate includes a decimal, use a decimal point to separate the whole number from the fractional part. For instance, enter “4.5,7” for an x-coordinate of 4.5 and a y-coordinate of 7.
  • The calculator accepts integers and decimals as coordinate values. Fractions are not supported.
  • Adding spaces between the coordinates is optional, but you can use them for better readability (e.g., "4, 5" or "4,5" are both fine).

Once you have entered the coordinates, click “Calculate.” The calculator will immediately provide the final distance along with a detailed, step-by-step solution.

The Distance Formula

On a two-dimensional coordinate plane, you can find the distance d between Point 1 (X₁, Y₁) and Point 2 (X₂, Y₂) using the standard distance formula:

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}$$

In simpler terms, the distance between two points in 2D space is the square root of the sum of the squared differences of their corresponding x and y coordinates. This mathematical rule is widely known as the Euclidean distance formula, which is why this tool is often referred to as a Euclidean distance calculator.

Deriving the Euclidean Distance Formula

To understand how this formula is derived, let’s visualize two distinct points on an (X, Y) coordinate plane:

2D Distance Calculator

By drawing a vertical line down from Point 2 and a horizontal line across from Point 1, we create a right-angled triangle. The hypotenuse (the longest side) of this right triangle represents the straight-line distance between the two points.

The length of the vertical leg equals the vertical distance between the points: Y₂ – Y₁. The length of the horizontal leg equals the horizontal distance between the two points: X₂ – X₁. Since the lengths of the legs of this right triangle are now known, we can apply the Pythagorean theorem to find the length of the hypotenuse:

$$d^2=(X₂-X₁)^2+(Y₂-Y₁)^2$$

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}$$

Distance Calculation Examples

Example 1: Standard Coordinates

Let’s find the distance between Point 1 at (X₁, Y₁) = (3, 1) and Point 2 at (X₂, Y₂) = (5, 7). By substituting the values of X₁, Y₁, X₂, and Y₂ into the Euclidean distance formula, we get:

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}=\sqrt{(5-3)^2+(7-1)^2}=\sqrt{2^2+6^2}$$

$$\sqrt{2^2+6^2}=\sqrt{4+36}=\sqrt{40}=2\sqrt{10}\approx 6.32$$

Notice that swapping the order of the points does not alter the final result. Because the differences between the coordinates are squared, the output remains positive. Let’s repeat the calculation in reverse, assuming Point 1 is (5, 7) and Point 2 is (3, 1):

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}=\sqrt{(3-5)^2+(1-7)^2}=\sqrt{(-2)^2+(-6)^2}$$

$$\sqrt{2^2+6^2}=\sqrt{4+36}=\sqrt{40}=2\sqrt{10}\approx 6.32$$

Example 2: Negative Coordinates

Let’s look at an example using negative coordinates. We will calculate the distance between Point 1 at (X₁, Y₁) = (-4, 2) and Point 2 at (X₂, Y₂) = (6, -6). Substituting these values into the distance formula gives us:

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}=\sqrt{(6-(-4))^2+(-6-2)^2}=\sqrt{10^2+(-8)^2}$$

$$\sqrt{10^2+(-8)^2}=\sqrt{100+64}=\sqrt{164}=2\sqrt{41}\approx 12.8$$

Real-Life Applications

As demonstrated above, the Euclidean distance formula is directly derived from the Pythagorean theorem. However, it specifically adapts the theorem to scenarios where only the precise coordinates of the points are known, rather than the side lengths of a triangle. This formula is incredibly useful for calculating distances based on map coordinates or graph data. It is also a fundamental mathematical concept used to calculate the magnitudes of complex numbers and vectors.

Example 3: Ladder Against a Wall

Imagine a ladder leaning against a wall. In this real-world scenario, the floor acts as the x-axis of our 2D plane, and the wall acts as the y-axis, as illustrated below. If the ladder touches the wall at point (0, 2) and touches the floor at point (3, 0), how do we find the total length of the ladder?

Distance Formula Calculator

Solution

To find the length of the ladder in this 2-dimensional plane, we first need to identify the coordinates of its endpoints: (X₁, Y₁) and (X₂, Y₂).

Let’s designate the spot where the ladder meets the wall as Point 1 (X₁, Y₁), and the spot where the ladder meets the floor as Point 2 (X₂, Y₂). We know the ladder touches the wall at coordinates (0, 2). Therefore:

X₁ = 0, Y₁ = 2

Notice that X₁ = 0. As shown in the image, the origin point (0, 0) represents the physical corner where the floor meets the wall, making negative distance values impossible in this context.

Next, we know the ladder touches the floor at coordinates (3, 0). Therefore:

X₂ = 3, Y₂ = 0

Here, Y₂ = 0 because the ladder is resting directly on the floor. Now, we simply apply the distance formula to calculate the length of the ladder:

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2}=\sqrt{(3-0)^2+(0-2)^2}=\sqrt{3^2+(-2)^2}$$

$$\sqrt{3^2+(-2)^2}=\sqrt{9+4}=\sqrt{13}\approx 3.6$$

Answer

The length of the ladder is approximately 3.6 units.

Calculating Distance in 3D Space

Euclidean distance corresponds to what most people simply refer to as "distance." When you say an object is 5 meters away, you are describing its Euclidean distance. Interestingly, the 2D distance formula described above can be easily expanded into 3 (or even more) dimensions.

To find the distance between two points in 3-dimensional space—Point 1 (X₁, Y₁, Z₁) and Point 2 (X₂, Y₂, Z₂)—you still calculate the square root of the sum of the squared differences between their corresponding coordinates. The formula simply includes an extra Z-axis component:

$$d=\sqrt{(X₂-X₁)^2+(Y₂-Y₁)^2+(Z₂-Z₁)^2}$$