JSON Escape / Unescape
Escape and unescape JSON strings - convert special characters to escape sequences
Input
Output
What is JSON Escape / Unescape?
Ever needed to drop a chunk of text into a JSON string, or read an escaped string out of a log? This tool does both. Escape mode turns your text into a JSON string literal: quotes become \", newlines \n, tabs \t, and the whole thing is wrapped in double quotes. Unescape mode turns it back into plain text.
Escape mode uses the same rules as JSON.stringify, which follows the RFC 8259 JSON specification and the ECMA-404 standard. Characters like é or 🔥 are valid in JSON as they are, so by default they stay readable; tick Escape non-ASCII as \uXXXX if the string has to survive an ASCII-only system. Unescape mode accepts a quoted JSON string, or escaped text without the outer quotes, like {\"sku\":\"SKU-101\"} copied from a log.
Everything happens in your browser – your data never leaves your computer. Escape or unescape strings instantly with one click.
How to Use JSON Escape / Unescape
Follow these steps to escape or unescape JSON strings. Each step uses the actual buttons and panels on this page.
Choose Escape or Unescape Mode
Use the Mode toggle above the editors. Escape turns text into a JSON string literal (quotes, newlines and tabs become \", \n, \t). Unescape turns it back. Example input for escape mode:
Plan: "Unlimited 5G"
Data: 45.2GB activeOutput becomes: "Plan: \"Unlimited 5G\"\nData: 45.2GB\tactive", quotes included, ready to paste as a JSON value per RFC 8259.
Paste, Upload, or Load Sample
Paste text into the left Input panel, or click Upload to load a .json or .txt file. Click Sample to see an example. Conversion happens automatically as you type, no button to click. Both panels are plain-text editors, so you see exactly the characters that will end up in your JSON.
Copy or Download
The right Output panel shows the result. Click Copy to copy to your clipboard, or Download to save as a file. Use Clear on the input panel to start over. All processing runs in your browser.
When You'd Actually Use This
API Development
Building a JSON request body by hand, with a customer note that contains quotes and line breaks? Escape the note here and paste it in as the value. For real user input in code, let your JSON library do the escaping; this is for one-off payloads, fixtures and curl commands.
Data Processing
Unescape JSON strings from API responses or database exports. Convert escaped strings back to readable text for display or further processing.
String Encoding
Prepare strings for JSON encoding. Escape special characters before using JSON.stringify() or when building JSON manually.
Debugging
Debug JSON parsing errors. Unescape strings to see what they actually contain, or escape strings to see how they'll appear in JSON.
Common Questions
Is my data stored?
No. Everything happens right in your browser. Your text never leaves your computer.
What characters get escaped?
Double quotes (\"), backslashes (\\), newlines (\n), tabs (\t), carriage returns (\r), and the other control characters below U+0020. Non-ASCII characters like é or emoji are left as-is unless you tick Escape non-ASCII as \uXXXX.
What's the difference between escape and unescape?
Escape converts special characters to escape sequences (like " becomes \"). Unescape converts escape sequences back to normal characters (like \" becomes ").
Does it work with JSON objects?
Escape mode treats whatever you paste as one plain string, so an object comes out as a quoted string with its quotes escaped, which is what you want when embedding JSON inside JSON. In Unescape mode, a valid JSON object or number is shown unchanged, since there's no string to unescape; escaped text like {\"a\":1} is unescaped to {"a":1}.
Can I escape Unicode characters?
Yes. Tick Escape non-ASCII as \uXXXX in escape mode and every character outside ASCII becomes a \uXXXX sequence; emoji become a surrogate pair like \ud83d\udd25. In unescape mode, \uXXXX sequences are always turned back into the characters they stand for.
What if I unescape invalid escape sequences?
Unknown escapes like \q are left as they are, and the rest of the text is still converted. A broken quoted string (say, one with an unescaped quote in the middle) is handled the same way: the backslash escapes are undone in place instead of failing.
Other JSON Tools You Might Need
Escaping is just one JSON task. Here are other tools that work well together: