Embedding strings inside JSON or building JSON manually requires escaping special characters—quotes, newlines, tabs, backslashes. The JSON Escape/Unescape tool escapes text for JSON strings and unescapes JSON string values back to raw text so you can embed strings safely or recover readable text from escaped output.
When should I use JSON escape?
Use escape when you need to embed a string inside JSON or when building JSON manually. Special characters like quotes and newlines must be escaped. The tool escapes backslash (), double quote ("), and control characters (e.g. newline \n, tab \t, carriage return \r) according to the JSON spec. All escaping and unescaping is done in your browser; no data is sent to any server. Paste a string to escape for JSON or paste an escaped string to unescape; output is ready to paste into JSON or code. Use unescape when you have a JSON string value (with \n, ", etc.) and want to see or use the raw text. If unescape breaks your string, only valid JSON escape sequences are unescaped—ensure the input is a single JSON string value (quoted); invalid backslash sequences may be left as-is or cause errors.
Key Features
- Escape — Use when embedding a string in JSON or building JSON manually. Special characters must be escaped.
- Characters escaped — Backslash (\), double quote ("), and control characters like newline (\n), tab (\t), and carriage return (\r) per JSON spec.
- Privacy — All escaping and unescaping is done in your browser. No data is sent to any server.
- Input — Paste a string to escape for JSON or paste an escaped string to unescape. Output ready for JSON or code.
- Unescape — Use when you have a JSON string value and want raw text.
- Unescape issues — Only valid JSON escape sequences are unescaped. Input should be a single JSON string value (quoted); invalid backslash sequences may cause errors or be left as-is.
How to Use JSON Escape/Unescape
- Open the JSON Escape/Unescape tool.
- To escape: paste raw text, escape, copy result. To unescape: paste escaped JSON string value, unescape, copy result.
- Use the "Use tool" button on the docs page if you are reading this from the documentation.
Real Use Cases
- Embed strings in JSON — Escape user input or config strings before inserting into JSON. Use with JSON Formatter and JSON Minify to build or compact JSON.
- Build JSON manually — Escape values so quotes and newlines do not break structure. Use with JSON Formatter to validate.
- Recover raw text — Unescape a JSON string value (e.g. from API or log) to see readable text. Use with Base64 Encoder if value is also base64.
- Documentation — Show team which characters are escaped. Use output as reference.
- Debugging — Unescape to see what was actually stored or sent. Use with JSON Formatter.
- Code generation — Escape strings for code (e.g. embedding in JavaScript). Output ready to paste.
Why Use JSON Escape/Unescape Instead of Alternatives?
- vs. JSON Formatter — JSON Formatter formats/validates full JSON. This tool escapes/unescapes string values only. Use formatter for full document; use this for single strings.
- vs. JSON Minify — JSON Minify minifies JSON. This tool escapes/unescapes. Use both when building minified JSON with special characters.
- vs. Base64 Encoder — Base64 Encoder encodes binary/text. This tool is for JSON string escaping. Use the right tool for the task.
- vs. Manual — No need to remember which characters to escape. Paste, escape or unescape, copy.
Benefits for Developers
- Developers — Safely embed strings in JSON. Recover raw text from escaped values. One place for escape/unescape.
Common Mistakes
- Unescape broke my string — Only valid JSON escape sequences are unescaped. Ensure the input is a single JSON string value (quoted). Invalid backslash sequences may be left as-is or cause errors.
- Expecting full JSON parse — This tool escapes/unescapes strings. For full JSON use JSON Formatter.
- Wrong direction — Escape = raw → JSON-safe. Unescape = JSON string value → raw. Choose the right mode.
- Forgetting to copy — Copy the result before closing the tab.
Frequently Asked Questions
When should I use JSON escape?
Use escape when you need to embed a string inside JSON or when building JSON manually. Special characters like quotes and newlines must be escaped.
What characters are escaped?
Backslash (\), double quote ("), and control characters like newline (\n), tab (\t), and carriage return (\r) are escaped according to JSON spec.
Is my data processed securely?
Yes. All escaping and unescaping is done in your browser. No data is sent to any server.
Paste a string to escape for JSON or paste an escaped string to unescape. Output is ready to paste into JSON or code.
When should I use JSON unescape?
Use unescape when you have a JSON string value (with \n, \", etc.) and want to see or use the raw text.
Why did unescape break my string?
Only valid JSON escape sequences are unescaped. Ensure the input is a single JSON string value (quoted); invalid backslash sequences may be left as-is or cause errors.
JSON Escape/Unescape gives you escape and unescape in one place: paste string, get JSON-safe or raw text. No server, no account. For full JSON use JSON Formatter and JSON Minify, for encoding use Base64 Encoder.
Use the JSON Escape/Unescape tool to escape and unescape JSON strings.