JSON Repair Tool
Format & ValidatePaste broken JSON and get valid JSON back — with a list of every fix applied.
Fix broken JSON automatically
When JSON is not quite valid but the intent is obvious, repairing it by hand is tedious. This JSON repair tool tolerantly parses the broken input, rewrites it into strict, standards-compliant JSON, and shows a plain-English log of every fix it applied — so a repair never happens silently and you can verify each change.
It is the fastest way to rescue JSON you pasted out of a log file, a chat tool, or a half-finished edit, without hunting for the one stray character that broke it.
What it can repair
The repairer is a recovering parser: instead of stopping at the first syntax error, it patches the document as it reads it. That covers the common ways JSON breaks, and many that other tools miss:
- Trailing commas, doubled commas, and missing commas between items.
- Single quotes, backticks, smart “curly” quotes from Word or Slack, and unquoted keys.
- Unescaped quotes, tabs, and line breaks inside string values.
- // line, /* block */ and # hash comments, stripped out cleanly.
- Python literals (True, False, None) and JavaScript NaN, Infinity, undefined.
- Malformed numbers: 0x1f, +1, .5, 5., 007, 1_000, and the 1n BigInt suffix.
- Markdown ```json code fences, JSONP callback wrappers, and prose around the payload.
- Escaped blobs like {\"a\":1} that lost a layer of quoting in a log.
- Unterminated strings, missing closing brackets, and mismatched ones in truncated data.
- Newline-delimited JSON (NDJSON) and back-to-back objects, combined into one array.
- MongoDB and JavaScript constructor calls: ISODate(…), NumberLong(…), ObjectId(…), new Date(…).
Repairing JSON from ChatGPT and logs
Two sources break JSON constantly. Output copied from an AI assistant often arrives wrapped in Markdown code fences, with a “Sure, here you go:” lead-in and a sign-off after the closing brace; this tool strips all of it automatically. JSON pulled from a log line is frequently truncated mid-string or double-escaped; the repairer peels off the extra escaping and closes the open strings and brackets so you get a parseable document back.
Large integers survive the round-trip exactly as written. Snowflake IDs, int64 primary keys, and long decimals are carried through as source text rather than JavaScript numbers, so a 19-digit ID is never silently rounded — a failure mode that quietly corrupts data in many other repair tools.
Fix invalid JSON online
Invalid JSON is any text that fails the RFC 8259 grammar: a missing closing bracket, a trailing comma after the last item, a single-quoted string, an unquoted key, a JavaScript comment, or a Python-style True, False, or None literal. Each of these makes a document technically invalid JSON even when the intent is obvious.
This tool repairs invalid JSON by tolerantly parsing the broken input, rewriting it into strict valid JSON, and listing every fix it applied — which commas were added or removed, which quotes were normalized, which brackets were closed. Every repair is counted, so you can see that it added two commas rather than twenty. If the input is not JSON at all, it says so rather than inventing a document.
Everything in the JSON Repair Tool
Repair broken JSON online: fix trailing and missing commas, single or smart quotes, unquoted keys, comments, unescaped quotes, missing brackets, and Python/JS literals. See every fix applied. Free & private.
Recovering parser
It patches errors as it reads instead of stopping at the first one, so one bad line never blocks the rest.
Rescues truncated data
Unterminated strings, missing commas, and unclosed or mismatched brackets are completed automatically.
Fix log of every change
A plain-English list counts exactly what was repaired, so nothing is silent.
Big integers stay exact
Snowflake and int64 IDs come back digit-for-digit instead of being rounded by JavaScript numbers.
Frequently asked questions
Trailing, doubled and missing commas; single, backtick and smart “curly” quotes; unquoted keys and bare words; unescaped quotes, tabs and line breaks inside strings; //, /* */ and # comments; Python literals (True, False, None); JavaScript undefined, NaN and Infinity; malformed numbers such as 0x1f, +1, .5, 007, 1_000 and 1n; Markdown code fences and JSONP wrappers; escaped blobs like {\"a\":1}; unterminated strings and missing or mismatched brackets; newline-delimited JSON; and MongoDB constructor calls such as ISODate(…) and NumberLong(…).
Paste the broken JSON into the left editor. The tool repairs it instantly and shows the valid JSON on the right, together with a counted list of every fix it applied. Copy or download the result.
Yes. Markdown code fences (```json … ```) and the surrounding chat prose are stripped automatically, escaped log blobs are unescaped, and truncated payloads get their unclosed strings and brackets completed.
No. Number literals are carried through as source text rather than JavaScript numbers, so a 19-digit Snowflake ID or int64 primary key comes back exactly as it went in — a rounding bug that silently corrupts data in many other JSON repair tools.
The repairer recovers from almost anything that is recognisably JSON. If the input is not JSON at all, it says so rather than inventing a document, and the validator reports the exact line and column where parsing failed.
No. Every operation runs entirely in your browser using client-side JavaScript. Your JSON is never uploaded, logged, or stored on any server — it never leaves your device.
Yes, completely free with no sign-up required. There are no usage limits, no watermarks, and no premium gate on any feature.
Related tools
JSON Formatter
Beautify, minify, and repair messy JSON — even Python dicts and JS objects — into clean, valid output.
JSON Validator
Validate, verify, and check JSON — every syntax error pinpointed by line and column.
JSON Schema Validator
Check that your JSON matches a JSON Schema — with every error pinpointed by path.
JWT Decoder & Verifier
Decode a JWT's header and payload, and verify its signature — right in your browser.