Zero Signup ToolsFree browser tools

Developer Tools

Line Ending Converter

Convert line endings between LF, CRLF, and CR in your browser. Detect mixed endings, see counts, and download the converted file.

Convert to

Unix style

Unix, macOS, Linux, web servers, source code, JSON, YAML, most editors.

0 chars, 0 bytes

Converted output

0 chars, 0 bytes

Detection and counts

No line breaks

The input contains no line breaks. Pick a target if you want one consistent style anyway.

CRLF (\r\n)

0

LF (\n)

0

CR (\r)

0

Lines in input

1

Lines after conversion to LF

0

Input size

0 bytes

Output size

0 bytes

same as input

Quick reference

LF

\n

Unix, macOS, Linux, web servers, JSON, YAML, source code, modern editors. Recommended for git repositories.

CRLF

\r\n

Windows files saved by Notepad, .bat and .cmd scripts, HTTP and SMTP headers, RFC-style protocols.

CR

\r

Classic Mac OS before OS X. Rare today; convert to LF when found in modern files.

How to use

  1. Paste your text or the contents of a small file into the input area. Detection and counts update as you type.
  2. Read the detection badge: LF, CRLF, CR, or Mixed. The CRLF, LF, and CR counters break down exactly how many of each style the input contains.
  3. Pick a target: LF for Unix, macOS, Linux, and most editors; CRLF for Windows files and HTTP-style headers; CR for legacy classic Mac data; or Strip line breaks to flatten everything onto one line.
  4. Read the converted output on the right with character counts, UTF-8 byte counts, and a delta against the input.
  5. Use Copy output to copy the result, Download .txt to save it as a local file, or Replace input with output to chain another conversion.
  6. Click Load mixed sample if you want to see detection and conversion in action without typing escape sequences first.

About this tool

Line Ending Converter switches a block of text or a small file between the three historical newline conventions and reports exactly what the input contains so you can fix mixed endings with confidence. LF (\n) is the Unix, macOS, and Linux convention used by web servers, source code repositories, JSON, YAML, and almost every modern editor. CRLF (\r\n) is the Windows convention used by Notepad-saved files, .bat and .cmd scripts, and the line terminator required by RFC-style protocols like HTTP and SMTP. CR alone (\r) is the classic Mac OS convention from before OS X and is rare today, but still turns up in legacy text files exported from older systems. The tool counts each style independently so a single CRLF is reported as one CRLF, not as a CR plus an LF, and labels the input as LF only, CRLF, CR only, mixed, or no-breaks. A mixed-endings input is the common pain point: it produces noisy git diffs, breaks tools that split on a single style, and confuses parsers. Pick a target style and the tool normalizes any combination to that single convention; pick Strip line breaks to flatten everything onto one line, useful for pasting into a single-line input or generating a one-line JSON or CSV row. The output panel shows the converted text alongside character counts, accurate UTF-8 byte counts (so you can see CRLF cost an extra byte per line over LF), and the resulting line count after conversion. A Download button writes the result to a local .txt file with the right suffix, the standard Copy button copies to the clipboard, and a Replace input with output button feeds the result back into the input for chained conversions. A Load mixed sample button drops a four-line snippet that contains all three line endings so you can see detection and conversion at work without typing escape sequences. A reference grid summarizes which platforms and protocols use which convention, including notes for git autocrlf, RFC HTTP and SMTP headers, classic Mac OS, modern macOS, and Windows. Useful for fixing the noisy line-ending diffs that show up after editing a file across operating systems, normalizing copy-pasted text from Outlook or Notepad before pasting into a Linux server config, preparing a CSV for an old import tool that expects CRLF, joining a vertical list of values into a single comma-separated row, or simply confirming what your input actually contains. Everything runs locally in your browser. Files, snippets, and pasted text never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools