Categories
Line Ending Converter
Convert a text's line endings between LF, CRLF, and CR.
Overview
- Converts a text's line endings between LF, CRLF, and CR.
- Different operating systems use different default line endings (LF on Unix/macOS, CRLF on Windows), so files exchanged between OSes can end up with mixed line endings.
- Before converting, the tool also shows how many of each line ending type are present in the input.
Usage
- Paste your text into "Input".
- Select LF, CRLF, or CR under "Target line ending".
- Click "Convert" to see the text with a unified line ending in "Output".
Example
Input
line1\nline2\r\nline3 (mixed LF + CRLF)
Output
line1\r\nline2\r\nline3 (unified to CRLF)
Use Cases
- Unifying line endings in text files exchanged between Windows and Mac/Linux developers
- Normalizing existing files' line endings before introducing Git's core.autocrlf setting
- Cleaning up a text whose diff is cluttered by mixed line endings
FAQ
What is the difference between LF, CRLF, and CR?
LF uses only \n (0x0A) as the line ending and is the standard on Unix, macOS, and Linux. CRLF uses \r\n (0x0D 0x0A) and is the standard on Windows. CR uses only \r (0x0D) and was used on classic Mac OS (Mac OS 9 and earlier).
What happens when converting text with mixed line endings?
All line endings are first normalized to LF, then converted to the selected target line ending, so mixed line endings are unified into a single type.
What if the input has no line breaks at all?
All line ending counts are shown as 0, and the text itself is output unchanged.
I can't tell the difference between CRLF and LF by looking at the "Output" field.
Due to how browsers handle text areas, line endings are always treated as LF when displaying or manually selecting/copying from a text area, so you can't see the difference by looking at it or copying it manually. Use the "Copy" button to get text with the exact line ending — copying via the button passes the selected line ending directly to your clipboard.
Notes
- Conversion runs entirely in your browser; the text you enter is never sent externally.
- Due to how browsers display text areas, the "Output" field looks the same regardless of line ending. To get text with the exact line ending applied, use the "Copy" button rather than manually selecting the text.
Related Tools
Remove duplicate lines from text.
Sort lines of text in ascending, descending, or numeric order.
Convert text to camelCase, snake_case, and other naming conventions.