Paste malformed JSON and click Detect & Repair. The tool attempts to fix common issues — single-quoted strings, trailing commas, unquoted keys — and outputs clean, valid JSON. Useful when working with hand-edited configs, API responses that broke spec, or JavaScript object literals that aren't quite valid JSON.
Free, fast, runs in your browser. No login needed.
The repair engine works by evaluating your input as a JavaScript expression using new Function('return ' + input). This is why it can handle constructs that are valid JavaScript but not valid JSON:
{'key': 'value'} is valid JavaScript and gets repaired to standard double-quoted JSON.{key: "value"} is legal in JavaScript object literals.{"a": 1,} is accepted in modern JavaScript engines.What it cannot repair: Comments (// ... or /* ... */), truncated or incomplete JSON where a closing bracket is missing, very deeply malformed structure, or values that are not valid JavaScript (like bare identifiers that aren't object literals). For those cases, a manual edit is required.
On success, the repaired value is re-serialized through JSON.stringify(result, null, 2), producing properly formatted, valid JSON. The round-trip means undefined values are dropped and NaN/Infinity become null.
Common use case: config files hand-edited by non-developers who used single quotes; JavaScript object literals copied from source code; API responses from non-spec-compliant servers that include trailing commas.
Single-quoted strings, unquoted keys, trailing commas after the last item, and any other construct that is valid JavaScript but not valid JSON. The tool evaluates the input as a JavaScript expression and re-serializes it.
The repair relies on JavaScript evaluation. If the input is not valid JavaScript either — for example, it is truncated (missing closing brackets), contains comments, or includes bare identifiers — the evaluation throws and repair fails. You will see "Could not repair automatically." in that case.
The repair runs entirely in your browser's JavaScript sandbox. It cannot access your files, network, or other browser tabs. However, evaluating arbitrary input as code means you should only use this tool with input you trust — not with untrusted third-party payloads.
The values are preserved, but the output is re-serialized. Undefined values are dropped, NaN and Infinity become null (standard JSON.stringify behavior). Key order from the original input is maintained.
Use the JSON Validator. It reports exactly where in the input the syntax error is without modifying your data.
No. Repair runs entirely in your browser.