JSON Repair
Paste almost-JSON: trailing commas, single quotes, unquoted keys, comments, or undefined. The tool produces strict JSON you can parse anywhere.
JSON Repair Online
Paste JSON-like text from logs, browser devtools, legacy configs, or copy-pasted API responses. The repair pass applies safe heuristics (comments, trailing commas, single quotes, unquoted keys, undefined → null) and then validates so you get strict JSON you can pipe into any toolchain.
Where Is This Useful?
JSON.parse, databases, and OpenAPI examples. After repair, tighten structure with JSON Schema or compare golden files using JSON Diff.How to Use
- Paste lenient JSON in the input panel
- Click Repair or press Ctrl+Enter
- Copy the repaired output or use the formatter next for pretty-print tweaks
What Gets Fixed (examples)
{ "a": 1, }→{ "a": 1 }{ 'b': 'x' }→{ "b": "x" }{ "c": 1 // note
}→{ "c": 1 }Features
- Strips
//and/* */comments outside of strings - Trailing commas removed before
}and] - Single-quoted strings and unquoted keys normalised toward strict JSON
undefinedrewritten tonull- Validates repaired output. you only copy when it parses
- Runs locally; no upload
Frequently Asked Questions
Does JSON allow trailing commas?
Strict JSON does not. This tool removes trailing commas so parsers like JSON.parse accept the output.
Is my data sent to a server?
No. Everything runs locally in your browser.
Will this fix every invalid document?
It handles common lenient patterns. Severely broken syntax may still need manual editing. use the JSON formatter for exact line and column errors.
Related Tools