Normalize Line Endings
Standardize messy line endings, Windows (CRLF), old Mac (CR) and Unix (LF), into clean Unix LF newlines.
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
- Paste or type your text into the input box.
- Check the source text if it has mixed Windows, old Mac, or Unix line endings.
- Run the normalize action to convert every line ending to Unix LF.
- Copy the cleaned text from the output area and use it in your file, editor, or script.
Step by step, what happens
- The tool reads the text as plain text and looks for line break sequences in the content.
- It replaces Windows CRLF and old Mac CR line endings with Unix LF line endings.
- Any mixed combination is standardized so every line break uses the same clean format.
- 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
- The tool sees one Windows-style line ending, one old Mac-style line ending, and one Unix-style line ending.
- 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.
More Text Tools Tools
Explore related calculators in this category
Line Counter
Count the number of lines, non-empty lines and characters in any text instantly.
Remove Line Breaks
Remove all line breaks from text to make it one continuous paragraph.
Add Prefix / Suffix
Add a prefix and/or suffix to every line of your text instantly.
Add Text to Beginning, Free Online Text Tool
Add custom text to the beginning of every line in your text instantly. Get instant results, the formula, and a clear example.
You Might Also Like
Popular tools from other categories
Line Intersection Calculator
Find where two lines intersect.
Point to Line Distance Calculator
Calculate the perpendicular distance from a point to a line.
Refrigerant Line Charge Calculator
Estimate extra refrigerant for long line sets.
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.