JSON String Escape / Unescape

Escape text into a JSON-safe string (quotes, backslashes, newlines) or unescape a JSON string back to raw text. Free and private, right in your browser.

Turn raw text into a properly escaped JSON string (or reverse it) so you can paste log lines, code snippets, or messy copy straight into a JSON payload, config file, or API request without breaking on quotes, backslashes, or newlines.

How to use it

  1. Paste your raw text or an existing JSON string
  2. Choose Escape (text to JSON string) or Unescape (JSON string to text)
  3. Copy the converted result

Frequently asked questions

What does escaping actually change?
It wraps your text in double quotes and backslash-escapes characters that break JSON strings: " becomes \", a backslash becomes \\, and real newlines/tabs become \n/\t. The result is safe to drop straight into a JSON document or an API payload.
Why does unescaping fail on my input?
Unescape expects a valid JSON string literal, including the surrounding quotes. A stray unescaped quote, a lone backslash, or a \u sequence with fewer than 4 hex digits will throw a parse error. Fix that character and re-run.
Does this handle Unicode and emoji?
Yes. Escaping can output \uXXXX sequences for non-ASCII characters (useful for strict ASCII-only JSON), and unescaping correctly decodes \uXXXX pairs back into the original characters, including surrogate pairs for emoji.
Is my text sent anywhere?
No. The escaping and unescaping happens entirely in your browser, so pasted API keys, log lines, or config values never leave your machine.