JSON RepairONLINE

Repair common JSON syntax problems and review a valid JSON suggestion.

1 MiB per input · Ctrl / ⌘ + Enter to run

Repair may infer missing content or change interpretation. Review the suggestion; your original input is preserved.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Repair malformed JSON and review what the repair inferred

JSON Repair proposes a valid document from text with common syntax mistakes. It is useful for recovering a draft copied from logs, JavaScript examples, or truncated output.

When should you use it?

  • Fix unquoted names and single-quoted values.
  • Remove comments or trailing commas from an example.
  • Recover a partially written object for manual review.
WORKED EXAMPLE

Example: review a repair suggestion

Repair proposes syntax changes. Inspect the meaning of every value before using the result.

Broken input
{name: 'Alex', active: true,}
Possible repair
{"name":"Alex","active":true}

A repair is a proposal about the intended text

A repair library can often add missing quotes, remove a trailing comma, or close an unfinished container. It cannot know the value a producer intended to send. A truncated response may be made syntactically valid while still missing records. Keep the original input and read the repaired output before using it as a source of truth.

Fix the producer when the same error returns

Repair is useful for recovering a pasted example or investigating a damaged export. Repeated repairs in a data pipeline can conceal a serialization bug. Once you identify the cause, correct the generator or response handling and validate its output. If the file intentionally uses comments and trailing commas, JSONC to JSON is the more explicit conversion for that format.

AT THE WORKBENCH

Recover a usable draft from broken JSON.

Repair can add missing quotes or commas, remove comments or trailing commas, and recover some incomplete structures. The result is a suggestion to inspect, not proof of the intended data.

  1. Paste the broken text

    The input is preserved throughout repair.

  2. Generate a suggestion

    jsonrepair proposes changes; the strict validator checks the result.

  3. Review before using

    Copy the result or open it in the JSON editor only after inspecting it.

IN PRACTICE

How do I repair JSON with single quotes, comments, or a trailing comma?

Paste the JSON-like text into Repair and generate a suggestion. Compare each change against your intended data before exporting. The tool can fix common punctuation and quoting mistakes, but it cannot know a value that was never present in the source.

JSON-like input and suggested strict JSON

text
Input:    {name: 'Alex', active: true,}
Possible: {"name":"Alex","active":true}

The input line is deliberately invalid JSON. The output is a proposal that should be checked with the original source or a schema.

No. Repair may infer missing punctuation or content and change meaning. For production contracts, find and fix the producer; use the Validator to diagnose errors without modifying data.

BEFORE YOU USE THE RESULT

What should you check before using the result?

Missing data has no knowable intended value. A repair may infer or change meaning, so inspect names, numbers, array length, and strings before using it. For diagnosis without changes, use Validator.

Repair has limits

No library can know the intended value of text that is missing. Truncated arrays, incomplete strings, or JavaScript-like values may need assumptions. Check key names, numbers, and item counts before using a repaired response in another system.

Validating is different from repairing

The syntax validator reports errors without modifying data. This tool intentionally attempts changes, using jsonrepair in a worker. It never executes pasted JavaScript and never loads referenced URLs. A repair that still fails strict JSON validation is not exported.

Understand JSON syntax

Technical reference: JSON syntax and interoperability · RFC 8259

THE JSON FIELD GUIDE
All guides