JSON Escape / Unescape
Escape and unescape JSON strings - convert special characters to escape sequences
Input
Output
What is JSON Escape / Unescape?
Ever needed to escape special characters in a JSON string? Or unescape an escaped string back to normal? This tool does both. It converts special characters like quotes, newlines, and tabs into their escape sequences (like \", \n, \t) and back again. Perfect for preparing strings for JSON encoding or decoding escaped JSON strings.
According to MDN Web Docs, JSON strings need certain characters escaped. Our tool follows the RFC 8259 JSON specification and ECMA-404 standard, so escaped strings are valid JSON and unescaped strings are properly formatted. Great for handling user input, API responses, or any time you need to safely encode/decode strings.
Everything happens in your browser – your data never leaves your computer. Escape or unescape strings instantly with one click. Check out the ECMA-404 standard for more details.
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. Click Escape to convert special characters (quotes, newlines, tabs) to escape sequences like \", \n, \t. Click Unescape to convert them back. Example input for escape mode:
Plan: "Unlimited 5G"
Data: 45.2GB activeOutput becomes: Plan: \"Unlimited 5G\"\nData: 45.2GB\tactive – valid for JSON strings 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 show syntax highlighting.
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
Escape user input before sending it in JSON API requests. Ensures special characters don't break your JSON structure. Essential for handling user-generated content safely.
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?
Nope. Everything happens right in your browser. Your text never leaves your computer – we don't even see it. Check out the RFC 8259 for more details.
What characters get escaped?
Quotes ("), backslashes (\), newlines (\n), tabs (\t), carriage returns (\r), and other control characters. Unicode characters can also be escaped 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?
This tool works with strings. If you have a JSON object, you'd typically use JSON.stringify() which handles escaping automatically. This tool is for when you need to escape/unescape raw strings.
Can I escape Unicode characters?
Yes. Unicode characters are escaped as \uXXXX sequences. The tool handles all standard JSON escape sequences including Unicode.
What if I unescape invalid escape sequences?
JSON Invalid escape sequences are left as-is. The tool tries to handle common escape sequences, but malformed ones won't break the conversion.
Other JSON Tools You Might Need
Escaping is just one JSON task. Here are other tools that work well together: