Line Ending Converter

Convert CRLF/LF line endings, tabs/spaces, trailing whitespace and BOM.

About this tool

Paste text or open a file to see which line endings it uses (including mixed files), whether it has a byte-order mark, how it's indented and how many lines have trailing spaces. Then convert line endings, indentation and the end of the file, and copy or download the result.

Why line endings matter

Text files mark the end of each line with invisible control characters. Windows uses CRLF (carriage return + line feed, \r\n), Linux and macOS use LF (\n), and classic Mac OS used CR (\r). Most editors cope, but tools often don't. A shell script saved with CRLF fails with "bad interpreter: /bin/bash^M", Git diffs show every line changed, and YAML, CSV, Makefiles and tests can break in confusing ways. Mixed endings in one file are the worst case, and this tool counts each kind. It also converts leading indentation between tabs and spaces at a chosen tab width, keeping alignment (for example, six spaces become a tab plus two spaces at width 4). It can trim trailing whitespace, remove the UTF-8 byte-order mark (BOM) that breaks some parsers and shebang lines, and make sure the file ends with exactly one newline, as POSIX tools expect. For a permanent fix, configure Git's core.autocrlf or a .gitattributes file, and an .editorconfig for your editor. Honest limits: files are read as UTF-8 text, so don't process binary files. The text cleaner, the .gitignore generator and the hex viewer are related.

Frequently asked questions

How do I convert CRLF to LF?

Paste the text or open the file, choose LF and copy or download the result.

What does ^M mean in a file?

It's a carriage return (CR) from Windows line endings. Converting to LF removes it.

What is a BOM?

A byte-order mark: an invisible character at the start of some UTF-8 files that can break scripts and parsers.

Is my data uploaded?

No. Everything runs in your browser and nothing is stored or sent.