Line Ending Converter: Normalize LF, CRLF, and CR Line Endings Instantly
Learn how the free Line Ending Converter detects and normalizes LF, CRLF, and CR line endings entirely in your browser, with use cases and best practices.
Table of Contents
Some of the most frustrating problems in software development are caused by characters you cannot see. Line endings β the hidden sequences that mark the end of each line of text β are a prime example. Files created on Windows use a different end-of-line sequence than files created on Linux or macOS, and when those files mix, you get noisy diffs, broken scripts, and exports that refuse to parse correctly.
The Line Ending Converter is a free online tool that detects and normalizes those invisible characters. Paste your content, see whether it uses LF, CRLF, or CR β or a mix of all three β and convert it to the standard you need. Everything runs 100% client-side in your browser, so your text never leaves your machine.
Whether you are cleaning up a file before committing, preparing an export for a Windows application, or wondering why a script fails on one machine but works on another, this guide explains how line endings work and how to use the converter effectively.
Why Use the Line Ending Converter?
- Eliminate noisy diffs: When one editor writes CRLF and the team uses LF, every line shows up as changed. Normalizing before commit keeps reviews focused on real changes.
- Fix broken shell scripts: A Bash script saved with Windows line endings fails with cryptic "bad interpreter" errors on Linux. Converting to LF makes it runnable again.
- Make CSVs and exports behave: Spreadsheets, databases, and legacy Windows apps often expect CRLF. Converting to the right convention prevents mis-parsed rows.
- Detect mixed line endings: Files edited across multiple tools often end up with mixed endings. The detector flags MIXED and shows per-type counts so you know exactly what you are dealing with.
- Keep your data private: Processing happens entirely in your browser, so sensitive configs, logs, and customer data are never uploaded anywhere.
- No installation required: Nothing to install and no command to memorize β paste, convert, then copy or download.
Key Features
| Feature | What it does |
|---|---|
| Real-time detection | Identifies LF, CRLF, CR, MIXED, or NONE as you type or paste |
| Per-type counts | Shows CRLF count, LF count, CR count, total lines, and character count |
| Three conversion targets | Convert to LF (Unix/Linux/macOS), CRLF (Windows), or CR (classic Mac) |
| Copy to clipboard | One-click copy of the converted text with confirmation |
| Download as text | Save the converted result as a text file |
| Load example | Loads sample text with mixed CRLF and LF endings for quick testing |
A few details worth highlighting:
- The detection panel updates live, so you can verify a file's state before and after conversion without leaving the page.
- After converting to LF, the CRLF and CR counts should both read zero β an easy way to confirm the conversion was complete.
- The load example button lets you try the tool on a known-mixed file before trusting it with your own data, and the clear button resets everything for the next task.
How to Use
- Paste or type your text. Drop content into the input area, or click the load example button to try the tool with text that has mixed CRLF and LF endings.
- Check the detection results. The tool immediately reports LF, CRLF, CR, MIXED, or NONE, along with per-type counts, total lines, and character count.
- Choose your target line ending. Pick LF for Unix/Linux/macOS, CRLF for Windows, or CR for classic Mac systems.
- Review the converted output. The output updates instantly, so you can confirm the counts match your expectation before using the result.
- Copy or download the result. Copy to clipboard for pasting back into your editor, or download the converted file as text. Use clear to start over.
Understanding Line Endings: LF vs CRLF vs CR
Line endings date back to the teletype era, when moving the print head to the start of the line (carriage return) and advancing the paper one line (line feed) were separate mechanical actions. Different operating systems chose different ways to mark the end of a line in a text file:
- LF (\n, Line Feed) β the standard on Unix, Linux, and modern macOS, and the dominant convention in server-side and open-source software.
- CRLF (\r\n, Carriage Return + Line Feed) β the Windows standard, preserving both teletype actions; what Notepad and most Windows applications expect.
- CR (\r, Carriage Return) β used by classic Mac OS before OS X; rare today, but still found in legacy files and older data.
Because macOS switched to LF when it moved to Unix foundations, today's split is essentially Windows (CRLF) versus everything else (LF).
Mixed line endings happen when files travel: edited on Windows and committed from a Mac, copy-pasted between tools, or concatenated from machines with different conventions. Git's autocrlf setting can also rewrite endings at checkout and commit time, sometimes surprising developers who never configured it deliberately.
Wrong or mixed endings cause real damage. In Git, a wholesale ending change shows every line as modified, burying genuine edits in review. In CI, lint rules that enforce LF fail the build. In the shell, a CRLF-terminated script breaks because the interpreter reads the trailing \r as part of the command.
The converter fixes files that are already affected, while repository-level tooling prevents the problem. A .gitattributes file (for example, * text=auto eol=lf) tells Git which endings to enforce, and .editorconfig tells editors which ending to write. Normalize existing files with this tool, then lock the convention in at the repo level.
Practical Use Cases
Fixing Files Before Commit and Code Review
If a diff shows hundreds of changed lines but the content looks identical, line endings are the usual suspect. Paste the file into the converter, confirm MIXED or CRLF detection, convert to LF, and save β ideally in a commit separate from your real changes, so reviewers see a clean, minimal diff.
Preparing CSVs and Exports for Windows Apps
Many Windows-only tools β older accounting packages, ERP imports, and some spreadsheet workflows β expect CRLF-terminated rows. If your export was generated on Linux, convert it to CRLF before delivery and avoid mysterious "malformed file" errors on the receiving side.
Cleaning Data Before Ingestion
Data pipelines are picky about line endings. A loader configured for LF can treat a stray \r as data, leaving carriage returns at the end of fields. Normalizing logs, CSVs, and API dumps to a single ending before ingestion keeps parsers simple and output clean.
Cross-Team Collaboration Across Operating Systems
When part of your team works on Windows and part on macOS or Linux, shared scripts and config files bounce between conventions. Running them through the converter after receiving a file β and before sending one back β keeps everyone's tools happy without anyone installing anything.
Best Practices
- Standardize with .gitattributes. Declare text files and their expected endings once at the repo level so Git enforces them for every contributor.
- Add an .editorconfig. Set end_of_line = lf (or crlf where required) so every major editor writes the same ending by default.
- Normalize at the repo level. Convert existing files once in a dedicated commit, then let your tooling maintain the convention.
- Check line endings in CI. A simple lint step that rejects unexpected CRLF in shell scripts or source files catches regressions before review.
- Detect before you convert. Use the detection panel and per-type counts to confirm what is actually in the file β converting an already-correct file just adds churn.
- Commit normalization separately. Keep line-ending fixes in their own commit so future git blame and reviews stay readable.
Convert Your Line Endings Now
Invisible characters should not waste your time. Open the Line Ending Converter, paste your text, and get a clear verdict β LF, CRLF, CR, or mixed β in milliseconds. Convert to the standard your project needs, copy or download the result, and get back to work. Free, instant, and entirely private: your text is processed in your browser and never uploaded.
Related Tools You Might Like:
- Duplicate Line Remover β Remove duplicate lines from any text or list in one click.
- Whitespace Remover β Strip extra spaces, tabs, and blank lines from your content.
- Text Comparator β Compare two texts side by side and highlight the differences.
Happy converting!