Line Ending Converter (LF, CRLF)

Paste text or choose a file, pick the line ending you want and get the converted text, a count of each ending found and a download of the fixed file.

Use the tool

Loading the tool…

About Line Ending Converter (LF, CRLF)

Change the line endings in text between LF, CRLF and CR. Paste text into the box, or choose a text file of up to 5 MB. You can also remove spaces and tabs at the end of each line, and choose whether the last line ends with a line ending.

Worked example

Paste text saved on Windows, which uses CRLF, and convert it to LF for a Linux server. The tool shows the text with LF line endings.

Limits

Line endings are invisible, so check the result in the program where you will use it. The file is processed in your browser and is not uploaded to us.

How to use Line Ending Converter (LF, CRLF)

  1. Paste your text, or choose a text file.
  2. Choose the line ending you want.
  3. Read the counts to see what was changed.
  4. Copy the result or download the converted file.

Good to know

  • LF is one character (line feed). CRLF is two (carriage return, then line feed). CR alone was used by Mac OS 9 and older.
  • Mixed endings are made the same. Text that already uses the one you pick is left as it is.
  • Only text files in UTF-8 are accepted, so no characters are damaged. Binary files are refused.
  • Git, shell scripts and many build tools fail on the wrong ending, for example a script with CRLF may print "bad interpreter".

Frequently asked questions

How do I change CRLF to LF?

Choose LF (Unix) as the target. Every CRLF and lone CR becomes a single LF.

Why does my Linux script fail with a strange error?

It probably has Windows (CRLF) endings. Convert it to LF and try again.

Does it change the text inside the lines?

No. Only the line breaks change. A missing last line break is not added unless you ask for it.