JSON formatter and validator

Paste some JSON: the tool validates it, indents or minifies it, and shows the exact place of an error (line and column) with a clear explanation. Numbers and strings are copied as written: a 20-digit identifier will not be rounded.

Paste some JSON to start.

Formatting

The JSON you enter is analyzed in your browser; it is neither sent nor stored.

What the tool does

  • Precise validation

    Strict parsing per RFC 8259: the error is located to the line and column and explained, with a hint for common mistakes (apostrophes, trailing comma, comments, unquoted keys).

  • Lossless formatting

    Indent with 2 or 4 spaces or a tab, or minify. Numbers and strings are copied as written: 12345678901234567890 or 1.10 are not rounded, unlike a round trip through JSON.parse and JSON.stringify.

  • Key sorting

    An alphabetical sort at every level makes two documents comparable at a glance or with a diff tool. Arrays keep their order.

  • Duplicate keys

    JSON tolerates them but most parsers keep only one. The tool flags them so you do not lose a value without knowing.

How to use it

Paste the document in the input area: validation is immediate. If an error is reported, the “Go to the error” button places the cursor at the spot. Then choose the formatting, and copy or download the result. Limits: 5 million characters and 512 nesting levels. The tool only checks syntax: it does not validate against a JSON Schema, and it accepts neither comments nor trailing commas (JSONC and JSON5 are not JSON).

FAQ

Why is my JSON rejected when it works in JavaScript?

A JavaScript literal accepts apostrophes, unquoted keys, comments and trailing commas. JSON is a stricter interchange format: double quotes are required, with no comments and no trailing comma.

Are my large numbers modified?

No. The tool never converts values: a 20-digit identifier stays identical. Beware of JavaScript though, which would round it when reading it with JSON.parse (beyond 9,007,199,254,740,991).

Search