JSON Repair

Paste broken JSON — trailing commas, single quotes, JS comments — and get back valid JSON. Runs entirely in your browser.

BROKEN INPUTUTF-8 / JSON
REPAIRED OUTPUT
// repaired JSON appears here

Where broken JSON comes from

Most "broken JSON" is not JSON at all — it is JavaScript object notation, config files with comments, or copy-pastes from API documentation that uses examples with trailing commas or single quotes for readability. These formats are not RFC 8259 JSON but are trivially fixable.

The harder cases are truncated payloads (network cut-off mid-response), deeply mismatched braces from template generation, or hand-edited files where someone deleted a comma along with a line. Those require the validator's line/column reporting to fix manually.

What gets fixed

  • Trailing commas before } or ]
  • Single-quoted strings → double-quoted
  • Inline // comments
  • Block /* */ comments
  • Missing commas between adjacent values

Privacy first

All repair logic runs locally in your browser tab. Your data never reaches any server, never gets logged, and disappears when you close the tab.

Common questions

What does JSON repair do?
JSON repair automatically fixes the most common syntax errors in broken JSON: trailing commas, single quotes, JavaScript-style comments, and missing commas between items. It outputs valid JSON that any parser can consume.
What errors can be auto-repaired?
Comments (//, /* */ and #), trailing and missing commas, single, back and curly quotes, unquoted keys, Python and JavaScript literals (True, False, None, undefined, NaN, Infinity), invalid numbers (+1, .5, 0x1F), raw line breaks and invalid escapes inside strings, missing colons, unclosed strings and brackets in truncated documents, Markdown code fences, JSONP wrappers, and several top-level values (NDJSON), which are wrapped in an array.
What errors cannot be auto-repaired?
Repair is a parser, not a guess: it never touches the inside of a string, so a URL with // or an apostrophe stays intact. When the intended structure is ambiguous, for example a closing brace in the wrong place in the middle of the document, the result may not be what you meant. Review the list of changes, and use the validator for the exact position of what remains.
Is my data safe?
All processing runs locally in your browser using JavaScript. Your data never touches any server. You can even use this tool offline after the first page load.
How is this different from the main editor?
The main editor at JSONEditor.net offers the same repair plus a full multi-tab workspace, tree and graph views, Monaco editor with IntelliSense, and conversion to 18+ formats. This page is a single-purpose tool — paste in, repair, copy out.
My JSON is still broken after repair — what next?
Check the exact line and column reported by the validator for the remaining error and fix it by hand, then run the repair again. Misplaced brackets in the middle of a document are the usual cause.