Converters
String to JSON Converter
Paste an escaped JSON string — with all its backslashes — and get the real, formatted JSON back.
In short
Convert an escaped string to JSON online: unescape quotes and newlines, parse the content, and pretty-print real JSON. Handles double-escaped strings.
By NaveenKumar T · Updated
- Instant in-browser conversion
- Validates input first
- Handles bare and quoted input
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Example
String to JSON: input and output
A webhook payload as it appears when logged inside another JSON field: one quoted string literal with escaped quotes, a doubled backslash before a \u escape and a doubled backslash before an n.
"{\"event\":\"order.paid\",\"order\":{\"id\":\"ORD-88213\",\"total\":42.5},\"customer\":\"Ren\\u00e9e Dubois\",\"note\":\"Deliver after 5pm\\nRing bell\",\"tags\":[\"vip\",\"gift\"]}"{
"event": "order.paid",
"order": {
"id": "ORD-88213",
"total": 42.5
},
"customer": "Renée Dubois",
"note": "Deliver after 5pm\nRing bell",
"tags": [
"vip",
"gift"
]
}Removing one layer of escaping turned every \" back into a plain quote, the doubled backslash before u00e9 into the single \u00e9 escape that parses as é, and the doubled backslash before n into a real newline escape inside the note; the recovered document was then parsed and pretty-printed at two-space indentation, with total kept as the number 42.5.
Learn more
How String to JSON conversion works
The input is interpreted as a JSON string literal: surrounding quotes (added automatically if you pasted bare escaped content), \" unescaped to quotes, \n to newlines, \\ to single backslashes. The unescaped content is then parsed as JSON and pretty-printed at your chosen indentation.
If the unescaped content isn't JSON (just an escaped sentence, say), you get the clean unescaped text; if your input has no escaping at all — a bare number or [1,2] — it's simply formatted. Raw JSON that contains quotes is not an escaped string; use the JSON Formatter for that.
When to convert String to JSON
Every developer eventually stares at logged payloads full of \" and \n — JSON that was stringified into another JSON field, a database text column, or a single log line in CloudWatch, Datadog, or a terminal history. It shows up constantly at integration boundaries: a webhook provider that wraps its real payload as a string field inside an outer envelope, an error-tracking tool that stores the original request body as escaped text for replay, or a .env value that holds configuration as one quoted JSON line because the format doesn't support nested structures natively. Paste any of these here to recover the readable document in one step, without manually hunting down and replacing every backslash by hand. Double-escaped strings — stringified twice before they reached you, a common pattern in multi-hop webhook pipelines — need the conversion repeated once more; see the FAQ below for the exact steps.
Help
Frequently asked questions
Everything you need to know about the String to JSON.
01Does String to JSON recognise a plain, unescaped JSON document too?
If the input has no escaping to undo — a bare number, a raw [1,2], or already-valid JSON with no surrounding quotes — the converter simply parses and pretty-prints it rather than reporting an error. That makes this page a safe first stop for pasted text of uncertain provenance: escaped or not, valid content comes out formatted.
02My string is double-escaped (\\\" everywhere) — what do I do?
It was stringified twice. Convert once and the output is a single-escaped string; convert that output again (use the swap arrow to move it to the input) and the second pass yields the real JSON. Each conversion peels exactly one layer of escaping.
03Can I paste the escaped content without the surrounding quotes?
Pasting the escaped content without its surrounding quotes works too: if the trimmed input doesn't both start and end with a double quote, the converter wraps it in quotes, then applies standard JSON unescaping — \" becomes ", \\ becomes \, \n and \t become real line breaks and tabs, and \u00e9 becomes é. The result is parsed as JSON and pretty-printed at your chosen indent; if it isn't JSON — an escaped sentence, say — you get the plain unescaped text instead. Raw, unescaped JSON with quotes inside will fail here; use the JSON Formatter for that.
04Will re-escaping with JSON to String give back byte-identical text?
For the content, yes — parse then re-escape is a clean round trip because both steps use the engine's native JSON handling. What can differ is layout: JSON to String re-serializes at whatever indentation you pick before escaping, so if the original escaped string was built from differently-indented JSON, the new escaped text won't match character for character even though both decode to the same data.
Keep working
Related tools
JSON to String
Converters
JSON Stringify Online
The exact behavior of JavaScript's JSON.stringify() — compact by default, the space argument, and what the serializer silently drops — plus a mode that reverses it.
JSON Formatter
Format, beautify, and validate JSON instantly in a professional VS Code-style editor — free, fast, and 100% private.
JSON Parser
Run a real JSON parse in your browser — see exactly what your application will see, or exactly where it will fail.
JSON Escape
RFC 8259 string escaping both ways — make any text safe inside a JSON string, or decode the backslash soup back to text.
JSON5 Validator
Validate JSON5 with precise errors — and get the strict-JSON equivalent of your document in the same click.
Learn the format
Related guides
How to Fix Invalid JSON: Every Common Error, Decoded
Unexpected token? Unexpected end of input? Decode every common JSON parse error, find the exact broken line, and fix it — or auto-repair it in one click.
2 min readGuide · JSON“Unexpected end of JSON input”: What It Means and How to Fix It
The real causes of 'Unexpected end of JSON input': empty responses, truncated payloads, and unclosed brackets — with the steps that find each one.
2 min read