JSON Escape and Unescape
Convert text to and from JSON string literals, with correct quote, backslash, and newline escaping.
Direction
Converted live as you type. Everything runs in your browser. Nothing is uploaded.
Escape options
Output is a complete JSON string with surrounding double quotes. Non-ASCII characters are kept as-is.
How to escape and unescape a JSON string online
Choose a direction
Pick Escape to turn text into a JSON string, or Unescape to decode a JSON string back to raw text.
Paste your input
Type or paste your text or JSON string, and the result updates on every keystroke.
Adjust the escape options
In Escape mode, choose whether to keep the surrounding quotes and whether to limit the output to plain ASCII.
Copy the result
Use Copy to clipboard to take the converted string into your editor, config file, or request body.
Why use this tool
Escape and unescape in one place
Switch direction with a single tap. Escape prepares text for JSON, and unescape recovers the original characters from a JSON string.
Correct escaping of every special character
Double quotes, backslashes, newlines, tabs, carriage returns, and other control characters all become valid JSON escapes, so the output drops into a document without syntax errors.
Optional surrounding quotes
Keep the outer quotes for a complete JSON value, or drop them to get just the escaped content for a string you are already inside.
ASCII-only output
An optional toggle rewrites accented letters, symbols, and emoji as \uXXXX sequences when you need output limited to plain ASCII.
Clear errors on invalid input
If an unescape input is not a valid JSON string, a short message explains the problem instead of returning broken text.
Runs entirely in your browser
Everything happens on your device, and nothing is uploaded.
About this tool
This converter moves text between its raw form and its JSON string form in both directions. Escape mode wraps your text as a valid JSON string, converting double quotes, backslashes, newlines, tabs, and other control characters into their JSON escape sequences so the result can sit inside a config file, an API payload, or a source-code literal without breaking the surrounding syntax. Unescape mode reads a JSON string and gives back the original characters.
Two small options shape the escape output. The surrounding quotes can be kept, so you get a ready-to-paste JSON value, or dropped, so you get only the escaped inner content to place inside quotes you already have. A non-ASCII option rewrites accented letters, symbols, and emoji as \uXXXX sequences for output that stays plain ASCII. Unescape needs no options: paste a string with or without its outer quotes and it decodes in a single step.
Everything runs on your device, so tokens, keys, and other secrets inside the strings never leave the page. To pretty-print or validate a whole document rather than a single string, use the JSON formatter. To collapse one to a single line, use the JSON minifier. For \uXXXX work outside of JSON, see the Unicode escape tool.
Frequently asked questions
- What does JSON escaping do?
- It converts characters that have special meaning inside a JSON string, such as double quotes, backslashes, and newlines, into escape sequences like \" and \n. The escaped text can then sit inside a JSON string without breaking it.
- What is the surrounding-quotes option?
- When it is on, the output is a complete JSON string wrapped in double quotes, ready to paste as a value. When it is off, only the escaped content is returned, which is handy when you are pasting into quotes that already exist.
- What inputs does unescape accept?
- Paste a JSON string with or without its outer double quotes. Escapes like \n, \t, \uXXXX, and \" are decoded back to their characters. If the text is not a valid JSON string, a short message is shown instead of a broken result.
- Does it handle Unicode and emoji?
- Yes. Characters outside ASCII pass through unchanged by default. Turn on the ASCII option to rewrite them as \uXXXX sequences, and unescape converts \uXXXX back to the original character.
- Is my data uploaded anywhere?
- No. Everything runs in your browser. Your text is processed on your device and never sent to a server, stored, or logged.
Related tools
JSON Formatter & Validator
Pretty-print, minify, or explore JSON as a collapsible tree, with syntax errors shown inline.
JSON Minifier
Minify JSON to the smallest single line, with original vs minified byte size and the percentage saved.
Unicode Escape & Unescape
Convert text to and from \uXXXX escape sequences and HTML entities.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.