Free JSON escape & unescape tool — quotes, backslashes and control characters, RFC 8259

Escaping runs entirely in your browser — nothing is uploaded.

🔧 JSON Escape / Unescape — Free Online Tool

Escape and unescape JSON strings online, free. JSON string escaping makes raw text safe to place between the double quotes of a JSON value: the double quote, backslash, and control characters are replaced with backslash sequences per RFC 8259. This tool escapes text into a valid JSON string body — or unescapes one back to plain text — using the browser's native JSON engine, entirely on your device.

🚀 Why use this JSON Escape / Unescape tool?

Escaping and unescaping use JavaScript's native JSON engine and follow RFC 8259 exactly, so \n, \t and \uXXXX control characters round-trip correctly. 100% free, no registration, and complete privacy — everything runs locally in your browser, so your data never touches a server.

Key Features

🔁Escape & unescape

Convert raw text into a JSON-safe string and back, with one click in either direction.

📑RFC 8259 compliant

Escapes the double quote, backslash and U+0000–U+001F control characters, using \n, \t, \r and \uXXXX forms.

Instant & in-browser

Runs on the browser's native JSON engine — no upload, no wait.

🔒100% private

Your text is processed locally and never sent anywhere — safe for tokens and secrets.

Popular Use Cases

Building JSON by hand

  • Embed text in a JSON value
  • Escape quotes in config strings
  • Paste safely into payloads

Debugging

  • Unescape a value from a JSON doc
  • Read \uXXXX sequences
  • Fix broken JSON strings

Dev workflows

  • Prepare test fixtures
  • Encode log messages
  • Hand-edit API requests

What It Handles

Modes

  • Escape (text → JSON string)
  • Unescape (JSON string → text)

Handles

  • Quotes & backslashes
  • Newlines / tabs
  • \uXXXX control chars

Privacy

  • Native JSON engine
  • No network calls
  • Runs offline

Sources & References

Frequently Asked Questions

How do I escape a double quote inside a JSON string?

Prefix it with a backslash: a literal " becomes \". JSON strings are delimited by double quotes, so any double quote inside the value must be escaped as \" or the parser will end the string early. This tool does it for you — paste the text and click Escape.

Which characters must be escaped in JSON?

Per RFC 8259, JSON requires escaping the double quote (\"), backslash (\\), and the control characters U+0000–U+001F. Common ones have short forms: \n (newline), \r (carriage return), \t (tab), \b (backspace), \f (form feed). Any other control character is escaped as a \uXXXX hex sequence.

What is the difference between JSON escape and unescape?

Escaping converts raw text into a form that is safe to place between the quotes of a JSON string (e.g. a newline becomes \n). Unescaping reverses it — turning \n back into an actual newline. Use Escape when building JSON by hand; use Unescape to read a value copied out of a JSON document.

Does the JSON escaper send my data anywhere?

No. All escaping and unescaping runs locally in your browser using JavaScript's native JSON engine — nothing is uploaded, logged, or stored. It is safe for API keys, tokens, and other sensitive strings.

Why does my unescape fail with 'unexpected token'?

Unescape expects a valid JSON string body — for example \u0041 or \n. If the input contains a lone backslash or an incomplete \u sequence it is not valid JSON and will fail. Re-check that every backslash starts a legal escape sequence.

🎓 Pro Tips

  • Tip 1: Escape the backslash first in your head — it must be doubled (\\) before other escapes, or it will corrupt the following sequence.
  • Tip 2: For values destined for a .json file, use JSON Escape; for code you paste into a .js file, use JavaScript Escape — the rules differ.
  • Tip 3: Round-trip to verify: escape, then unescape, and confirm you get the original text back.