Newline Converter

Convert escape sequences like \n and \r\n to actual line breaks, or convert real line breaks back to escape sequences. Perfect for working with JSON strings, code, or converting between line ending formats.

1
0 characters 0 words 0 lines

Escape Sequences

Line Endings

HTML

About Newline Conversion

Different systems use different characters to represent line breaks. This tool helps you convert between these formats and handle escape sequences commonly found in programming and data files.

Line Ending Types

  • Unix/Linux/macOS: Uses LF (\n) - Line Feed character
  • Windows: Uses CRLF (\r\n) - Carriage Return + Line Feed
  • Old Mac (pre-OS X): Uses CR (\r) - Carriage Return only
  • HTML: Uses <br> tags for line breaks in web content

Frequently Asked Questions

How do I convert \n to a new line?
Paste the text into the editor, then click \n → Breaks under Escape Sequences. Every \n is replaced with a real line break. Click Copy to grab the result.
How do I turn \n into a linebreak in a string?
Same flow — paste, click \n → Breaks. The conversion runs in your browser. Nothing is uploaded.
How do I convert real line breaks back to \n?
Click Breaks → \n. Every actual line break is replaced with the two-character \n sequence — useful for embedding text in JSON or single-line config values.
What is the difference between LF, CRLF and CR?
LF (\n) is Unix/Linux/macOS. CRLF (\r\n) is Windows. CR (\r) alone is old Mac. Use the Line Endings buttons to switch between them.
How do I display \r\n escapes as real line breaks?
Click \r\n → Breaks. The converter handles \r\n, \r and \n simultaneously and replaces them all with real line breaks.

Related Tools