JSON Repair Tool
Paste malformed JSON and instantly repair trailing commas, single quotes, comments, unquoted keys, and Python literals — with a line-by-line change preview,
Loading tool...
What is JSON Repair Tool?
JSON Repair Tool is a free online utility that fixes malformed JSON so it parses cleanly again. It runs a context-aware parser over your input and repairs the most common mistakes: trailing commas, single-quoted strings, JavaScript-style comments, unquoted keys, Python literals like True and None, NaN and Infinity values, hex numbers, missing commas, and config-style equals signs. Every fix is reported with its line and column, and the whole process happens locally in your browser — nothing is uploaded.
Key Benefits
- Turn unparseable JSON from logs, LLM output, or API responses into valid JSON in seconds
- Structure-aware repairs instead of blind find-and-replace that can corrupt string contents
- Transparent change log: line, column, and snippet for every applied fix
- Understands Python dicts, JS objects, and config files — the usual sources of broken JSON
- Private by design: static page, no server round-trip, works offline
Common Use Cases
- •Fixing API responses or log lines that were truncated or hand-edited
- •Converting Python dictionary output into strict JSON
- •Cleaning JSON produced by an LLM that added comments or trailing commas
- •Salvaging config files written in relaxed JSON for editing before strict import
- •Debugging parser errors by comparing the original and repaired versions side by side
How to Use the JSON Repair Tool
- Paste your broken JSON: Copy the malformed JSON — from logs, config files, LLM output, or an API response — into the text box. Repair starts instantly as you type or paste.
- Check the repair status: A green banner confirms the JSON was repaired and now parses cleanly; a red banner shows the remaining parser error if the input is beyond repair.
- Review the change preview: Every applied fix is listed with its line number, column, and a short source snippet, so you can verify each change before trusting the output.
- Copy or download: Use the Copy button for the repaired JSON, toggle Minify for a compact version, or download it as a file. Use Repaired Output to feed the result back in for a second pass.
Key Features
- 12 repair classes: trailing commas, single quotes, comments, unquoted keys, Python literals, NaN, hex numbers, and more
- Context-aware state-machine parser — understands structure instead of naive find-and-replace
- Change preview with line, column, and source snippet for every fix applied
- Minify toggle, one-click copy, and download as a repaired JSON file
- Handles Python dicts, JavaScript-style comments, and config-style equals signs
- Runs entirely in your browser — payloads never leave your machine