JSON Escape/Unescape

Escape or unescape JSON strings with quotes and special characters.

Escape text so it can sit inside a JSON string, or unescape a JSON string back to plain text. Quotes, backslashes, line breaks and control characters are handled the way JSON.stringify does. It is handy for embedding multi-line text, logs or code snippets in JSON payloads and for reading escaped strings from logs.

What is JSON string escaping?

JSON strings are wrapped in double quotes, so a few characters cannot appear as-is inside them. The double quote must be written as a backslash and a quote, a backslash must be doubled, and control characters such as newline and tab are written as backslash n and backslash t. Other control characters use a backslash u sequence with four hex digits. Characters like accented letters can be left as they are in UTF-8. Escaping lets arbitrary text be stored safely as a JSON value, and unescaping reverses it. Forgetting to escape is a common cause of JSON parse errors.

How to use JSON Escape/Unescape

  1. Paste your text Enter plain text, or an escaped string, in the Input box.
  2. Choose Escape or Unescape Click Escape to make it JSON-safe, or Unescape to restore the original.
  3. Review the output The result updates live as you edit.
  4. Copy it Use the copy button on the Output box.

Frequently asked questions

Does Escape add quotation marks around the result?

No. It returns only the escaped contents, so you can add the quotes yourself where you place it.

Which characters are escaped?

Double quotes, backslashes, and control characters such as newline, tab and carriage return. Other text is unchanged.

Can I unescape a whole JSON document?

No. The tool unescapes a single JSON string value. To work with objects, use a JSON formatter.

Why is a backslash doubled?

A single backslash begins an escape sequence in JSON, so a literal backslash must be written as two.

Are Unicode escapes decoded?

Yes. A backslash u followed by four hex digits is turned into that character when unescaping.