Repair common problems in JSON-like text

Paste JSON-like text to run a fixed set of repair rules and read every change that was applied. The repair never executes the input, nothing is uploaded, and text that still cannot be parsed fails with the parser's error instead of a guess.

Runs locally in your browser
The repairer never evaluates code. It applies a limited, reviewable set of text transformations in this browser.
Invalid or JSON-like input

Safe repair is intentionally limited

The tool handles comments, trailing commas, single quotes, unquoted keys, smart quotes and common non-JSON literals. It never runs JavaScript, guesses missing business data, or silently hides an unrepaired parse error.

How to repair JSON-like text

Paste JSON-like text and the page applies a fixed, ordered set of repair rules — comments, trailing commas, single quotes, unquoted keys, smart quotes, True/False/None and non-finite numbers — listing every change it made. Nothing is repaired by guesswork: if the result still cannot be parsed, the run fails instead of returning a plausible document.

The whole repair is a text transformation followed by a strict JSON.parse, so the input is never executed and the page sends no request while you work. String contents are left alone: an http:// URL, a /* */ marker or a curly apostrophe inside a quoted value survives the run.

  1. Paste the input into the left pane. The rules only run when you press Repair JSON.
  2. Press Repair JSON. Already-valid input is reported as such and returned with two-space indentation; otherwise every rule that fired is listed under Applied fixes in the order it ran.
  3. Read the Applied fixes list and compare the output with your intent — literal replacement (True to true, NaN to null) is the rule that changes values on purpose.
  4. Press Copy for the repaired JSON; after a failed run the status says the copied text is still invalid. Clear empties both panes and the fixes list.

What the repairer does and does not change

Rules that run, in order

BOM removal, smart-quote normalisation, comment removal, single-quote conversion, unquoted-key quoting, literal replacement and trailing-comma removal run in that fixed order, and only outside quoted strings. Comments cover JavaScript's // and /* */ as well as Python-style # lines; keys may start with a letter, _ or $ and may contain non-ASCII characters such as Japanese; repeated trailing commas like [1,,] are removed until the bracket is clean.

Because the rules skip string contents, markers inside data survive: http://x, /* keep */ or #fff written inside a quoted string come out unchanged, and a typographic apostrophe in a value stays typographic. Smart quotes are converted only where they act as the quotation marks around a key or a string.

What it refuses to guess

Missing values and truncated files are not repaired. Inputs such as {"a": } (no value), {"a": [1, 2 (unterminated array), {a: .5} (leading decimal point) or {a: 0x1F} (hex number) end with the parser's error and the partially transformed text shown for review — that pane is not a result, and Copy says so.

NaN, Infinity and -Infinity all become null, because JSON cannot spell a non-finite number, and True/False/None become true/false/null. Check those substitutions before the document reaches a consumer that expects a number or a boolean.

Where a successful run still needs review

A green status only proves the text now parses; it cannot prove the data is what you meant. Duplicate keys keep the last value, every rewrite is recorded only in the Applied fixes list, and the output is always reformatted with two-space indentation — compare it with the original before overwriting a config or a fixture.

Everything happens in this tab: the page makes no network request while you repair, and no copy of the input is stored. Keep the original text until the comparison is done, and use Clear to remove the working copy from the page.

Recent tools: