Format, minify and validate JSON as you type. Errors point to the exact line and column, and Repair fixes the usual breakages in JSON copied from logs, config files or ChatGPT. Fold big documents in the tree view. It runs in your browser.
Free JSON formatter and validator. Paste JSON or drop a .json file to format it with 2 spaces, 4 spaces or tabs, minify it or sort its keys. Invalid JSON shows the line and column of the error, and Repair fixes trailing commas, comments, quotes, Python literals and code fences. Includes a collapsible tree view. Runs in the browser.
Your formatted JSON shows up here
Paste JSON on the left. Pick Format or Minify, and switch to Tree to fold nested objects.
Was this tool helpful?
Most invalid JSON breaks in one of a few ways. These are real before and after pairs from the Repair button.
Before
{"tags": ["a", "b",],}After
{"tags":["a","b"]}
Before
{name: 'Maya', 'plan': 'pro'}After
{"name":"Maya","plan":"pro"}
Before
{"active": True, "coupon": None}After
{"active":true,"coupon":null}
Before
{
"retries": 3, // max attempts
/* seconds */ "timeout": 30
}After
{"retries":3,"timeout":30}
Before
Here you go:
```json
{"ok": true}
```After
{"ok":true}
Before
{"items": [{"id": 1}, {"id": 2After
{"items":[{"id":1},{"id":2}]}
API responses, config files, log lines or a whole chat reply. It's checked as you type.
Click the line number to jump to the error, or click Repair JSON and review the list of changes.
Pick an indent or minify, sort keys if you want stable diffs, then copy, download or open the tree view.
Paste your JSON or drop a .json file into the formatter. It's formatted as you type, with 2 spaces, 4 spaces or tabs for indentation. Turn on Sort keys A to Z to order every object's keys, then copy the result or download it as a .json file. Strings and numbers are kept exactly as you wrote them.
Paste it in and the validator checks it as you type. Invalid JSON shows the line and column of the problem, a plain description such as "Trailing comma" or "Missing comma after this value", and a highlight on the line. Click the line number to jump the cursor straight to the spot in the editor.
Click Repair JSON. It removes ```json code fences, comments and trailing commas, turns single quotes and curly quotes into double quotes, quotes bare keys, replaces Python True, False and None, adds missing commas and closes open brackets. It lists every change it made, and Undo puts your original text back.
Chat replies often wrap JSON in a ```json code fence, add a sentence before or after it, or include comments and trailing commas that JSON doesn't allow. Paste the whole reply here and click Repair JSON. The formatter strips the fence and the extra text, fixes the syntax and shows you what it changed.
Minify removes every space and line break that isn't inside a string, so the JSON takes fewer bytes to store or send. The data stays the same. The footer shows the size before and after, and you can switch back to Format at any time to read it again.
Yes. The Tree tab shows the document as nested objects and arrays you can fold and unfold, with the number of keys or items next to each one. Expand all and Collapse handle big documents, and the footer counts the keys, arrays and nesting depth.
Yes. Files up to about 5 MB work in the browser. Formatting runs as you type, and very large documents skip the syntax coloring so the page stays responsive. Numbers with more than 15 digits, such as long IDs, keep every digit in the formatted output.
No. Validation, formatting, repair and the tree view all run in your browser, so API keys, tokens or customer data in the JSON never leave your computer. There's no signup, and closing the tab clears everything.
Everything from model picks to CSV converters, with no account needed.