Skip to content
TextArray
100% local

Line ending converter

Detect CRLF, LF and CR line endings with counts and convert a whole text to one consistent style.

Input
Output

Line ending converter

Every operating system family ends lines its own way: Unix and modern macOS use LF, Windows uses CRLF, and classic Mac OS used a bare CR. Paste any text and the converter reports exactly what it found — how many CRLF, LF and CR endings, and whether the file is consistent or mixed — then rewrites every ending to the style you choose. The tally reads like a receipt: 14 CRLF + 2 LF → 16 LF, so you can see at a glance what changed.

Mixed endings are the classic invisible bug. A file edited on Windows and Linux in turn stops matching in diffs, git flags every line as changed, shell scripts fail with cryptic errors like "bad interpreter: /bin/bash^M", and CSV imports gain phantom blank rows. Because the difference is invisible in most editors, the fastest fix is exactly this: paste, convert to LF (or CRLF for Windows tooling), copy back.

Two extra options finish the cleanup in one pass. "Ensure single trailing newline" makes the text end with exactly one newline — the POSIX convention that linters and code reviews keep asking for — and "Strip trailing whitespace on each line" removes the spaces and tabs that hide at line ends and pollute diffs. Both are off by default, so the tool changes nothing you did not ask for.

Your text is processed entirely in your browser and never uploaded anywhere. Convert scripts, config files and source code safely, then copy the result or download it as a .txt file.

FAQ

What are CRLF, LF and CR?
They are the invisible characters that end a line: LF (line feed) on Unix, Linux and modern macOS, CRLF (carriage return + line feed) on Windows, and a bare CR on classic Mac OS. Text looks identical either way — tools are what notice the difference.
How do I know if my file has mixed endings?
Paste it. The tally lists every kind it found with counts, e.g. 14 CRLF + 2 LF, which means the file is mixed. After converting, all endings are the target kind.
What does "Ensure single trailing newline" do?
It makes the text end with exactly one newline of the target kind: one is added if missing, extras are removed. POSIX defines a line as ending with a newline, which is why many linters require this.
Why do my shell scripts fail with ^M errors?
The script has Windows CRLF endings, and the shell reads the CR as part of the command — the classic "bad interpreter" error. Convert the script to LF and it runs.
Is my text uploaded anywhere?
No. The tool runs entirely in your browser and your text never leaves your device — safe for scripts, configs and source code.