Closes Truncated JSON
Adds missing closing brackets, braces and quotes when a response or log line was cut off, and completes partial true/false/null values.
Paste broken JSON, a JavaScript object, a Python dict, a cut-off API response or ChatGPT output and get valid, formatted JSON with a list of every fix.
Fix invalid JSON instantly: missing brackets, truncated responses, trailing commas, single quotes, Python dicts, comments and LLM output. Runs in your browser.
{name: 'Ali', tags: ['a','b',], active: True,}{
"name": "Ali",
"tags": ["a", "b"],
"active": true
}
Fixed: unquoted keys, single quotes, trailing commas, True → trueTip: Always check the list of changes; repair guesses intent, and very broken input may need a manual look.
Adds missing closing brackets, braces and quotes when a response or log line was cut off, and completes partial true/false/null values.
Converts True/False/None, single and backtick quotes, unquoted keys, comments, NaN/undefined, hex numbers and "a" + "b" concatenation.
Strips Markdown code fences, text around the JSON, JSONP callbacks, smart quotes and invisible spaces; wraps JSON Lines in an array.
A real tokenizer, not find-and-replace: URLs, "//" and words like True inside strings are never changed. Big numbers keep every digit.
Missing or mismatched closing brackets, truncated output, trailing and missing commas, missing colons and values, single or curly quotes, unquoted keys and values, unescaped quotes and line breaks inside strings, comments, Python True/False/None and tuples, NaN/Infinity/undefined, hex numbers, MongoDB wrappers such as ObjectId("…"), JSONP and escaped (stringified) JSON.
Yes. When an API response, log line or AI answer stops early, the repair closes the open string, adds null for a property without a value and appends every missing } and ] in the right order.
No. The input is read token by token, so text inside strings — URLs with //, the word True, quotes inside quotes — stays exactly as written. Only the syntax around values is fixed.
Paste the whole answer. The tool removes the surrounding sentences and ```json fences, fixes the usual syntax slips, and lists each change so you can review it.
No. Repair runs entirely in your browser, so API keys, customer records and production payloads never leave your device.