VitalTools
...

JSON Formatter & Validator

Pretty-print, validate, sort and minify JSON. Errors come back with the exact line, column and a plain-English explanation.

JSON input

Indent

Spaces per nesting level, or a tab character.

Output

Paste JSON to format it

Pinpointed Errors

Line, column and the offending line, not just "invalid JSON"

Plain-English Hints

Names trailing commas, single quotes, comments and NaN

Nothing Uploaded

Parsing happens in this tab — your payload never leaves it

Frequently asked questions

Why is my JSON invalid when it looks fine?

The usual three are borrowed from JavaScript and are not legal JSON: a trailing comma before a closing bracket (`{"a": 1,}`), single quotes instead of double quotes, and `//` or `/* */` comments. Unquoted object keys and the values `NaN`, `Infinity` and `undefined` are rejected for the same reason. The error box names whichever one it spots near the failure.

Does my JSON get sent anywhere?

No. The page is prerendered static HTML and the formatting runs in your browser with the built-in `JSON.parse`. There is no upload, no request, no logging — you can put the page in a tab, go offline, and it still works. Safe for payloads containing tokens or customer data.

Why did my large integer change value?

JavaScript numbers are 64-bit floats, so whole numbers above 9,007,199,254,740,991 (2^53 - 1) cannot all be represented. Snowflake IDs and 64-bit database keys get rounded: `12345678901234567890` comes back as `12345678901234567000`. Every JSON tool built on `JSON.parse` does this. If you need the exact value, keep those IDs as strings in your payload.

What does "Sort keys" do?

It reorders every object's keys alphabetically, at every level of nesting. Array order is never touched, because position is meaningful in an array. It is mainly useful for diffing two API responses that list the same fields in a different order, or for producing a stable form to checksum.

More Developer tools