Convert Line Endings to LF

Open a text file and get it back with every line ending written as LF.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

What does converting to LF actually change?

One invisible character per line, and nothing you can see. A line break saved on Windows is two characters long.

What changes in the file
  1. Find where each line ends
  2. Take out a carriage return that comes before a line feed
  3. Turn a carriage return on its own into a line feed

What it does

Open it, don't paste it

A text box saves every break you paste as LF, so pasted text has nothing left to convert.

Lone carriage returns

Some older files end their lines with a carriage return alone. Those become line feeds too.

Nothing else moves

Spaces at the ends of lines stay exactly as they were, and no break is added or taken away, the last one included.

Limits One UTF-8 text file at a time, up to 16 MiB.

When someone asks for LF line endings

Somebody wants your file "with LF line endings", or a program on a Mac or a Linux machine is having trouble with a file that was written on a Windows PC. You open the file and the words look perfectly normal. So what are they asking you to change?

Every line in a text file ends with an invisible character that means "new line". Most systems use one, called LF, short for line feed. Windows uses two in a row: CR, carriage return, and then LF.

Two characters from the days of the teleprinter

The pair goes back to the teleprinter, an electric typewriter that printed messages sent down a wire. Starting a new line took it two separate moves. One sent the print head back to the left edge of the paper, the way you'd push a typewriter's carriage back. The other rolled the paper up by one line. Each move had its own character. RFC 20, the 1969 note that set out the ASCII characters for the early internet, still describes CR and LF in just those terms.

Screens don't have a carriage to send back, and systems split on what to keep. Unix, and later Linux and macOS, ended each line with the line feed alone. Windows kept both. A file can end up with some of each, too, if it has been edited on more than one kind of computer.

Here's a three-line travel note that has been through both: two lines typed on a Windows PC, and one added on a laptop that writes LF.

trip-notes.txtDay 1: train to LyonCRLFDay 2: old town walkCRLFDay 3: market, then homeLF69 bytesAfter Convert to LFDay 1: train to LyonLFDay 2: old town walkLFDay 3: market, then homeLF67 bytes

Each line's end

Each Windows line loses its CR, one byte apiece, so the file goes from 69 bytes to 67. The words are untouched. How we checked

Converting your file

The converter reads one file at a time, so a folder of files means one trip through these steps each.

  1. Press Open file above the Input box and choose your text file.

  2. Look at the small mark after each line: it says CRLF, CR or LF, whichever that line ends with. The byte count above the box already leaves the CRs out.

    The Input box holding trip-notes.txt: the first two lines are marked CRLF and the third LF.
    The Input box holding trip-notes.txt: the first two lines are marked CRLF and the third LF.
  3. Press Download in the LF line endings box, which a phone shows under Result. The copy keeps your file's name.

Going the other way

Someone asked for Windows line endings instead

Text cleaner

Choose CRLF line endings under To, and every break is written as the CR and LF pair.

Search FluffyBench