Developer Tools
JSON Parser, Repair & Escape
Turn almost-JSON into strictly valid JSON. Auto-fix trailing commas, single quotes, unquoted keys, comments and Python literals — then escape or unescape strings. Errors are reported by line and column. Everything runs in your browser.
When JSON.parse just says “Unexpected token”
Copy-pasted config, JavaScript object literals, logs and LLM output often look like JSON but fail to parse. This tool repairs the usual culprits automatically and tells you precisely where any remaining problem is, so you can fix it in seconds instead of eyeballing brackets.
What you can do
- Repair & format — fix and pretty-print in one step.
- Minify — collapse to the smallest valid payload.
- Escape — encode text as a JSON string literal for embedding.
- Unescape — recover the original from a stringified JSON value.
- Precise errors — line and column for anything that still fails.
Frequently asked questions
What does "repair" actually fix?
It handles the most common reasons JSON fails to parse: trailing commas, single quotes used instead of double quotes, unquoted object keys, // and /* */ comments, and Python-style literals (True, False, None). It then validates the result so you always get strictly valid JSON back.
What is the difference between escape and unescape?
Escape turns raw text into a JSON string literal — quotes, newlines and backslashes are encoded so it can be embedded inside another JSON document. Unescape does the reverse: it takes an escaped/stringified JSON string and gives you the readable original.
Is the repair guaranteed to be correct?
Repair is heuristic. It fixes well-known mistakes safely, but for deeply malformed input you should review the output. The validator shows the exact line and column if anything still cannot be parsed.
Does my JSON leave the browser?
No. All parsing, repair and escaping happen locally in JavaScript. Nothing is uploaded.