JSON Escape / Unescape

What is JSON string escaping?

JSON strings live between double quotes and follow strict rules: a literal " becomes \", a backslash becomes \\, and control characters like newlines and tabs become \n and \t. Pasting raw text into a JSON payload without escaping breaks the document — this tool applies and reverses exactly those rules (the same ones JSON.stringify uses).

Features

  • Escape — Runs the equivalent of JSON.stringify on your raw text. The surrounding quotes are excluded by default, so the output drops straight into an existing string; enable Include surrounding quotes if you want the complete JSON string literal.
  • Unescape — Reverses the process with JSON.parse. Paste with or without surrounding quotes — raw pastes are auto-wrapped, so hello\nworld works as-is.
  • Honest errors — Input that is valid JSON but not a string (123, true, [1]) gets a clear explanation, and malformed strings (like a literal line break inside the quotes) get an error that points at the actual cause.
  • Unicode-safe — Emoji and lone surrogates pass through without crashing, exactly like JSON.stringify handles them.

How to use

1. Pick Escape or Unescape

2. Paste your text — in escape mode, tick Include surrounding quotes if you need them

3. Copy the result with one click

Privacy

All escaping and unescaping happens locally in your browser. Nothing you paste is ever sent to a server.

Read the full JSON Escape / Unescape guide and the JSON Escape / Unescape API reference.