Guide
Converting line endings between CRLF, LF and CR
Text files end each line with an invisible marker, and operating systems disagree about which. Windows uses two characters, carriage return plus line feed (CRLF). Linux, macOS and almost every programming tool use a single line feed (LF). Classic Mac OS used a lone carriage return (CR). Files moving between systems carry the wrong endings with them, and things break in confusing ways. This converter rewrites the line endings of any number of text files, in your browser, without touching anything else.
Symptoms of wrong line endings
A shell script copied from Windows fails on Linux with “bad interpreter” or “$‘\r’: command not found”, because each line ends with an extra carriage return. Editors show ^M at line ends. Git diffs show every line changed after someone edited a file on another system. Some Windows programs show an LF-only file as one long line, and CSV importers split rows wrongly. Converting the endings fixes all of these.
How it works
Drop one or more files. For each, the table shows its size, how many CRLF, LF and CR line endings it contains, whether it ends with a newline and its encoding. Choose the target — LF, CRLF or CR — and download. Mixed files are normalised, so every line ends the same way afterwards.
Only the line breaks change
The conversion works directly on the file’s bytes. Line-break bytes are rewritten; every other byte, including accented letters in UTF-8, special characters in older single-byte encodings and the byte order mark, is copied exactly. Files in UTF-16 with a byte order mark are processed character by character, so they stay valid UTF-16. Your file is never decoded and re-encoded, which is what makes this safe for source code and data.
Final newline
Many tools expect a text file to end with a line break; Git marks files without one as “No newline at end of file”, and POSIX defines a line as ending with a newline. With “End every file with a line break” on, a missing final newline is added. Files that already end with one are not given a second.
Many files at once
Drop a whole folder’s worth of files. Download them one by one, or press “Download all” to get a ZIP with every converted file under its original name. Converted files are new downloads; your originals stay as they were until you replace them.
Preventing it in Git
For a repository, add a .gitattributes file with a line such as * text=auto eol=lf, so Git normalises line endings on commit and checks them out consistently. Use this converter for one-off files, uploads to servers and systems that need a specific ending.
A worked example
A deploy.sh written on Windows shows “CRLF 42” and fails on the server. Converting to LF with the final newline option gives a file that shows “LF 42”, has exactly 42 fewer bytes, and runs.
Related tools
See every whitespace character and line ending in the Whitespace Visualizer, fix CSV character encoding with Fix CSV Encoding, clean pasted text with the Text Cleaner, or compare file versions with the Diff Checker.
Checked against the current version of the Line Ending Converter (CRLF ⇄ LF) on .

