Privacy Blog

Line Break Converter

Convert line endings between Windows (CRLF), Unix (LF), and Mac (CR) formats instantly. Standardise mixed line breaks with one click — perfect for fixing code, scripts, or configuration files. No signup, no uploads, all processing happens right in your browser.

Your converted text will appear here…

Why use this Line Break Converter?

Different operating systems use different invisible characters to mark the end of a line. This can cause scripts to fail, config files to be misread, and text to look garbled. Our tool instantly normalises all line endings to your chosen format, making your text compatible with any system.

  • Windows (CRLF): \r\n – standard for Windows text files.
  • Unix (LF): \n – used by Linux, macOS, and most modern systems.
  • Mac (CR): \r – old Mac OS style, rarely used today but still sometimes encountered.
  • Handles mixed endings: If your text contains a mix of \r\n, \r, and \n, the tool unifies them all to your selected format.

How to convert line breaks (step‑by‑step)

1. Paste your text

Drop the text with the line endings you want to change into the left box.

2. Choose target format

Select Windows (CRLF), Unix (LF), or Mac (CR) from the dropdown.

3. Click Convert

The output updates instantly with all line endings standardised to your chosen format.

4. Copy or download

Copy the converted text to your clipboard or save it as a file.

Example: converting CRLF to LF

Input (CRLF invisible but shown here as \r\n) Output (LF, \n)
Hello\r\nWorld\r\n Hello\nWorld\n

Common use cases

  • Cross‑platform file sharing: Convert Windows text files to LF before uploading to a Linux server.
  • Git pre‑commit hooks: Ensure consistent line endings in your repository.
  • Shell scripts: Fix ^M errors by converting CRLF to LF.
  • Legacy data: Read old Mac OS files that use CR line endings.

Pro tips

  • The tool silently handles mixed line endings — if your input contains a combination of \r\n, \r, and \n, it will replace all of them with your chosen format.
  • Need to see which line endings your text currently has? Use our Text Statistics tool — it can display a breakdown of line break characters.

Frequently asked questions

Related tools you might like

Whitespace Cleaner Text Statistics Text Sorter
Privacy Blog