DevOps Live Data stays in your browser

Line Break Converter

Detect and convert line endings between LF (Unix/macOS), CRLF (Windows), and CR (legacy Mac). Shows a line-count breakdown — all processed in your browser.

No input

Disclaimer: Free tool provided “as is” by MonitorGiant. No warranty or liability for any data loss, security issues, or infrastructure problems arising from use of this tool. Results are for informational purposes only. · A Free Tool by MonitorGiant

How Line Break Converter works

The Line Break Converter detects the mix of line ending styles in your pasted text and lets you normalise them all to a single format — LF, CRLF, or CR — entirely in your browser.

  1. 1

    Paste your file content

    Paste any plain text — source code, config files, log files, CSV data. The tool reads the raw characters and scans for \r\n (CRLF), \n (LF-only), and \r (CR-only) sequences.

  2. 2

    Line ending style is auto-detected

    The detection badge updates in real time: LF (Unix/macOS), CRLF (Windows), CR (legacy Mac 9), or Mixed if your file contains more than one style — which is the most common cause of cross-platform issues.

  3. 3

    Choose your target format

    Click "Convert to LF" for Unix/Linux/macOS files, "Convert to CRLF" for Windows-compatible files, or "Convert to CR" for legacy compatibility. The conversion runs instantly.

  4. 4

    Copy or download the result

    Use the Copy button to paste directly into your editor, or Download to save the file with its new line endings preserved — the download preserves the exact bytes.

Your text is processed entirely in the browser using JavaScript string operations. No data is sent to MonitorGiant or any third party. Files are downloaded using a local Blob URL — no upload required.

Frequently asked questions — Line Break Converter

What is the difference between LF, CRLF, and CR line endings?

Line endings are invisible characters that tell text editors and programs where one line ends and the next begins. LF (\n, Line Feed, Unix/macOS) is a single character used by Linux, macOS, and most Unix-based systems. CRLF (\r\n, Carriage Return + Line Feed) is two characters used by Windows and the Internet standard for email and HTTP headers. CR (\r, Carriage Return alone) was used by classic Mac OS (pre-OS X) and some legacy systems. Most modern cross-platform issues involve LF vs CRLF.

Why does my text look wrong or display strange characters on a different OS?

When software expects one line ending format but receives another, it can display unexpected characters or run lines together. A common symptom is seeing ^M at the end of every line in a Unix terminal — this is the \r from a CRLF file being displayed as a literal character. Conversely, a Windows text editor like Notepad (older versions) may show a file with LF endings as one long line with no breaks.

How do I convert CRLF to LF for Git on Windows?

Git on Windows has a core.autocrlf setting that can automatically convert line endings on checkout and commit. Set it to input (git config --global core.autocrlf input) to convert CRLF to LF on commit but keep files as-is on checkout. Alternatively, use a .gitattributes file with * text=auto eol=lf to enforce LF across the repository for all contributors. This tool is useful for one-off conversions or files outside version control.

Which line ending should I use for shell scripts, Python, and JavaScript files?

Shell scripts (.sh, .bash) must use LF — CRLF causes "bad interpreter" errors when executed on Linux/macOS. Python and JavaScript files work with either format on most systems, but LF is the convention in open-source projects and is required if the files will run on Linux servers. The general best practice for any code that will run on or be shared with Unix systems is to use LF.

Does this tool change the actual file bytes or just what I see?

The conversion operates on the actual byte values in the text. CRLF lines contain a \r byte followed by a \n byte; converting to LF removes the \r byte. The Download button creates a file with the exact converted bytes — if you copy/paste into an editor instead, the editor may re-impose its own line endings. For reliable byte-level conversion, use the Download button.

Comments & Feedback

Found a bug? Have a suggestion? We'd love to hear from you.

0 / 2000

Related Tools

From the makers of this tool

Need deeper observability?

MonitorGiant tracks real-time AI performance, infrastructure health, and system reliability — far beyond what free utilities can show.

Explore MonitorGiant