Fix Invalid JSON
Automatically repair malformed JSON with unquoted keys, single quotes, trailing commas and Python-style literals.
Runs locally · No data sent to server · Free, no signup
About Fix Invalid JSON
JSON from API responses, copied JavaScript objects, Python dictionary exports and manually edited config files often contains minor syntax errors that prevent it from being parsed. The most common problems are single quotes instead of double quotes, unquoted property keys, trailing commas after the last item, and Python-style True, False and None literals. This tool detects and repairs these patterns automatically, producing valid, formatted JSON.
How to use Fix Invalid JSON
Paste the invalid or malformed JSON into the input box and click Run. The tool applies repair strategies in sequence — fixing quoting, removing trailing commas, normalising literals. If a valid repair is found, the corrected and formatted JSON appears in the output. If the input is too malformed to repair automatically, an error message explains what went wrong.
When to use this tool
Use this when you receive a JSON payload that fails to parse, when working with JavaScript object literals that need to be converted to strict JSON, when dealing with Python dictionary exports that use Python syntax, when config files have been edited by hand and contain small syntax errors, or when copying JSON from a browser console that includes trailing commas.
Privacy
Manually hunting down JSON syntax errors in large payloads is slow and tedious. This tool fixes the most common patterns in seconds. All processing runs in your browser — no data is sent to a server.
Frequently asked questions
What types of errors can it fix?
Single quotes replaced with double quotes, unquoted property keys converted to quoted keys, trailing commas removed from the last item in objects and arrays, and Python-style True, False and None converted to JSON-compliant true, false and null.
What errors can it not fix?
The tool cannot reconstruct fundamentally broken or incomplete JSON — for example, payloads cut off mid-string, files with structural corruption, or content that is not JSON at all.
How is this different from the JSON Formatter?
The JSON Formatter only formats valid JSON — it will reject input with syntax errors. This tool specifically attempts to repair invalid JSON before formatting it. If your JSON is already valid, use the Formatter.
Can I trust the output?
Always review the repaired output against your expected data structure before using it. The repair process makes reasonable assumptions about intent, but unusual or ambiguous inputs may require manual correction.
Related tools
JSON Formatter
Paste minified or compact JSON and get it back formatted with proper indentation — readable, debuggable and validated.
JSON to CSV
Convert a JSON array of objects into CSV format — ready to open in Excel, import into a database or share as a spreadsheet.
CSV to JSON
Convert CSV data with a header row into a structured JSON array of objects — ready for APIs, web apps or further processing.
Compare JSON
Paste two JSON objects and instantly see the differences — key order is ignored, only real data changes are highlighted.