JSON Repair
Paste almost-JSON from logs, configs, or copy-paste mishaps. One click turns lenient text into strict JSON you can trust — with a clear summary of what changed.
- trailing commas
- comments
- single quotes
- unquoted keys
undefined
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), lists what was normalized when possible, and 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 JSON 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
What does a JSON repair tool do?
A JSON repair tool applies safe heuristics to common syntax problems—such as trailing commas, comments, single quotes, and unquoted keys—so lenient JSON-like text becomes strict JSON that parsers accept.
What JSON errors can be repaired automatically?
Common fixes include trailing commas, missing commas where safe to infer, smart quotes, JavaScript-style comments, single-quoted strings, unquoted keys, undefined rewritten to null, and light punctuation issues. Severe structural damage may still need manual edits.
Will it fix every invalid JSON document?
No. Severely corrupted or ambiguous text may still fail. Use the JSON Formatter or JSON Validator for exact line and column errors, or Fix Invalid JSON for guided fixes.
Why does JSON break in copied data?
Copying from email, documents, spreadsheets, logs, or AI assistants often introduces smart quotes, stray commas, or comments that strict JSON rejects.
Should I validate repaired JSON afterward?
Yes. Run the repaired output through the JSON Validator to confirm it parses before you ship or store it.
Can I format repaired JSON after fixing it?
Yes. Once valid, use the JSON Formatter or JSON Beautifier for readable indentation.
Is my broken JSON uploaded anywhere?
No. Repair runs locally in your browser for privacy.
What if repair does not solve the issue?
Read the validator or formatter error location, simplify the snippet, and manually check brackets, commas, and quotes near the failing line. JSON Diff can help compare a known-good sample against a broken one.
Related Tools