Convert line endings: CRLF and LF

Open a text file to count its real line endings, then download it converted to Windows (CRLF), Unix and macOS (LF) or classic Mac (CR).

  • Free
  • No sign-up
  • Runs in your browser
line-endings-converter

100% private — your text is processed in your browser and never sent to any server.

How it works

Open a file

Or paste text. Opening a file keeps its original line endings so they can be counted.

Choose the format

Windows (CRLF), Unix and macOS (LF) or classic Mac (CR).

Download the file

The download uses the line endings you selected.

Why the same text breaks on another system

A line break is not one thing but three. Windows ends a line with two characters, a carriage return followed by a line feed (CRLF). Linux and modern macOS use a single line feed (LF). Very old Mac systems used a lone carriage return (CR). Most programs cope with all of them, but not all do, and the mismatch produces some familiar symptoms: a script that fails with a mysterious error on Linux, a file that shows as one long line in an old editor, a stray ^M at the end of every line, a diff that marks every line as changed or a checksum that differs between two otherwise identical files.

See what your file really contains

A text box cannot show you the line endings, because the browser normalises them as soon as you paste. That is why this tool lets you open a file directly. It reads the raw bytes, counts how many CRLF, LF and CR breaks the file contains and shows the totals, so you can see at once whether a file is pure Windows, pure Unix or a mix of both, which is the case that causes the most trouble.

Convert and download

Choose the format you need and press "Download .txt". The file is written with the same line ending on every line, whatever it had before. The text shown in the box is only a preview and uses LF, since the browser cannot display the difference. The download is the file that carries the converted line endings, and it is a plain text file with UTF-8 encoding.

Which one should I use?

Use LF for anything that will run on Linux or macOS, for source repositories and for web files. Use CRLF for files that Windows programs will read, such as batch scripts or text destined for older Windows software. CR is only needed for very old systems.

What it does not do

The tool treats the file as text. It should not be used for binary files, and it does not change the file encoding, the byte order mark or the last line of the file. Copying the text from the box instead of downloading it will not carry a specific line ending, because the clipboard uses the system default.

Frequently asked questions

What is the difference between CRLF and LF?
CRLF is a carriage return plus a line feed, used by Windows. LF is a single line feed, used by Linux and macOS.
How do I convert Windows line endings to Unix?
Open the file, choose "Unix / Linux / macOS (LF)" and press Download. Every line ending in the file becomes LF.
How can I tell which line endings my file has?
Open it with the file button. The tool counts the CRLF, LF and CR breaks in the original file and shows the totals.
Why doesn't pasting text show the original line endings?
The browser normalises line endings when text is pasted into a box. Open the file directly to see the real ones.
Does copying the result keep CRLF or LF?
No. Copying uses the system clipboard, which does not preserve a chosen line ending. Use the download button for that.
Is my file uploaded anywhere?
No. It is read and converted in your browser.