About the JSON Escape Tool
A JSON string has strict rules: double quotes, backslashes and control characters such as line breaks and tabs must be written as escape sequences. Pasting a paragraph into a JSON file without escaping it breaks the file. This tool escapes the text for you, with the option to wrap it in double quotes or to turn non-ASCII characters into \u codes. It also goes the other way: paste an escaped JSON string and get back readable text with real line breaks and quotes. The work is done in your browser, and nothing is uploaded.
Updated October 2026
How to use the JSON Escape Tool
- 1Paste your text, or an escaped JSON string, into the left box.
- 2Choose Escape or Unescape.
- 3For escaping, tick wrap in double quotes if you want a complete JSON string.
- 4Tick the \u option if the target needs plain ASCII.
- 5Copy the result or download it.
Why escaping matters
JSON is picky. A single unescaped quote or a raw line break inside a string makes the whole document invalid, and many programs then refuse to load it. This is the most common reason that text copied from a document or an email breaks a JSON file or an API request.
Escaping the text first is quicker than hunting for the error afterwards. If you do end up with an invalid file, the JSON Validator on this site shows the line and column of the problem.
Escape table
The escapes JSON uses are few: a quote, a backslash, a line break, a carriage return, a tab, and a \u code for any other control character. Forward slashes may be escaped but do not have to be, and this tool leaves them alone.
- Quote becomes \"
- Backslash becomes \\
- Line break becomes \n
- Tab becomes \t
Using the result
Paste the escaped text between double quotes in your JSON file, or tick the wrap option and paste it as it is. When you unescape, remember that the result is plain text, ready to read or edit. For whole JSON documents, use the JSON Formatter to tidy them and the JSON Minifier to shrink them.
Unicode and emoji
Modern JSON parsers read UTF-8 directly, so special characters rarely need escaping. The \u option exists for older systems and for cases where the file has to stay in ASCII. Characters outside the basic plane, such as many emoji, are written as two \u codes called a surrogate pair, which is how JSON represents them.
Features
- Escape and unescape in one tool
- Handles quotes, backslashes, tabs and line breaks
- Optional wrapping in double quotes
- Optional \u codes for non-ASCII characters
- Shows the length before and after
- Private: nothing is uploaded
Frequently asked questions
How do I escape a string for JSON?
Paste the text and choose Escape. Double quotes become \", backslashes become \\, line breaks become \n and tabs become \t. Copy the result into your JSON between double quotes.
How do I unescape a JSON string?
Choose Unescape and paste the string, with or without its surrounding quotes. Sequences such as \n and \" are turned back into a real line break and a real quote.
What does the \u option do?
It writes every character above plain ASCII as a \u code with four hex digits, such as \u00e9 for the letter e with an acute accent. Use it if the system reading the JSON cannot handle special characters.
Do I need to escape single quotes in JSON?
No. JSON uses double quotes for strings, and a single quote has no special meaning inside them. The tool leaves single quotes as they are.
Why does my unescape fail?
The string is not valid JSON string content, for instance because of a stray backslash followed by an unknown letter or a broken \u sequence. The tool shows the error from the parser so you can find it.
Is my text uploaded?
No. Escaping and unescaping run in your browser, and your text stays on your device.