Convert text between CRLF (Windows), LF (Unix / modern macOS), and CR (classic Mac OS ≤ 9) line endings. Visualize the hidden newline bytes, detect mixed endings, and copy or download the result.
Hidden line ending bytes made visible. \r\n = CRLF, \n = LF, \r = CR. Trailing whitespace is marked with ·.
| Context | Use | Bytes |
|---|---|---|
| Unix / Linux source files, shell scripts | LF | 0x0A |
| macOS (modern, OS X / 10+) | LF | 0x0A |
| Git repos (default, recommended) | LF | 0x0A |
Windows Notepad, .bat, .cmd | CRLF | 0x0D 0x0A |
| HTTP headers (RFC 7230) | CRLF | 0x0D 0x0A |
| SMTP / IMAP / POP3 / FTP (control) | CRLF | 0x0D 0x0A |
| CSV per RFC 4180 (canonical) | CRLF | 0x0D 0x0A |
| Classic Mac OS (System 1–9) | CR | 0x0D |
Git auto-conversion: git config --global core.autocrlf input on Linux/macOS, true on Windows. Configure per-repo with .gitattributes: * text=auto eol=lf.
dos2unix file.txt, unix2dos file.txt, tr -d '\r' < in.txt > out.txtsed -i 's/\r$//' file.txt (CRLF→LF), sed -i 's/$/\r/' file.txt (LF→CRLF)(Get-Content file -Raw) -replace "`r`n","`n" | Set-Content file -NoNewline