JSON Escape & Unescape
Convert raw text into perfectly formatted, escaped JSON strings (protecting quotes and line breaks), or reverse messy escaped payloads back into readable text.
How to Use
- Paste your raw text or HTML block into the left Input panel.
- Click Escape to JSON. The tool will automatically add backslashes (
) before any double quotes, and convert all line breaks intonso the string will not break your JSON payload. - If you have received an API payload that is full of `rn` and `"`, paste it into the left panel and click Unescape to Text to read it normally.
- Check the Swap button to quickly move your output back to the input side for further editing.
Features
RFC Compliant
Strictly uses native JSON.stringify engines to guarantee 100% compliant parsing.
Line Break Handling
Perfectly transforms visual paragraph breaks into safe n and r characters.
Quote Protection
Automatically escapes dangerous internal quotes (") so your JSON won't crash.
Private Engine
Your API payloads and documents are processed locally. Zero server uploads.
Why do we need to Escape strings?
JSON (JavaScript Object Notation) uses double quotes (") to mark the beginning and end of a string. If the actual text you are trying to send also contains a double quote, the JSON parser will assume the string ended early, causing a massive syntax error that crashes your application.
To prevent this, developers "escape" the internal quotes by placing a backslash () in front of them (e.g., "). This tells the computer: "Treat this as a literal piece of text, not as a structural JSON command." The same logic applies to line breaks, which are converted into the literal text n.
The Web API Developer Suite
If you are building a complex REST API, use our JSON Minifier to compress your final payloads before transmission. If you need to inspect the authentication headers of those requests, try the JWT Decoder. You can also generate safe, universally unique identifiers for your database rows using our UUID Generator.
Frequently Asked Questions
Why did the Unescape function fail?
The Unescape function requires the input to be a perfectly valid string format. If you copied a partial string, or if there is a syntax error (like an un-escaped internal quote), the native JSON engine will reject it. Ensure you are pasting the entire string.
What does the 'Wrap in double quotes' checkbox do?
When this is checked, the escaped output will include the structural starting and ending quotes (e.g., "Hello "World""). If you only want the internal text, uncheck the box (e.g., Hello "World").
Are my payloads uploaded to your servers?
No. This tool utilizes your web browser's native JavaScript V8 engine to perform the stringifications. No data is transmitted across the internet.
Is it free?
Yes, 100% free with no limits.