Line ending converter

Open a file or paste a text to see which line endings it uses, including mixed ones, then convert to Unix LF, Windows CRLF or classic Mac CR. The converted text can be copied or downloaded.

Text typed or pasted in the box always shows as LF, because the browser normalizes it. Open a file to see its real line endings.

LF (Unix, macOS) · CRLF: 0 · LF: 2 · CR: 0

Convert to

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Open a text file, or paste the text.
  2. Read the detected type and the counts of each kind of line break.
  3. Choose the ending to convert to, then copy the result or download it.

How it works

Line breaks are found with one pattern that tries CRLF first, then LF, then CR, so a Windows break is never read as two. Counting each kind tells you whether the text is uniform or mixed. Converting replaces every break with the chosen one.

Worked example

A file with 3 CRLF breaks and 1 LF break is shown as mixed. Converting to LF gives four LF breaks and no CR at all.

Tips

Git, many compilers and shell scripts expect LF; a script with CRLF endings often fails on Linux with an odd “bad interpreter” error. Some old Windows programs still need CRLF. If a file ends without a final line break, none is added.

Frequently asked questions

What are CRLF, LF and CR?

They are the characters that end a line. LF (line feed, \n) is used by Linux and macOS, CRLF (carriage return plus line feed, \r\n) by Windows, and CR (\r) by Mac OS up to version 9. Today only LF and CRLF are common.

Why does pasted text always show LF?

Browsers normalize line breaks in a text box to LF. To see the true endings of a document, open it as a file with the button above. The conversion then works on the original bytes of the text.

How is a mixed file handled?

Every kind of line break is counted, and all of them are replaced by the one you choose. A CRLF pair is counted once, not as an LF plus a CR.

Does converting change anything else?

No. Only the line breaks are replaced. Text, spaces and the final line break (if any) stay as they are. The file is read as UTF-8 text, so use it for text files, not for binary ones.

Is the file uploaded?

No. It is read and converted in your browser and never leaves your device.

More in Text

All tools in this category: Text ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.