Turn loose JSON into strict JSON: comments, single quotes, bare keys and trailing commas.
Editors and logs often emit JSON with comments, single quotes, unquoted keys, or a comma before the closing brace. A strict parser rejects that. This page rewrites those habits and pretty-prints the value. Comments are removed, not stored. A tree editor is JSON formatter. Comparing two values is JSON diff.
{name: 'Ada', n: 1, tags: ['a',],} and a // note line. The result is an object with name Ada, n 1, and tags containing a. The comment is gone.// and /* */ outside strings are removed. Single-quoted text becomes a JSON string, and the escapes \n, \t, \r, \', \" and \\ become the characters they name. A bare word is quoted, except true, false and null, which stay keywords in any letter case. undefined, NaN and Infinity become null. A comma that has only space or a comment before } or ] is dropped. The result is indented by two spaces. Text that is already inside double quotes is copied through. If the rewrite is still not JSON, or the box is empty, the page reports invalid JSON.
// comment beside the object.Repair builds strict JSON. Comments are not part of JSON, so they are removed rather than stored.
Text that is already inside double quotes is left alone. Only bare words and single-quoted strings are rewritten.