JSON Escape/Unescape
Wrap JSON as an escaped string for embedding inside another payload — or peel a stringified blob back to readable JSON.
Runs 100% client-sideOn this page4 sections
Output will appear here…HOW TO USE
- 01Escape — turns your input into a JSON-encoded string. Useful when a field expects JSON-as-string (e.g. a webhook payload or a database column).
- 02Unescape — strips outer quotes and decodes \", \n, \t, \\ back to readable text. If the inner value is JSON, it's pretty-printed.
WHEN TO USE
Use Escape when you need to embed a JSON object or multi-line string as a string value inside another JSON document — common in webhook payloads, database text columns, and environment variable values. Use Unescape when a log line or API response returns a stringified JSON blob surrounded by outer quotes and filled with backslash escapes that make it unreadable. Both directions save time over manually hunting escape sequences.
WHAT BUGS THIS FINDS
Double-escaping
A system that auto-escapes on write receives an already-escaped string, producing \\" — Unescape reveals the extra layer so you can track which component is escaping twice.
Unhandled newline sequences
A multi-line value stored as a JSON string uses \n literals; the consumer treats them as two backslash-n characters instead of a newline — Unescape shows what the consumer actually receives.
Broken special-character handling
Smart quotes and non-ASCII characters get mangled when a string is copy-pasted through systems that re-encode — Escape normalises to ASCII-safe \uXXXX sequences.
Nested JSON passed as plain text
A webhook body field contains a JSON string that the handler tries to parse directly — Unescape surfaces whether the value is valid JSON before writing the parsing code.
QA USE CASES
Webhook payload construction
Escape a nested JSON object so it can be embedded as a string value in an outer request body, then paste directly into a curl command or Postman body.
Log dump analysis
Copy a stringified JSON blob from a log line, Unescape it, and use JSON Formatter to read the actual structure without manually removing each backslash.
Environment variable encoding
Escape a multi-line JSON config so it fits in a single CI/CD environment variable value without breaking the shell or the parser reading it.