JSON Escape / Unescape
Escape or unescape JSON string values online, or stringify text into a quoted JSON string. Handles quotes, backslashes, newlines and \uXXXX. Free and private.
Escapes special characters so the text is safe inside a JSON string (no surrounding quotes).
Result
Line 1\n\"Quoted\" & tab\there
What is the JSON Escape / Unescape?
The ByteTools JSON Escape tool prepares any text to live safely inside a JSON string and reverses the process when you need the original back.
- Escape text for use inside a JSON string value
- Unescape a JSON string back to raw text
- Stringify to wrap text in quotes as a full JSON value
- Correctly handles quotes, backslashes, newlines and tabs
- Powered by the browser's native JSON engine
- 100% client-side — text never leaves your browser
How to use the JSON Escape / Unescape
- 1
Pick a mode: Escape, Unescape or Stringify.
- 2
Paste your text or JSON string value into the input box.
- 3
Read the converted result below.
- 4
Copy the output into your JSON document or code.
About the JSON Escape / Unescape
The ByteTools JSON Escape tool prepares any text to live safely inside a JSON string and reverses the process when you need the original back. Escape mode encodes the special characters JSON forbids in strings, Unescape mode decodes them, and Stringify wraps your text in quotes to produce a complete, ready-to-paste JSON string value.
It relies on the browser's native JSON engine, so the output is exactly what a strict parser expects: double quotes, backslashes, tabs, newlines and control characters are all escaped correctly, and \uXXXX sequences are handled in both directions.
Processing is entirely local — your text never leaves the browser. It is perfect for hand-building JSON payloads, embedding multi-line text or code into a JSON field, or extracting the raw text from an escaped value.
Frequently asked questions
How do I escape a string for JSON?
Choose Escape mode and paste your text. The tool escapes the characters JSON does not allow inside a string — such as double quotes, backslashes and line breaks — giving you content you can place between quotes in a JSON document.
What is the difference between Escape and Stringify?
Escape produces just the inner content of a JSON string without the surrounding quotes, so you can drop it into an existing string. Stringify wraps the text in double quotes as well, producing a complete JSON string value ready to use on its own.
How do I get the original text out of a JSON string?
Use Unescape mode and paste the escaped value. The tool decodes sequences like \n, \t and \uXXXX back into their real characters, returning the original readable text.
Why does my JSON unescape fail?
Unescaping treats your input as the inside of a JSON string, so an invalid escape sequence or an unescaped quote will cause the parser to reject it. The tool reports the parser error so you can find and fix the offending character.
Do I need to escape forward slashes in JSON?
No. Forward slashes are legal in JSON strings and do not require escaping, though escaping them is allowed. This tool leaves them as-is when escaping so your output stays clean and readable.
Is my data uploaded when I use this tool?
No. All escaping, unescaping and stringifying runs in your browser using its built-in JSON engine, so your text is never sent anywhere.
Guides for JSON Escape / Unescape
Related tools
String Escape / Unescape
Escape or unescape strings for JavaScript and JSON literals: quotes, backslashes, newlines, tabs and \uXXXX. Two-way, free and fully private in your browser.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Validator
Free online JSON validator: validate JSON and find syntax errors with the exact line and column. See root type, key counts and depth — instant and 100% private.
Base64 Encoder
Encode text or files to Base64 instantly in your browser. UTF-8 safe, with a URL-safe Base64 option, copy and download. Free online Base64 encoder.