Skip to main content

Normalize Line Endings

Standardize messy line endings, Windows (CRLF), old Mac (CR) and Unix (LF), into clean Unix LF newlines.

Reviewed for accuracy by the Math Ora X team Last updated

About this tool

Standardize messy line endings, Windows (CRLF), old Mac (CR) and Unix (LF), into clean Unix LF newlines.

Example

Input: line1\r\nline2\rline3

Output: line1 line2 line3

How to use

Paste or type your text into the box above, then read or copy the result. Everything runs privately in your browser, your text is never uploaded to a server.

How to use this tool

  1. Paste or type your text into the input box.
  2. Check the source text if it has mixed Windows, old Mac, or Unix line endings.
  3. Run the normalize action to convert every line ending to Unix LF.
  4. Copy the cleaned text from the output area and use it in your file, editor, or script.

Step by step, what happens

  1. The tool reads the text as plain text and looks for line break sequences in the content.
  2. It replaces Windows CRLF and old Mac CR line endings with Unix LF line endings.
  3. Any mixed combination is standardized so every line break uses the same clean format.
  4. The output is shown immediately so you can copy the normalized text without editing line endings by hand.

Worked example

Here is a simple note copied from different systems with mixed line endings.

Input: First line Second lineThird line

  1. The tool sees one Windows-style line ending, one old Mac-style line ending, and one Unix-style line ending.
  2. It converts every line break to a single Unix LF newline so the text uses one consistent format.

Output: First line Second line Third line

Tips and common mistakes

  • Use this before committing text files to git, especially if line ending differences keep showing up in diffs.
  • If you paste text from email, old documents, or legacy systems, mixed line endings are common and this tool will clean them up.
  • If your app or editor expects Windows CRLF, do not use this tool for the final version unless you want Unix LF output.
  • This tool changes line endings only, not words, spacing inside lines, or character encoding.

Frequently asked questions

What are line endings?

Different systems mark line breaks differently: Windows uses CRLF, Unix uses LF, old Mac used CR.

What does this output?

It converts everything to Unix LF (\n), the most portable choice.

Why normalize them?

Mixed endings can break scripts, diffs and editors; normalizing avoids those issues.

Facebook Twitter WhatsApp