About this JSON Repair & Validator
Paste broken JSON from API logs, CI configs, or half-copied responses—click Validate to check syntax without changing your text, or Repair to produce standard JSON you can copy.
Repair handles trailing commas, // comments, single quotes, unquoted keys, and sometimes missing closing brackets, then pretty-prints with 2-space indent. Green marks on the right show what changed compared to your original paste.
JSON validation & repair essentials
Why trailing commas break JSON.parse
Strict JSON (RFC 8259) forbids a comma after the last item in an object or array. Many editors and JS configs allow trailing commas, but JSON.parse, CI linters, and Validate on this page will fail. Repair removes those commas and outputs parseable strict JSON.
What is not standard JSON
- Keys and string values must use double quotes—not single quotes.
- No // line comments or /* */ block comments.
- No trailing comma after the last property or array element; unquoted object keys are invalid.
- Console object literals and JSON5-style paste often need Repair before Postman, strict APIs, or the JSON formatter.
Unexpected token and SyntaxError
These errors usually point near an extra comma, a missing quote, or mismatched brackets. Click Validate for an approximate line and column under the input, then check that line for comments, trailing commas, or single quotes. Repair normalizes quotes and strips comments and trailing commas; badly truncated text may still fail and need manual edits.
Validate vs Repair
Validate is a syntax check only—it does not rewrite your paste. Repair rewrites into strict JSON and marks changes in green on the right. After a successful repair, use Open JSON formatter for tree view, minify, or XML/YAML conversion. Processing stays in your browser; nothing is uploaded.
Typical search scenarios
Unexpected token in CI or config
Paste the failing fragment, click Repair, and use green highlights to spot removed trailing commas or comments before you commit the fixed block.
Half-copied API response
Validate points to the rough line/column; Repair tries to close brackets and normalize quotes. Review highlights before using in production.
JavaScript-style object literal
Single-quoted strings and unquoted keys from devtools are not standard JSON—Repair converts them for request bodies and API examples.
Frequently asked questions
How do I validate JSON syntax online?
Does online JSON syntax check change my text?
How to fix JSON with a trailing comma online?
Unexpected token or SyntaxError when pasting JSON—what now?
Can I repair JSON with comments online?
How to convert JSON5 to standard JSON online?
What does green highlighting mean after repair?
Can truncated or incomplete JSON be auto-fixed?
How do I pretty-print or minify after repairing JSON?
Common broken patterns
{"a":1,}Trailing comma before } — typical Repair fix{key:'value'}Single quotes and bare keys → standard JSON// note\n{"x":1}Line comments stripped, object keptValidate onlyPass/fail check with no rewrite