JSON Escape / Unescape

Runs in browser JSON & Data

Turn arbitrary text (including quotes, newlines and unicode) into a valid JSON string literal, or reverse the process to recover the original text.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use JSON Escape / Unescape

  1. Paste the raw text (to escape) or a JSON string literal (to unescape).
  2. Click Escape or Unescape.
  3. Copy the output into your payload, fixture or code.

JSON Escape / Unescape features

  • Escapes quotes, backslashes, control characters and newlines for JSON strings
  • Optional \uXXXX escaping of non-ASCII characters for pure-ASCII output
  • Wrap the result in quotes or output only the string body
  • Unescapes JSON string literals back into plain text
  • Clear error when the literal is malformed

JSON Escape / Unescape example

Escape a message with quotes and a newline

Input:

He said "hi"
Bye

Output:

"He said \"hi\"\nBye"

Frequently asked questions about JSON Escape / Unescape

When do I need to escape text for JSON?

Whenever you embed arbitrary text — quotes, backslashes, newlines, tabs — inside a JSON string value, for example when building payloads by hand or writing test fixtures.

What does the "\uXXXX" option do?

It converts every non-ASCII character (Arabic, Chinese, emoji …) into a \u escape so the output is pure ASCII. This is optional: JSON allows UTF-8 directly.

Can I unescape a value that is not wrapped in quotes?

Yes. If the input has no surrounding quotes the tool adds them automatically before decoding.

Why does unescape fail on my input?

The text must be a single valid JSON string literal. Common causes are an unescaped double quote inside the value or an invalid escape such as \x.