About the Line Ending Converter
Different operating systems mark the end of a line with different characters. Windows uses two, a carriage return followed by a line feed (CRLF). Linux, macOS and the web use a single line feed (LF), and very old Macintosh systems used a single carriage return (CR). Files that mix them, or that are opened on the wrong system, show stray characters, merged lines or broken scripts. This tool counts the line endings in your text and converts them all to the one you choose. You can paste text or open a file, and copy or download the result with the endings preserved.
Updated October 2026
How to use the Line Ending Converter
- 1Paste your text or open a text file with the button.
- 2Choose LF, CRLF or CR as the target.
- 3Check the note to see how many of each ending the text had.
- 4Read the converted text in the right-hand box.
- 5Copy it or download it as a file. The download keeps the exact endings.
Which ending for which system
- Linux and macOS: LF.
- Windows text files and batch scripts: CRLF.
- Web pages, JSON and most source code: LF is the usual choice.
- CSV files for Excel: CRLF works well, LF is also read by modern versions.
- Classic Mac OS before 2001: CR, rarely met today.
How to open a file safely
Use Open a text file so the original endings are read exactly. If you paste text instead, a browser keeps CRLF when the clipboard supplies it, but the box may normalise some edits. After converting, use Download and the file will contain the endings you picked. Always keep a copy of the original in case the file was not plain text, since binary files should never be converted this way.
Checking the result
Editors such as VS Code show the ending of the current file in the status bar, and many can switch it directly. Command line tools such as dos2unix and unix2dos do the same job in bulk. This online version is convenient for single files, snippets and quick fixes, with nothing to install.
Related tools
The Tabs to Spaces Converter fixes indentation, the Remove Line Breaks tool joins lines, the Diff Checker compares two versions of a file and the Text Cleaner removes odd characters. The Escape and Unescape Text tool shows how line breaks look inside code strings.
Features
- Counts LF, CRLF and CR in the original
- Converts everything to one style
- Open a file to keep the real endings
- Download keeps the exact endings
- Fixes files with mixed endings
- Private: nothing is uploaded
Frequently asked questions
What is the difference between CRLF and LF?
CRLF is two characters, carriage return and line feed, used by Windows. LF is the single line feed used by Linux, macOS and most web and programming tools. Both look like a new line to a reader.
How do I convert CRLF to LF?
Paste your text or open the file, choose LF as the target and copy or download the result. Every CRLF becomes LF, and any lone CR is also changed to LF so the endings are consistent.
Why does my script fail with a strange error on Linux?
Shell scripts saved on Windows often have CRLF endings, and Linux reads the extra carriage return as part of each command, giving errors like bad interpreter. Converting the file to LF fixes it.
Why are my lines joined together or double spaced?
Opening an old-Mac or Unix file in a program that expects CRLF can join lines, and opening a CRLF file in one that expects LF can show extra blank lines or ^M characters. Converting to the style the program expects solves both problems.
Does the text box show the real line endings?
A browser text box displays every kind of line break as a normal line break, so you cannot see the difference there. The Copy button and the download use the exact endings you chose.
Which line ending should I use for Git?
Many teams store LF in the repository and let Git convert to CRLF on Windows checkouts, using the core.autocrlf setting or a .gitattributes file. Check your project's convention.