Skip to content
Toolew.com

Line Ending Converter

Convert text between LF, CRLF and CR line endings, with automatic detection of the input’s current style.

Runs in your browser. Your data is not uploaded.
Loading tool…

Tool guide

What this tool does

Line Ending Converter detects and converts text between the three common line-ending conventions, LF (Unix/macOS/Linux), CRLF (Windows) and CR (classic Mac OS, legacy), a frequent source of unexpected diffs and cross-platform file issues.

Different operating systems historically settled on different characters to mark the end of a line, Unix/Linux/macOS use a single line feed (LF, \n), Windows uses a carriage return plus line feed (CRLF, \r\n), and classic, pre-OS X Mac used just a carriage return (CR, \r), a mismatch that still causes confusing diffs and subtly broken files when text crosses platforms.

This tool detects which line ending style your input currently uses and converts it cleanly to whichever target you need, LF, CRLF or CR, normalising any mixed line endings in the source first for a clean, consistent result.

How to use Line Ending Converter

  1. Paste text, or upload a text file.
  2. Check the detected line ending type shown.
  3. Choose your target: LF, CRLF or CR.
  4. Copy or download the converted result.

Tips for better results

  • LF is the standard for Unix, Linux, macOS and virtually all modern web/code contexts, including Git repositories by default on non-Windows systems.
  • CRLF is specifically what Windows text editors and the Windows line-ending convention expect; converting to LF-only text and opening it in some older Windows tools (like Notepad, historically) could display it without line breaks.
  • Mixed line endings within one file (some lines LF, others CRLF) are a common, messy result of editing a file across different operating systems; this converter normalises everything to one consistent style.
  • CR-only (classic Mac OS) is a legacy convention essentially never produced by modern software, but still occasionally encountered in old files.

Common use cases

  • Fixing a file with mixed or incorrect line endings before committing it to version control.
  • Converting a text file for compatibility with a specific operating system or legacy tool.
  • Standardising line endings across a codebase or document set.
  • Diagnosing why a file shows unexpected diffs or formatting issues after editing on a different OS.

Common mistakes to avoid

  • Not noticing a file has mixed line endings (some LF, some CRLF) until it causes a confusing diff or display issue; running it through this converter normalises everything consistently in one pass.
  • Assuming line endings don’t matter for plain text; some older tools and strict parsers are sensitive to the specific convention used, and version control diffs can look drastically noisier than necessary with inconsistent endings.
  • Converting to CR-only for a modern use case; this legacy classic-Mac-OS convention is essentially obsolete and rarely the right target outside specific legacy file compatibility needs.

Frequently asked questions

What’s the difference between LF, CRLF and CR?

LF (\n) is used by Unix, Linux and macOS; CRLF (\r\n) is the Windows standard; CR (\r) alone was used by classic, pre-OS X Mac systems and is essentially obsolete today.

Why do mixed line endings cause problems?

Version control systems can show every line as changed even when only line endings differ, and some strict parsers or legacy tools may not handle an unexpected convention correctly, normalising to one consistent style avoids both issues.

Which one should I use?

LF for virtually all modern cross-platform code and Git repositories; CRLF specifically if a Windows-only tool or workflow requires it; CR only for rare legacy compatibility needs.

Is my text sent anywhere?

No, detection and conversion both happen entirely in your browser using plain string operations; nothing is transmitted anywhere.

Feedback & suggestions

Help us improve Line Ending Converter. We read every message.

Rating (optional)
Necessary
Required for security, language and theme preferences. Always on.