How to use JSON Escape / Unescape
- Paste the raw text (to escape) or a JSON string literal (to unescape).
- Click Escape or Unescape.
- 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"
ByeOutput:
"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.