Developer Tools

JSON Formatter

Format, minify, and validate JSON data

Last reviewed: How we build & verify

How it works

Reindents JSON into something readable and reports exactly where it breaks when it does not parse. Validation is the half that earns its keep: the parser names the offset of the first character violating the grammar, which beats reading a minified payload by eye looking for the unbalanced brace.

Notes
  • Strict JSON as defined by RFC 8259 permits no comments and no trailing comma. Both are legal in JSON5 and in the JSONC dialect that VS Code uses for its own settings files, which is why configuration that an editor accepts happily gets rejected by an API. Where a payload needs annotation, put it in a string field.
  • Key order carries no meaning in the JSON object model and nothing guarantees it survives a round trip. JavaScript objects do preserve insertion order for string keys, but integer-like keys are hoisted and sorted ahead of everything else, so {"10": a, "2": b, "name": c} comes back with "2", then "10", then "name". Anything order-dependent belongs in an array.
  • The grammar puts no limit on a number, but JSON.parse produces IEEE 754 doubles. Integers above 9,007,199,254,740,991 silently lose their low digits, which is why large database identifiers, Twitter snowflakes and financial reference numbers travel as strings and should stay that way through any reformat.
  • Duplicate keys parse without complaint in most implementations, with the last occurrence winning, though the specification does not require that and parsers disagree. A formatter quietly collapsing a duplicate has changed the document, so it is worth looking at rather than accepting.

Related Tools

Most Searched Today

Frequently Asked Questions

Yes. Json Formatter is free for personal projects, client work, or anything else, with no attribution required and no usage cap.

Json Formatter processes your input directly in the browser rather than uploading it anywhere. That also means it keeps working if your connection drops after the page has loaded. If you notice different behavior, let us know with the feedback button in the bottom-right corner.

JSON Formatter | ExaCalc