This distance formula calculator lets you calculate the distance between two points, from a point to a line, or between two parallel lines in a 2–D plane.

The calculator will tell you not only the distance, but also how to calculate it.

Choose your calculator☝️

Enter the coordinates $\hspace{0.2em} (x_1, y_1) \hspace{0.2em}$

$\hspace{0.2em} P_1 = ( \hspace{0.2em}$
,
$\hspace{0.2em} ) \hspace{0.2em}$

Enter the coordinates $\hspace{0.2em} (x_2, y_2) \hspace{0.2em}$

$\hspace{0.2em} P_2 = ( \hspace{0.2em}$
,
$\hspace{0.2em} ) \hspace{0.2em}$

This distance formula calculator lets you calculate the distance between two points, from a point to a line, or between two parallel lines in a 2–D plane.

The calculator will tell you not only the distance, but also how to calculate it.

Each input can be a real number in any format — integers, decimals, fractions, or even mixed numbers. Here are a few examples.

- Whole numbers or decimals → $\hspace{0.2em} 2 \hspace{0.2em}$, $\hspace{0.2em} -4.25 \hspace{0.2em}$, $\hspace{0.2em} 0 \hspace{0.2em}$, $\hspace{0.2em} 0.33 \hspace{0.2em}$
- Fractions → $\hspace{0.2em} 2/3 \hspace{0.2em}$, $\hspace{0.2em} -1/5 \hspace{0.2em}$
- Mixed numbers → $\hspace{0.2em} 5 \hspace{0.5em} 1/4 \hspace{0.2em}$

IMPORTANT — When providing inputs for the linear equation, the coefficients of $\hspace{0.2em} x \hspace{0.2em}$ and $\hspace{0.2em} y \hspace{0.2em}$ cannot both be $\hspace{0.2em} 0 \hspace{0.2em}$ at the same time. That would eliminate both variables from the equation and hence it will no longer be a linear equation.

If you would like to see an example of the calculator's working, just click the "example" button.

As mentioned earlier, the calculator won't just tell you the answer but also the steps you can follow to do the calculation yourself. The "show/hide solution" button would be available to you after the calculator has processed your input.

We would love to see you share our calculators with your family, friends, or anyone else who might find it useful.

By checking the "include calculation" checkbox, you can share your calculation as well.

Here's a quick overview of the distance formulas.

In analytical geometry, we often need to find the distance between two points or two parallel lines or from a point to a line.

Let's look at the formulas we can use to find the distance for each of the three cases.

The distance $\hspace{0.2em} d \hspace{0.2em}$ between points $\hspace{0.2em} P_1\hspace{0.05em}(x_1, \hspace{0.2em} y_1) \hspace{0.2em}$ and $\hspace{0.2em} P_2\hspace{0.05em}(x_2, \hspace{0.2em} y_2) \hspace{0.2em}$ is given by —

$d \hspace{0.2em} = \hspace{0.2em} \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$

The distance $\hspace{0.2em} d \hspace{0.2em}$ of a point $\hspace{0.2em} P_0\hspace{0.05em}(x_0, \hspace{0.2em} y_0) \hspace{0.2em}$ from a line $\hspace{0.2em} ax + by + c = 0 \hspace{0.2em}$ is given by —

$d \hspace{0.2em} = \hspace{0.2em} \frac{|ax_0 + by_0 + c|}{\sqrt{a^2 + b^2}}$

The distance $\hspace{0.2em} d \hspace{0.2em}$ between parallel lines $\hspace{0.2em} ax + by + c_1 = 0 \hspace{0.2em}$ and $\hspace{0.2em} ax + by + c_2 = 0 \hspace{0.2em}$ would be —

$d \hspace{0.2em} = \hspace{0.2em} \frac{|c_1 - c_2|}{\sqrt{a^2 + b^2}}$

Note — For parallel lines, the $\hspace{0.2em} x$–coefficients will be equal and the $\hspace{0.2em} y$–coefficients will be equal too. If they are not equal, they can always be made equal multiplying/dividing any one of the equations by an appropriate factor.

That's why we have used the same coefficients, $\hspace{0.2em} a \hspace{0.2em}$ and $\hspace{0.2em} b \hspace{0.2em}$ for the two lines.

We use cookies to provide and improve our services. By using the site you agree to our use of cookies. Learn more