Line Ending Converter (CRLF ↔ LF)
Convert text files between Windows (CRLF), Unix and macOS (LF) and classic Mac (CR) line endings, add or remove the UTF-8 BOM, and see which line endings a file uses.
Text files end their lines with different invisible characters: Windows uses CR LF (\r\n), Linux and macOS use LF (\n), and Mac OS before 2001 used CR alone. The wrong kind shows up as one long line in old Notepad, ^M at the end of lines in a terminal, noisy diffs in Git or scripts that fail with “bad interpreter”. This converter rewrites a file’s line breaks to the kind you choose, can add or remove the UTF-8 byte order mark, and reports how many of each kind the file contained.
How to use this tool
- Choose one or more text files (or paste text).
- Pick the line ending you need: LF for Linux, macOS and most code, CRLF for Windows tools.
- Keep, add or remove the UTF-8 BOM; adding it helps Excel open UTF-8 CSV files with accents or Korean correctly.
- Download each converted file; the table shows what each file used before.
Formula
CRLF = bytes 0D 0A · LF = 0A · CR = 0D; every line break of any kind is rewritten as the chosen one
The file is processed as raw bytes, so its encoding is never changed: UTF-8, ASCII and legacy encodings such as Windows-1252, Shift_JIS or EUC-KR keep every other byte exactly, because none of them uses 0D or 0A inside a character. UTF-16 files (detected by their byte order mark) are processed two bytes at a time and keep their BOM. Files containing zero bytes are treated as binary and skipped, and so are the rare UTF-32 files. A file can mix kinds; the table counts each.
Example
A 26-byte file containing “Hello world.” and “Second line.” with LF endings becomes 28 bytes after converting to CRLF, because each of its 2 line breaks gains a CR byte. Converting it back to LF restores the original 26 bytes; adding a UTF-8 BOM to the LF version makes it 29 bytes.
Frequently asked questions
Which line ending should I use?
LF for code, scripts, websites and anything used with Git, Linux or macOS. CRLF for files that old Windows tools, batch files or some Windows-only programs must read. Modern Windows editors, including Notepad since 2018, read both.
Why can I not just paste the text?
Browsers normalise every pasted line break to LF, so the original line endings are lost on the way in. Pasted text is still converted and saved as a file, but only a file shows you what it really contained.
What is a BOM and do I need it?
The byte order mark (EF BB BF) at the start of a UTF-8 file tells some programs, notably Excel, that the file is UTF-8. Many Unix tools and some parsers dislike it, so remove it for scripts and config files.
Last updated:
Page address with these inputs: https://kakao.mobile/tools/line-ending-converter/
Cite or embed this tool
kakaoCalc. (2026, November 8). Line Ending Converter (CRLF ↔ LF). https://kakao.mobile/tools/line-ending-converter/
“Line Ending Converter (CRLF ↔ LF).” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/line-ending-converter/.