JSON Stringify Online
Escape text into a JSON string literal or decode a double-encoded JSON string back to readable text.
What is JSON Stringify?
This page serializes text. It converts every character in the input to a valid JSON string literal (surrounds it with double quotes, escapes quotes, backslashes, newlines, tabs, and other control characters). Unstringify does the opposite if the input is a valid JSON string literal.
This is useful when a protocol expects text in a JSON property but the text itself is JSON-like, logs, multiline queries or other quoted formats. This is not the same as parsing an object and then serializing that object.
Example
Input:
{"name": "Ada", "active": true}
Output after Stringify:
"{\"name\": \"Ada\", \"active\": true}"
The output above is a single JSON string value. If you insert it after a property name, the document remains valid:
{
"payload": "{\"name\": \"Ada\", \"active\": true}"
}
The payload property still contains text, not a nested object. Whether that is the correct design depends on the receiving API. Prefer a real nested object when you control the schema; double-encoded JSON adds another parsing step and makes validation harder.
Unstringify one layer at a time
If the input starts and ends with quotes and contains escape sequences, select Unstringify to retrieve the text contained within that JSON string. Only re-parse if the data you got back is a JSON document and the application contract expects that second layer.
For example, the first parse of "{\"ok\":true}" returns the text {"ok":true}. A second parse returns an object. Blindly parsing twice is risky because not every string is supposed to become executable structure.
FAQ
How do I undo stringify (decode a JSON string literal)?
Choose Unstringify, or call JSON.parse once on the string literal. The operation fails if the input is an object, array, number, boolean, null, or invalid JSON rather than a JSON string.
Does this convert a JSON object to text?
It treats the entire editor input as text and returns a string literal. If you want to serialize an in-memory object in JavaScript, call JSON.stringify(object) in your program. If you want to validate or format a JSON document, use the JSON Validator; if the document is malformed, start with JSON Fix.
Does unstringifying make embedded content safe?
No. It just strips off one layer of JSON escaping. Escape and validate the retrieved text for whatever context is going to consume it next.