Line Ending Converter (CRLF, LF, CR)
Detect and convert CRLF, LF and CR line endings. Counts each style, flags mixed files and rewrites the whole document to the one you choose.
Converted text
Paste text or drop a file to see how many CRLF, LF and CR line endings it uses, then convert them all to one style.
What is the Line Ending Converter (CRLF, LF, CR)?
Windows ends lines with a carriage return and a line feed (CRLF), Unix and macOS use a lone line feed (LF), and classic Mac OS used a lone carriage return (CR).
- Counts CRLF, lone LF and lone CR separately and names the dominant style
- Warns clearly when a file mixes line-ending styles
- Converts to LF, CRLF or CR in one pass
- Ensure, remove or keep the trailing newline
- Optionally strips trailing spaces and tabs from every line
- Accepts pasted text or a dropped file, read locally in your browser
How to use the Line Ending Converter (CRLF, LF, CR)
- 1
Paste your text into the box, or drop a text file onto the drop zone.
- 2
Read the counts for CRLF, lone LF and lone CR, and check whether the file is flagged as mixed.
- 3
Choose the line ending you want to convert to: LF, CRLF or CR.
- 4
Optionally set the trailing-newline behaviour and tick “Strip trailing spaces and tabs”.
- 5
Copy the converted text, or download it to get the exact bytes.
About the Line Ending Converter (CRLF, LF, CR)
Windows ends lines with a carriage return and a line feed (CRLF), Unix and macOS use a lone line feed (LF), and classic Mac OS used a lone carriage return (CR). Mix them in one file and your diffs light up every line, your shell scripts fail with strange errors and your CSV imports break.
This converter counts every CRLF, every lone LF and every lone CR in your text, tells you which style dominates or warns you that the file is mixed, then rewrites the whole document to the ending you pick. You can also force a single trailing newline, remove trailing newlines entirely, and strip trailing spaces and tabs at the same time.
Paste text directly or drop a file onto the page — files are read in your browser and never uploaded, so source code, logs and exports all stay on your machine. Because line endings are invisible in a text box, download the result when you need to confirm the exact bytes.
Frequently asked questions
What is the difference between CRLF and LF?
CRLF is two characters, a carriage return (0x0D) followed by a line feed (0x0A), and it is the Windows convention. LF is the single line feed character used by Linux, macOS and almost every internet protocol. Git, compilers and shells often care which one a file uses.
Why does my whole file show as changed in a diff?
Almost always because the line endings changed. If one editor saved the file as CRLF and another as LF, every single line differs at the byte level even though the visible text is identical. Converting the whole file to one style fixes it.
How do I convert CRLF to LF?
Paste the file or drop it in, choose LF as the target and copy or download the result. Every CRLF, lone LF and lone CR is normalised first, so mixed files come out consistent.
Why should a text file end with a newline?
POSIX defines a line as ending with a newline character, so tools like wc, git and many compilers expect one. Turning on “Ensure exactly one at the end” adds it without leaving a stack of blank lines behind.
Are my files uploaded when I drop them in?
No. Dropped files are read with the browser's own file API and processed in JavaScript on your device. Nothing is transmitted, so source code and logs stay private.
Related tools
Whitespace Visualizer
Draw every space, tab and line break as a visible glyph, and highlight non-breaking spaces, exotic spaces and zero-width characters with a per-type tally.
Remove Empty Lines
A free empty line remover that strips blank lines from text or code in one click. Optionally delete whitespace-only lines or collapse multiple blanks into one.
Remove Extra Spaces
Collapse double spaces into one, trim spaces at line ends and convert tabs to spaces. Clean messy whitespace from pasted text instantly.
Filename Sanitizer
Turn any text into a safe file name. Strips forbidden characters, folds accents, renames Windows reserved names and caps the length in UTF-8 bytes.
Sort Lines
Sort lines of text alphabetically A to Z or Z to A, by length, numerically, or shuffle randomly. Options to ignore case and remove duplicates.