JSON repair

Client

Turn slightly broken or sloppy JSON into strict JSON. For comments and JSON5 keys, use JSON5 / JSONC → JSON; to pull JSON out of mixed text, use Extract JSON from text.

Learn more: repair vs JSON5

Heal common strict-JSON syntax mistakes (such as trailing commas) into parseable RFC 8259 JSON. Comments and JSON5-only features still belong on the JSON5 / JSONC page.

Not a substitute for JSON5

If your file intentionally uses comments, unquoted keys, or other JSON5 rules, convert with the JSON5 / JSONC → JSON tool instead—repair focuses on near-miss strict JSON.

Extraction vs repair

When JSON is embedded in logs or prose, use Extract JSON from text first, then repair only if the extracted slice still fails strict parse.

Repair → strict JSON

?

Runs a best-effort repair for common mistakes (often trailing commas or slightly broken delimiters). It does not understand JSON5-specific keys or comments—for those start from the JSON5 / JSONC page instead.

Common use cases

  • Fix exports from loggers or editors that add trailing commas before closing brackets.
  • Recover hand-edited fixtures that fail JSON.parse in CI but are close to valid.
  • Normalize a single blob before strict validation or diffing on the formatter page.

Common mistakes to avoid

  • Expecting JSON5 or wide comment support

    Repair targets almost-JSON, not full JSON5. Keep using the JSON5 tool when comments or unquoted keys are intentional.

  • Trusting repair for security-sensitive parsing

    Healing algorithms can change edge cases. Re-validate with your application parser and JSON Schema when correctness is critical.

FAQ

Is repair deterministic?

The underlying repair library follows predictable rules, but ambiguous broken text may still fail—use the error message as a guide.

Does this run locally?

Yes. Everything happens in your browser tab.

Common search terms

Phrases people search for that match this tool. See the full long-tail keyword index.

  • repair invalid json online
  • fix json trailing comma browser
  • almost json to strict json
  • json syntax fix tool

Related utilities you can open in another tab—mostly client-side.