Line Ending Converter (CRLF, LF, CR)

The dos2unix problem in your browser. Convert any text's line endings between Windows CRLF, Unix LF, and old Mac CR. The detection report tells you what's in the input so you can confirm before converting.

How to use the Line Ending Converter (CRLF, LF, CR)

Paste text and pick the target line ending — LF (Unix/macOS), CRLF (Windows), or CR (classic Mac). The output is converted in place, and a detection report tells you which endings the input currently uses so you can confirm before copying.

Switching between CRLF, LF, and CR line endings

Windows ends lines with CRLF (a carriage return plus a line feed), Unix and modern macOS with a bare LF, and classic Mac OS once used a lone CR. When files move between platforms the mismatch surfaces as ^M characters in editors, shell scripts that refuse to run, and diffs where every single line looks changed.

This converts a block of text to whichever convention you need — the job dos2unix and unix2dos do at the command line — entirely in the browser. To also trim trailing whitespace and blank lines, use the whitespace trimmer; to normalize tabs and spaces, tab to space; to find out what encoding a file uses, the file encoding detector.

Common use cases

  • Cross-platform scripts — convert a Windows-edited shell script to LF so it runs on Linux.
  • Diff cleanup — kill the “whole file changed” diff caused by an ending switch.
  • dos2unix in the browser — do the conversion without opening a terminal.
  • Git normalization — prep a file to match your .gitattributes EOL rule.
  • Removing ^M — strip the carriage returns that show up as ^M in a Unix editor.

Frequently asked questions

What is the difference between CRLF and LF?

CRLF (\r\n) is the Windows convention; LF (\n) is used by Unix and modern macOS. A lone CR (\r) is classic Mac OS.

Why do I see ^M characters in my file?

Those are the carriage returns from CRLF endings, shown by a Unix editor. Convert to LF to remove them.

Is this the same as dos2unix?

Yes — converting CRLF to LF is exactly what dos2unix does, and LF to CRLF is unix2dos.

Does it change the text content?

No, only the invisible line-ending bytes. The visible characters are untouched.
Embed this tool on your site

Free to embed, no attribution required (but appreciated). Paste this where you want the tool to appear: