JSON Stringify Online
Escape text into a JSON string literal or decode a double-encoded JSON string back to readable text.
Related
Guides for Stringify
Repair LLM JSON Output: Handling Almost-JSON from AI
LLMs frequently return JSON wrapped in ```json fences, with single quotes, Python literals, or unquoted keys. Repair the syntax, validate strictly, then derive TypeScript types from the cleaned output.
Escape JSON as a String Literal (and Decode Double-Encoded JSON)
Stringifying JSON wraps it in quotes and escapes the inner quotes and special characters, producing a JSON string literal you can safely embed elsewhere.
Fix Single Quotes in JSON
JSON strings and object keys must use double quotes. Single-quoted values are common in JavaScript snippets, Python-like output, and LLM responses.
What is JSON Stringify?
JSON.stringify() converts a value into a JSON string. When applied to a string that already contains JSON, it produces a JSON string literal — the original JSON wrapped in double quotes with internal quotes and special characters escaped. This is commonly needed when embedding JSON inside another JSON document, storing JSON in a database field, or passing JSON as a URL parameter.
Other languages call the same operation by different names: Python's json.dumps (sometimes searched as json dumps python,* json dumps in python*, python json dump, python dict to json,* python pretty print dict*, python pretty print json,* python print nice json*, or via python pprint / pprint python), Ruby's JSON.generate, Go's json.Marshal, Java's org.json and Jackson, .NET's Newtonsoft JSON (Newtonsoft.Json), and PHP's json_encode all produce the same kind of output — turning a json object as string (also searched as** json to json string** or stringify json). Reversing it goes byJSON.parse, json.loads, and so on — covered on the JSON Validator and JSON Fix tools when the input might be malformed.
Example
Input:
{"name": "Ada", "active": true}
Output after Stringify:
"{\"name\": \"Ada\", \"active\": true}"
Click Unstringify to reverse the process — useful when you receive a double-encoded JSON string and need to extract the inner value.
FAQ
How do I undo stringify (decode a JSON string literal)?
Click Unstringify, or run JSON.parse on the value. If you receive a double-encoded string that starts with an escaped quote, parse it once to recover the inner JSON string, then parse again to get the actual value.
Is this the same as "json to string" / "json unescape"?
Yes. json to string means convert a JSON value to its string-literal form, which is exactly what Stringify does. json unescape /** unescape json** is the reverse — click Unstringify to remove the escape sequences and recover the original JSON.