How to fix and format JSON
- Add your JSON. Paste it into the Input pane, drag a
.jsonfile onto it, or use Open file. The file is read with your browser's file API and never leaves your computer. - Read the status bar. The input is checked automatically a moment after you stop typing. If something is wrong you see the line and column, a plain-English explanation and a snippet with a caret under the problem. Press Jump to error to select that spot in the editor.
- Press Quick Fix. Common breakage is repaired in one step and every change is listed, grouped by type. Press Replace input with fixed JSON if you want to keep editing the repaired version.
- Format or minify. Choose 2 spaces, 4 spaces or tabs and press Format, or press Minify to strip all whitespace for production. Turn on Sort keys for stable, diff-friendly output.
- Explore and export. Switch to the Tree tab to expand and collapse nested objects, then copy the result or download it as a
.jsonfile.
Where broken JSON comes from
Most invalid JSON is not really "broken", it is just written in a neighbouring format. JavaScript object literals allow unquoted keys, single quotes and trailing commas. Python's print() of a dictionary produces True, None and single quotes. Configuration files often carry comments, and logs get cut off mid-object, leaving brackets unclosed. Quick Fix is built around exactly these cases, so a snippet copied from code, a console or a truncated log usually becomes valid JSON in one click.
Common JSON fixes
Frequently asked questions
What exactly does Quick Fix change?
It only touches syntax, never your data. It removes trailing and doubled commas and comments, converts single or curly quotes to double quotes, quotes unquoted keys, turns Python True/False/None into true/false/null, replaces NaN, undefined and Infinity with null, inserts missing commas and colons, and closes brackets that were left open. Every change is listed with its line number so you can review it.
Is it safe to paste API keys or customer data?
Your JSON never leaves your device: parsing, fixing and formatting all happen in JavaScript in your browser. The page only sends anonymous usage counts, such as which button was pressed and which kinds of errors Quick Fix repaired, never the text itself (see the Privacy page). Even so, treat secrets carefully and clear the editor when you are done on a shared computer.
Why did Quick Fix not fix everything?
Some errors are ambiguous. If two separate JSON documents are pasted one after another, or a quote is missing in the middle of a long string, there is no single correct guess. In those cases the tool fixes what it safely can and points to the line and column of the remaining problem.
Why do some large numbers change after formatting?
Browsers store JSON numbers as 64-bit floating-point values, so integers larger than 9,007,199,254,740,991 lose precision. If you work with big IDs, keep them as strings in your JSON.
How big a file can I open?
Files of 5 to 10 MB format comfortably on a typical laptop. Validation waits until you pause typing, and the tree view loads nodes only when you expand them, so the page stays responsive.
What does Sort keys do?
It orders every object's keys alphabetically, at every level of nesting. Array order is never changed. Sorted output makes two versions of a file much easier to compare in a diff.