Line Ending Converter
Detect and convert line endings between CRLF (Windows), LF (Unix/macOS) and CR, with mixed-ending detection.
Drag & drop a text file here, or click to browse
No uploads — and only a file reveals the real CRLF/CR endings.
Detected: nothing yet — paste text or upload a file.
Nothing to convert yet — add some text above.
How it works
Windows ends every line with a carriage return plus a line feed (CRLF, \r\n),
while macOS, Linux and virtually every modern toolchain use a bare line feed (LF,
\n). Classic Mac OS used a lone carriage return (CR, \r). Mixing
them produces the ^M characters you see in diffs, broken shell scripts, noisy
Git history and CSV files that import as one giant row. This tool counts the CRLF, LF and CR
endings in your text, tells you which convention it currently uses, and rewrites every line
break to the one you pick.
Paste text into the box or drop a .txt, .csv, .md,
.json or source file onto the drop zone — browsers normalise pasted text to LF,
so upload the file itself when you need honest detection. Optional extras trim trailing
spaces on every line and guarantee a final newline, the way most linters want it. Turn on
"Show line ending markers" to see ␍␊, ␊ or ␍ at the
end of each line. Everything runs in your browser with the FileReader API and plain string
operations — nothing is uploaded, so source code, logs and exports stay private.
Frequently asked questions
What is the difference between CRLF and LF?
LF is a single line feed character (\n) and is what macOS, Linux and almost every modern toolchain use. CRLF is a carriage return followed by a line feed (\r\n) and is the Windows convention. Classic Mac OS used a lone carriage return (CR, \r). Mixing them is what produces stray ^M characters in diffs, broken shell scripts and CSV files that import as one long row.
How do I convert CRLF to LF online?
Drop your file onto the drop zone or paste the text, pick LF as the target, and the converted result appears instantly with a line and byte count. Use Copy text or Download .txt to take it with you. Switch the target to CRLF or CR to go the other way — it is a browser-based dos2unix and unix2dos in one page.
Why does pasted text always show as LF?
Browsers normalise the contents of a textarea to LF, so any text you paste loses its original carriage returns before this page can see them. That is why the tool also accepts a file: upload the .txt, .csv, .md, .json or source file itself and the detector reports the real CRLF, LF and CR counts, including mixed endings. Everything is read locally with the FileReader API and never leaves your device.