Text · Made a little simpler

Line Ending Converter

Count and convert CRLF, LF and CR in a text file. Optionally trim trailing spaces or limit blank lines, then download in the source Unicode encoding.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device

Open the original file to count its exact endings. Text pasted or edited in a browser field can use LF for every break.

Optional whitespace cleanup

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

Line Ending Converter: how to use it

  1. Open the original Unicode text file or load the mixed-ending example. Paste text if its original line-ending bytes are unavailable.
  2. Check the CRLF, LF and CR counts. Choose the target, select any whitespace cleanup you need and convert.
  3. Download the converted file to preserve its newline bytes and any byte-order mark. Reopen the download to verify the result.

Limits and notes

Up to 400,000 UTF-16 units. Accepts UTF-8 text and UTF-16 or UTF-32 text with a byte-order mark. Optional cleanup treats ASCII spaces and tabs as whitespace. CRLF, LF and CR are the physical line separators. Browser fields and the system clipboard can normalize line endings.

How your privacy works →

Line Ending Converter: common questions

Does a CRLF pair count as two line endings?

No. A carriage return immediately followed by a line feed is one CRLF occurrence. Standalone carriage returns and line feeds have their own counts.

Will conversion add a newline to the end of my file?

With both cleanup switches off, an existing last ending becomes the target format and a file that ends in text still ends in text. Removing spaces from an unterminated blank line can leave an existing separator at the end of the file.

Why does a pasted file show fewer types of line endings?

The browser can normalize different line endings in its text field. Open the original file to inspect the exact bytes.

How do I remove extra blank lines without changing indentation?

Choose Limit consecutive blank lines and enter the number to keep in each run. A limit of zero removes those records. Leading spaces on nonblank lines are preserved.

Guides