JSON Escape/Unescape
Escape and unescape JSON strings. Handle newlines (\n), tabs (\t), quotes (\"), backslashes (\\) and Unicode. Free online JSON string escaper.
Output will appear here...
What is JSON Escape/Unescape?
JSON string escaping converts special characters into their escape sequences so they can be safely embedded in JSON strings. For example, newlines become \n, tabs become \t, double quotes become \", and backslashes become \\. Unescaping does the reverse — converting escape sequences back into their actual characters.
How to Use
- Select Escape or Unescape mode using the buttons above the input
- In Escape mode: enter raw text with newlines, tabs, quotes — special chars become escape sequences
- In Unescape mode: enter text with escape sequences like \n, \t, \" — they become actual characters
- Use Swap to reverse the direction and work back and forth
Examples
Escape text with special characters
Unescape a JSON string
Related Tools
JSON Formatter & Minifier
Format, beautify, and minify JSON online. Free JSON formatter with syntax validation and error highlighting.
JSON Validator
Validate JSON syntax with detailed error reporting including line and column numbers. Free online JSON validator with instant feedback and structure analysis.
URL Encoder/Decoder
Encode or decode URL components instantly. Free online URL encoder and decoder for special characters.
HTML Entity Encoder/Decoder
Encode or decode HTML entities instantly. Free online HTML entity encoder for special characters.
Frequently Asked Questions
Which characters are escaped?
The following characters are escaped: newline (\n), carriage return (\r), tab (\t), backspace (\b), form feed (\f), double quote (\"), backslash (\\). Control characters (ASCII 0-31) are escaped as \u00XX.
What's the difference between this and URL encoding?
JSON escaping handles special characters within JSON string values (\n, \t, \"). URL encoding handles special characters in URLs (%20, %3A). They serve different purposes — use JSON escaping when embedding text in JSON, and URL encoding when constructing URLs.
Does it handle Unicode escapes?
Yes. The unescape function handles \uXXXX Unicode escape sequences (e.g., \u0041 becomes 'A'). The escape function converts control characters (ASCII 0-31) to \uXXXX format but leaves other Unicode characters as-is for readability.