← All text tools

Distance from a point to a line

Calculate the shortest distance from a point to a line given by its equation or by two points, with the foot of the perpendicular drawn.

  • Free
  • No sign-up
  • Works on any device

About Distance from a point to a line

The shortest distance from a point to a line is measured along the perpendicular. For a line Ax + By + C = 0 and a point (x0, y0) it is |Ax0 + By0 + C| / sqrt(A^2 + B^2). You can give the line as an equation or as two points on it, which the page converts. For the point (1, 2) and the line 3x + 4y - 5 = 0 the distance is 6/5 = 1.2, and the foot of the perpendicular is (0.28, 1.04). A drawing shows the line, the point and the perpendicular segment on equal scales.

How to use Distance from a point to a line

  1. Enter the coordinates of your point.
  2. Choose whether the line is given by A, B and C or by two points, and fill in those values.
  3. Read the distance and the foot of the perpendicular, and compare them with the drawing.

Why use this tool?

Also known as

Frequently asked questions

Why is there an absolute value in the formula?

The expression Ax0 + By0 + C is positive on one side of the line and negative on the other. Distance cannot be negative, so the absolute value is used.

What does the foot of the perpendicular mean?

It is the point on the line closest to your point. The segment joining the two points meets the line at a right angle.

How is a line through two points turned into A, B and C?

With points (x1, y1) and (x2, y2), take A = y2 - y1, B = x1 - x2 and C = x2 y1 - x1 y2. The page does this for you.

Is Distance from a point to a line free?

Yes. Distance from a point to a line on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Distance from a point to a line on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools