JSON Stringify / Escape
Escape text into a JSON string literal, or unescape it back — with an optional \uXXXX-only mode.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Escapes quotes, backslashes, newlines and control characters correctly, with surrounding quotes.
- Optional \uXXXX-escaping for non-ASCII characters (accents, emoji, non-Latin scripts), for parsers or pipelines that expect ASCII-only JSON.
- Unescape direction turns a string literal back into readable text.
- Runs in your browser.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Converts raw text into a properly escaped JSON string literal (escaping quotes, backslashes and newlines), or decodes one back to plain text. An optional mode escapes non-ASCII characters to \uXXXX too, for maximum compatibility with stricter parsers.
How to use it
- 1Choose Escape or Unescape.
- 2Paste your text.
- 3In Escape mode, check "Escape non-ASCII characters" if you need \uXXXX output instead of literal Unicode.
- 4Copy the result.
Examples
Escape
Input
Line one Line "two"
Output
"Line one\nLine \"two\""
Frequently asked questions
What people use it for
Embed a multi-line string in JSONTurn a code snippet or template into a single valid JSON string value.
Put HTML or a query in a config fileEscape a value with quotes and newlines so the JSON stays valid.
Read an over-escaped log fieldUnescape a string literal from a log line back into plain text.
Build a JSON payload by handEscape each string value before assembling the object.
Produce ASCII-only JSON for a strict older parserCheck the \uXXXX option so accented letters, emoji and non-Latin text come out as escape sequences instead of raw UTF-8 bytes.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsJSON Viewer & FormatterView, format, validate, edit and beautify JSON with an interactive tree view, plus a shareable link.URL EncoderPercent-encode text for safe use in URLs, with a component vs. full-URL mode.JSON ValidatorValidate JSON syntax and pinpoint errors instantly.JSON MinifierStrip whitespace to compress JSON to its smallest size.
Ready to use JSON Stringify / Escape?
JSON Stringify / Escape