Newline Escape Converter
Convert between real line breaks and escaped newline sequences. Toggle between Escape and Unescape modes. Perfect for JSON strings. Free.
Convert real newlines → \n sequences
How to Use
- 1 In 'Escape' mode, paste text with real newlines and click Convert to replace them with \n escape sequences.
- 2 In 'Unescape' mode, paste text containing \n sequences and click Convert to restore real line breaks.
- 3 Copy the result to use in JSON strings, config values, or wherever escaped newlines are needed.
Use Cases
Escape multi-line text before embedding it as a value in JSON, where literal newlines are invalid.
Unescape log entries or error messages stored as single-line strings to readable multi-line format.
Quickly convert between escaped and real newlines when building or inspecting API request bodies.
FAQ
The Escape mode converts real LF (\n) to \\n and CRLF (\r\n) to \\r\\n. The Unescape mode reverses both conversions.
JSON specification does not allow literal newlines inside string values. Multi-line text must use \n escape sequences instead of actual line breaks.
Yes. Both LF (Unix) and CRLF (Windows) newlines are handled in Escape mode. Unescape converts both \\n and \\r\\n back to real newlines.
Related Tools
A/B Test Calculator
Check if your A/B test results are statistically significant. Calculates p-value, Z-score, uplift, and statistical power. Free.
Open →A/B Test Sample Size Calculator
Calculate the sample size needed per variation for a statistically valid A/B test. Set confidence level, power, baseline rate and MDE. Free.
Open →ACOS Calculator
Calculate your Amazon ACOS, ROAS, and break-even ACOS instantly. Free tool for Amazon sellers to measure ad efficiency and profitability.
Open →