String To JSON
Convert strings to JSON format easily
Input
Output
What Is String to JSON?
Sometimes JSON arrives as a string: escaped, double-encoded, or wrapped in quotes. A string like "{\"a\": 1}" is a JSON string whose value is JSON. To parse it, you need to parse twice: first the outer string, then the inner JSON. This tool does that. It also handles cases where the input is a plain string that should be parsed as JSON.
The tool uses JSON.parse() in your browser. If the input is a string containing JSON, it parses again. Nothing is sent to a server.
How to Use This Tool
Paste Your String
Paste the string you want to parse. It might be a plain JSON string, an escaped JSON string (e.g. from a log or API), or a double-encoded value. Use Sample or Upload if needed.
View Parsed Output
The right panel shows the parsed JSON. If the input was a string containing JSON, the tool parses it again. Invalid input shows an error. The output is formatted for readability.
Copy, Download, or Minify
Use Copy, Download, or Minify to get the result. For escaping or unescaping strings, use JSON Escape. For validation, use the JSON Validator.
String to JSON Examples
Parse escaped or stringified JSON. Telecom-themed example:
Input (JSON string)
Parsed output
When You Need This
JSON stored in a database as a text column often comes back as an escaped string. API responses that wrap JSON in another JSON string need double parsing. Logs that dump JSON as a string need the same. The JSON spec allows strings to contain escaped JSON; parsing that string gives you the inner structure. This tool automates the extra parse step.
When testing APIs in Postman or debugging responses in DevTools, you may get a stringified JSON value. The JSON.parse() documentation explains the parsing rules. The formal standard is RFC 8259. MDN's JSON guide covers common pitfalls.
If you need to escape or unescape characters in a string (e.g. quotes, backslashes), use JSON Escape. For formatting already-parsed JSON, use the JSON Formatter.
Frequently Asked Questions
What if my input is already valid JSON?
The tool will parse it and show the result. If it's a string containing JSON, it parses again. So {"a": 1} works, and "{\"a\": 1}" is parsed twice to get {"a": 1}.
How many levels of parsing does it do?
It keeps parsing as long as the result is a string. So "\"{\\\"a\\\": 1}\"" (triple-encoded) would be parsed until you get the object. There's usually a limit of 2–3 levels in practice.
Is my data sent anywhere?
No. Parsing runs in your browser.
What about invalid JSON in the string?
You'll get a parse error. Fix the syntax (trailing commas, unquoted keys, etc.) and try again. The JSON Validator can help identify issues.
When would I have double-encoded JSON?
When JSON is stored as a string in a database column, or when an API returns a JSON object where one of the values is a stringified JSON. Parsing the outer JSON gives you a string; parsing that string gives you the inner JSON.
Related Tools
For JSON parsing in JavaScript, see MDN JSON.parse and MDN JSON guide. The RFC 8259 spec defines JSON syntax. The JSON specification at json.org covers the grammar. For escaping strings, use JSON Escape.