Line Ending Converter

Contact us
📂

Drop a file here, or click to browse

Any text file · Max 10 MB

What are line endings?

A line ending (also called a newline or end-of-line marker) is one or two invisible control characters that mark where a line of text ends in a file. Because different operating systems were designed independently, they settled on different conventions — which is why the same file can display garbled ^M characters or collapse into a single line when opened on the wrong platform.

The three formats

SequenceNameSystemNotes
\r\nCRLFWindows / MS-DOSCarriage Return + Line Feed. The default on Windows, MS-DOS, and most network protocols (HTTP headers, SMTP, FTP). Two bytes per line ending.
\nLFLinux / macOSLine Feed only. Standard on Unix, Linux, and macOS (since OS X 10.0). Mandated by POSIX. The default for most compilers, shell scripts, and modern source code.
\rCRClassic Mac OS (≤ 9)Carriage Return only. Used by Mac OS 9 and earlier. Rare today but found in legacy Apple files, some CSV exports, old BBEdit documents, and certain binary protocols.

Why does it matter?

Git diffs & merge conflicts
Mixed line endings generate false diffs — every line appears changed. Use .gitattributes with text=auto or eol=lf to enforce consistency. On Windows, set core.autocrlf=true.
Shell scripts on Linux
A Bash script saved with CRLF line endings fails immediately: bash reports "bad interpreter" or "\r: command not found" because the \r is treated as part of the command name.
Makefiles
make requires real tab characters and LF line endings. A Makefile with CRLF will produce confusing "missing separator" errors even when tabs look correct in an editor.
CSV and data interchange
RFC 4180 specifies CRLF for CSV. Many parsers are lenient, but some strictly require the specified format — especially when importing into Excel, databases, or ETL pipelines.
Python and compiled languages
Python's open() in text mode auto-translates on read, but binary mode does not. C and Rust compilers handle both, but source files in version control should stay consistent.
Docker & CI/CD
Entry-point scripts copied into a Linux container must use LF. CRLF line endings in a COPY or ADD instruction silently produce broken executables that fail at runtime.

How this tool works

All conversion happens locally in your browser — no file is uploaded to any server.

  1. Detection — counts all \r\n, standalone \n, and standalone \r sequences. The most frequent type is reported as the detected format.
  2. Conversion — normalises the source endings to \n first, then replaces with the chosen target sequence. This handles mixed files correctly.
  3. Download — the converted content is packaged as a text/plain Blob and downloaded directly. The filename gets a suffix (_lf, _crlf, or _cr) so you can tell converted files apart from the originals.

Quick reference

FormatEscapeHex bytesTypical file types
CRLF\r\n0D 0A.bat, .cmd, .ps1, Windows .txt, .ini, .csv (RFC 4180)
LF\n0A.sh, .py, .js, .ts, .go, .rs, Makefile, .gitattributes
CR\r0DLegacy .txt, old Mac .csv, pre-OSX HyperCard, classic BBEdit