ANALYSIS REPAIR DIAGNOSTIC

JSON / XML Repair

Drop in or paste malformed JSON or XML — trailing commas, unquoted keys, unclosed tags, missing braces, truncated output, and more. Preserves as much of the original data as possible and reports exactly what it changed. Preserve the data first, repair the structure second.

Input

Common error messages this diagnoses

If you're here because something threw one of these, this tool shows you exactly what's wrong and how much is recoverable:

  • "Unexpected token in JSON at position X" — (browser JSON.parse) — almost always a trailing comma, missing quote, or unquoted key.
  • "Unexpected end of JSON input" — the JSON was cut off before it was structurally complete.
  • "Unexpected non-whitespace character after JSON data" — extra content after what should've been the end of the document.
  • "XML Parsing Error: not well-formed (invalid token)" — an unescaped character or malformed tag broke the parser.
  • "mismatched tag" — an opening tag with no matching close, or the reverse.

What this tool doesn't do (yet)

No JSON Schema, XSD, or DTD validation — this checks that the structure is well-formed, not that it matches a particular schema. No cross-file or reference-file repair (comparing against a known-good copy of the same file) and no repeating-record-pattern inference — both are powerful ideas but risk inventing field values if built carelessly, so they're deferred rather than done half-safely. No batch/folder mode — one file or paste at a time. Very large files (tens of MB+) are read fully into memory like every other tool here, not streamed. Duplicate JSON keys are resolved by keeping the last occurrence (matching what JSON.parse itself does) rather than offering a full keep-first/rename/merge picker. Format-specific awareness is limited to GeoJSON and SVG; RSS/Atom/GPX/KML/plist/Android XML aren't specially recognized yet. Nothing here ever fetches or resolves external XML entities or DTDs — suspicious declarations are flagged, never resolved.