JSON Escape / Unescape

Escape text into a JSON string or unescape a JSON string back to raw text.

Text is escaped and unescaped locally in your browser, and nothing is uploaded to a server.

Need to format a whole document? Try the JSON Formatter.

About JSON Escape / Unescape

JSON escape and unescape any text right in your browser: this tool turns raw text into a valid JSON string and decodes an escaped JSON string back to readable text. Escaping converts double quotes, backslashes, newlines, tabs and other control characters into their JSON sequences (\", \\, \n, \t) so a value can be safely embedded in a JSON document, config file or code literal. Unescaping a JSON string does the reverse, restoring multi-line text. It is built for developers assembling API payloads, dropping log lines into JSON, or reading an escaped value pulled out of a config. Toggle whether the escaped output is wrapped in surrounding quotes. Everything is processed locally in your browser, so the text you paste never leaves your device and nothing is uploaded to a server.

Features

How to use the JSON Escape / Unescape

  1. Choose Escape to encode text, or Unescape to decode a JSON string.
  2. Paste your text or escaped string into the input box.
  3. For Escape, toggle Wrap in quotes depending on whether you need the surrounding quotes.
  4. Read the converted result on the right.
  5. Click Copy or Download to reuse it.

Example

Input

She said "hi"

Output

"She said \"hi\""

Text escaped into a JSON string literal (Wrap in quotes on).

Common errors & troubleshooting

Frequently asked questions

What is a JSON escape tool?
A JSON escape tool converts characters that are special in JSON — double quotes, backslashes, newlines and tabs — into escape sequences such as backslash-quote and backslash-n, so the text becomes valid inside a JSON string. This tool also reverses the process to unescape a string.
How do I escape a string for JSON?
Pick Escape, paste your text, and the JSON-safe string appears instantly. Leave Wrap in quotes on for a complete quoted literal, or turn it off to get just the escaped inner content.
How is this different from the JSON Formatter?
The JSON Formatter beautifies or minifies a whole JSON document. This JSON Escape tool encodes or decodes a single string value so you can embed text in JSON or read an escaped value.
Can I unescape JSON content without the surrounding quotes?
Yes. The unescape mode accepts either a full quoted literal or just the escaped inner content and decodes both back to raw text.
Does the JSON Escape tool handle multi-line text?
Yes. Newlines are escaped to backslash-n when escaping and restored to real line breaks when unescaping, and literal line breaks pasted into the input are tolerated.
Is my text sent anywhere when I escape JSON?
No. Escaping and unescaping are processed entirely in your browser, so the text you paste never leaves your device and nothing is uploaded to a server.

Related tools

All ArrayKit tools