DataToolsLab
Code Formatter Tools

Code Line Ending Normalizer

Normalize line endings (LF, CRLF, CR) across pasted source, with a live count of what is currently in use.

Loading tool…

What is Line Endings?

A detector and converter for the invisible difference that makes Git report a whole file as changed and makes `bash ` a command name. It counts each line-ending style and rewrites the text to a single one.

How it works

The text is scanned for `\r\n`, `\n` and bare `\r` — the three styles are counted separately, so a mixed file is visible rather than averaged. Converting rewrites all three to the chosen style, LF by default because that is what Git stores and what Unix tools expect.

  1. Paste the source. Drop in code, a stylesheet, a query or a selector list. Everything is read locally — the page never uploads what you paste.
  2. Choose the options. Indent width, quote style, keyword case or target browsers. The result updates as you change them, so you can see the effect immediately.
  3. Copy or download. Copy the result to the clipboard or download it as a file. Reset clears the form and returns every option to its default.

Examples

A file with one stray CR from an old backup

The counts show 1,842 CRLF and 1 bare CR — the one line that breaks a shell script, found in seconds.

Preparing a file for a Windows-only tool

Notepad still expects CRLF for older versions; convert and download the file in that style.

Common mistakes

Expecting a formatter to fix invalid code

Formatting is whitespace and quoting. A missing brace, an unclosed tag or an unquoted variable survives the round trip and is reported instead — check the findings list.

Minifying without running the tests afterwards

Even a safe, non-mangling minifier can expose an existing automatic-semicolon-insertion bug. The JavaScript Minifier keeps the newlines that matter, but re-run your tests before shipping.

Treating a rewritten query as verified

The SQL Dialect Converter translates the syntax it can prove; data types, casts and function differences are listed for review, not guessed. Run the converted query against a real database.

Renaming or reformatting generated files

Regenerating a formatter's output is a no-op only if the formatter is the same one that produced it. Keep generated code out of the round trip and format the source it came from.

Frequently asked questions

Which style should I use?

LF in the repository, whatever your editors prefer on disk. Git converts on checkout when `core.autocrlf` or a `.gitattributes` file says so, and that keeps the history clean.

Why does Git think I changed every line?

Because every line's ending changed — Git compares bytes. Normalise to LF, add `* text=auto eol=lf` to `.gitattributes`, and commit; the diff noise disappears and stops coming back.

Does converting break binary content?

It can, if the textarea holds encoded binary. This is a text tool: convert files that are text, and leave images, archives and executables to a byte-exact tool.

Online