Real Lines to Literal Newlines
换行转义\nJSON字符串文本处理
Convert real line breaks of multi-line text into literal \n escape sequences, accepting \r\n and \r input — ideal for building JSON strings and embedding text in code, fully local.
All processing is done locally in your browser. No data is uploaded.
How to Use
- Paste any valid JSON, supports nesting, arrays and escapes
- Click Beautify to auto indent and format
- Click Minify to remove whitespace into one line
- All operations run locally for privacy
Related Tools
FAQ
When do I need this tool?
When putting multi-line text into JSON values, database fields or single-line code strings, real breaks must become \n escapes or syntax breaks.
How is Windows \r\n handled?
It is unified to \n, consistent with JSON, JavaScript and other mainstream specs.
Will my data be uploaded?
No, all processing runs locally in your browser.