Free tool · Writing and text

JSON formatter and validator

Paste JSON to tidy it up, minify it, or find out why it won't parse. The error message tells you the line and column. It runs in your browser.

Use it

Your JSON

Result

Paste some JSON and press Format.

Optional, and you don't need it to use the tool. You'll get the SortedDesk newsletter, starting with an email asking you to confirm. Unsubscribe at any time. Only the email address goes to Kit, who run our mailing list. Privacy

How it works

Your text is parsed with the browser's own JSON.parse, which follows the standard strictly. If it parses, it is valid JSON, and the tool prints it back with the indent you chose or on one line. If not, you get the browser's error and, where it can be worked out, the line and column.

The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, and comments (JSON doesn't allow them). Numbers must not have leading zeros, and NaN or undefined aren't valid values.

Questions

Is my JSON uploaded?

No. It's parsed in your browser, so API keys, customer data and anything private stay on your device. Still, avoid pasting live secrets into any web page.

Why does it say my JSON is invalid?

Most often a trailing comma, single quotes, an unquoted key or a missing bracket. The error shows the line and column to check.

What does sorting keys do?

It puts every object's keys in A to Z order, which makes two versions easy to compare.

Can it handle large files?

Yes, up to what your browser can hold in memory; several megabytes is fine.

Small print

Everything happens in your browser. Nothing you type or add is uploaded to us or anyone else, and the tool works with no account.

Free to use. Results are for convenience: check anything important before you rely on it.