To convert \n to a real newline, choose escaped-to-actual mode and confirm that the preview displays the text on separate rows.
A literal \n sequence is two printable characters—a backslash followed by n—while an actual newline is a boundary that changes line layout. This distinction matters because pasted text can look similar in a source field while representing two different things. A quoted or logged value may contain visible \n markers, whereas text copied from a multiline document already contains real line boundaries.
The Line Break Converter makes the conversion explicit with three modes: actual line breaks to visible \n, visible escape sequences to actual LF newlines, and actual line breaks to spaces. It processes text in the browser, previews the exact result, and can download it as a UTF-8 TXT file.

The newline representation cheat sheet
Use the representation of the text—not the number of rows it occupies—to choose a mode. These are the three conversions supported by the tool.
| What the pasted text contains | How it appears | Best mode | Result |
|---|---|---|---|
| An actual line boundary | The cursor moves to a new row | Actual-to-escaped | One visible \n per boundary |
| Literal \n | A backslash and n on the same row | Escaped-to-actual | One LF newline |
| Literal \r\n | Four printable characters | Escaped-to-actual | One LF newline |
| Actual line boundaries | Multiple rows | Actual-to-space | One ordinary space per boundary |
The most important difference is between an actual newline and visible escape text. An actual newline directly controls line layout. A backslash followed by n remains two characters until the destination interprets that sequence in a relevant context. The converter preformats its preview, so real newlines appear as separate rows while escaped values remain visible on one row.
Existing visible backslash characters are otherwise left alone by actual-to-escaped mode. That behavior prevents the converter from confusing ordinary text such as a Windows-style path with a line-break sequence.
Choose the conversion direction
Each mode has a specific matching rule and output. Choosing the correct direction avoids turning an already visible marker into the wrong representation.
| Mode | Recognizes | Replaces it with | Important rule |
|---|---|---|---|
| Actual-to-escaped | Actual CRLF, lone CR, and lone LF boundaries | One visible \n | A CRLF pair is one boundary, so it does not produce \n\n |
| Escaped-to-actual | Literal \r\n, \n, and \r | One LF newline | The combined \r\n spelling is processed before the shorter sequences |
| Actual-to-space | Actual CRLF, CR, and LF boundaries | One ordinary space | Consecutive boundaries produce consecutive spaces; nothing is trimmed or collapsed |
For the direct task of turning visible \n into real line breaks, use escaped-to-actual. Actual-to-escaped is the reverse operation for real rows, while actual-to-space is intended to flatten actual line boundaries.
There is no direct escaped-to-space mode. To turn literal markers into spaces, first decode them into actual LF newlines, then place that output into a fresh actual-to-space conversion. This two-stage workflow still preserves one replacement per boundary instead of collapsing runs of whitespace.
Convert literal \n to real line breaks
Use this workflow when the copied source visibly contains backslash-n sequences.
- Copy the source without changing its escapes. The text should visibly contain a backslash followed by n. If the source already contains real rows, use actual-to-escaped or actual-to-space instead.
- Paste or type the text into the converter. Input is limited to 1,000,000 characters. Empty input produces a visible error rather than an empty download.
- Select escaped-to-actual mode. This is the mode that recognizes literal \n, \r\n, and \r sequences and replaces them with LF newlines.
- Run the conversion. The converter generates a separate result from the original input.
- Inspect the preformatted preview. Each recognized sequence should produce a new row, while the remaining text should retain its visible characters and spacing.
- Download the result when needed. The generated file is plain UTF-8 text without a byte-order mark, and its bytes match the string shown in the preview.
- Validate the result in its destination. If you edit the input or change the mode, the previous result is cleared and its download URL is revoked, so regenerate the file before using it.
Check exact whitespace before using the output
The preview uses preformatted whitespace deliberately. An actual newline creates a new row, while a literal \n remains visible as two characters. That makes it possible to confirm both the conversion and any spaces around the converted boundaries.
A long preview row may wrap across the screen because of the available display width. That visual wrapping does not insert newline bytes into the downloaded file. The file reflects the generated string, not the temporary folds used to display it.
The original input textarea is never overwritten. However, editing the input or selecting another mode clears the previous result, so an older downloaded file can represent an earlier configuration. Generate the final file only after the preview and mode are correct.
Match the result to its destination
Escaped-to-actual is useful when copied JSON-like strings, log output, configuration values, or other plain text contain visible markers that should become separate lines. In JavaScript, MDN’s escape-sequence reference identifies \n as the line-feed escape. This converter does not apply an entire language’s string rules, however, so users working with source code or serialized formats should validate quoting after conversion.
Actual-to-escaped serves the opposite need: placing multiline text into one visible line for documentation or controlled string preparation. The resulting \n markers remain text. They become line breaks only when the destination treats that sequence as a newline escape.
Actual-to-space mode is appropriate when the final text must be one line and retaining one separator for each original break is useful. It replaces each actual boundary but does not infer punctuation, collapse consecutive spaces created by blank lines, or remove unrelated whitespace.
Edge cases and format limits
- Line-ending normalization: An actual CRLF pair is treated as one boundary. Escaped-to-actual output uses LF for every created newline, so the original mix of CRLF, CR, and LF styles is not preserved.
- Backslash depth: The tool recognizes three literal sequences but does not interpret multiple preceding backslashes according to programming-language escape-depth rules. Inspect strings containing repeated backslashes before using the output.
- Unsupported cleanup: The converter does not convert tabs, remove all whitespace, trim the result, collapse blank lines in space mode, wrap text to a width, or add HTML br tags.
- Input bounds: Processing and rendering are limited to 1,000,000 characters. Empty input is rejected with a visible error.
- Privacy and output: Conversion, preview, and download creation run locally in the browser, so the pasted text is not uploaded. Generated downloads are UTF-8 TXT files without a byte-order mark.
Choose a separate cleanup only when needed
The Line Break Converter changes newline representations; it is not a general whitespace cleaner. To delete breaks entirely, use the Line Break Remover. For broader cleanup involving horizontal spacing, blank lines, or all whitespace, use the Whitespace Remover. Keeping those tasks separate prevents an expected newline conversion from also trimming, collapsing, or rewriting content you meant to preserve.
For a deeper look, see Line Break Remover Cheat Sheet: Choose the Right Mode.
For a deeper look, see Line Counter Bulk: Count Large Text Blocks Locally.