What is JSON?
JSON (JavaScript Object Notation) is a text format for structured data built from objects, arrays, strings, numbers, booleans and null. It is defined by RFC 8259 and ECMA-404, is language-independent, and is the default format of web APIs because it is compact, human-readable and easy to parse.
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.
References
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange FormatThe JSON grammar: objects, arrays, strings, numbers, the three literals, and UTF-8 as the interchange encoding.
- ECMA-404: The JSON Data Interchange SyntaxThe JSON syntax as an Ecma standard, kept in step with RFC 8259.
- Introducing JSONThe original one-page description of JSON with its railroad diagrams.