Text

CRLF ↔ LF Converter

Convert line endings between Windows (CRLF), Unix/macOS (LF), and classic Mac (CR), with mixed-ending detection.

Convert to

The browser normalizes pasted text to LF itself, so original CRLF/CR cannot be detected here — to analyze or convert a file with real CRLF/CR, use the file upload above.


                    

Windows, Unix/macOS, and the old classic Mac historically use different characters to mark the end of a line — CRLF, LF, and CR respectively. Mixing these styles in one file often causes odd artifacts in diffs or editors. This tool converts line endings to one style and detects mixed ones.

How to use it

Common uses

Things to keep in mind

Git can automate this conversion itself through core.autocrlf or .gitattributes — often more convenient than converting files in a repository by hand.

Mixed line endings in one file aren't always visible at a glance, but they can break parsers or scripts that expect one specific style.

Article about this tool: CRLF vs LF: why line ending characters still matter

Frequently asked questions

Why do line endings differ by system?

Windows uses CRLF (\r\n), Unix and macOS use LF (\n) alone, and classic Mac used CR (\r) alone — these different historical conventions cause inconsistencies when a file moves between systems.

Why do I need to upload a file instead of pasting text?

The browser automatically normalizes any text pasted into an input field to LF, so real original CRLF or CR characters become undetectable once pasted — only a direct file upload preserves its actual line endings for analysis or conversion.

When does this kind of issue actually matter?

It matters most with git (noisy diffs caused by line endings), shell scripts that fail with leftover CRLF, and files exchanged between Windows and Unix/macOS systems; the uploaded file is only processed locally in the browser, never sent to a server.

What if a file has mixed CRLF and LF endings?

A file edited across multiple editors or operating systems can contain both styles at once. The conversion needs to be applied to the whole file, not just the visibly "suspicious" lines — otherwise some of the problem endings stay unnoticed.

Can this conversion be automated through git?

Yes, the core.autocrlf setting in git automatically converts line endings on checkout and commit, and .gitattributes lets you explicitly set the ending style for specific file types in a repository.

Articles: Text

Case Converter: why different naming styles exist

Why one project writes variables in camelCase but files in kebab-case, and where these rules came from.

Text Diff: how algorithms find the difference between two texts

How a diff algorithm finds the minimal set of changes between two versions of a text.

Regular expressions: basic syntax and common patterns

How to read a regular expression, and how greedy matching differs from lazy matching.

Sorting and deduplicating lines: why it matters

Why numeric sorting putting "10" before "9" is a mistake, and how to avoid it.

String Escape: why the same text needs escaping differently

Why the same quote character gets escaped differently in a JS string, JSON, and a shell command.

Counting characters and words: why it's not always trivial

Why an emoji or an accented character can count as several characters at once.

Lorem Ipsum: where the placeholder text came from and why it exists

Why designers deliberately use "nonsense" text instead of real content in mockups.

Slugify: turning arbitrary text into a URL

How a title like "Hello, World!" turns into a URL-safe string like hello-world.

Markdown: why plain-text syntax beat rich text editors

Why developers choose to write documentation in Markdown instead of a rich text editor.

Whitespace and invisible characters: the hidden cause of weird bugs

Why two strings that look identical can fail to match because of an invisible character.

Text Reverse: why "reversing text" is harder than it sounds

Why a naive string reversal can turn an emoji into unusable bytes.

Text frequency analysis: why count how often words repeat

How letter frequency in ciphertext helps crack the simplest substitution ciphers.