Line Ending Converter

Detect whether a file uses LF, CRLF or CR line endings and convert it to one of them.

Current Format: -
Lines: 0
Input

Note: Browser textareas automatically convert pasted text to LF. To test CRLF/CR, use Load File or the sample buttons below.

Test Samples:
Convert to:
Output

Linux and macOS end lines with LF (\n), Windows with CRLF (\r\n). Load a file and the tool counts which endings it contains, then builds a copy using the one you pick. The file is read in your browser and never uploaded.

The Mixed Sample is four lines ending in LF, CRLF and CR. The current format shows Mixed and the input is 81 B. Converting gives 80 B for LF, 83 B for CRLF (one extra byte per line) and 80 B for CR. If the last line has no ending, none is added.

Why pasted text always shows LF

A browser text box turns every line ending in pasted text into LF, so the true endings are only visible when you load the file itself. If you edit even one character after loading, the tool recounts from the text on screen.

A CRLF result copied into another text box becomes LF there, so use Download to keep the endings. A shell script that fails on Linux with /bin/bash^M was saved with CRLF.