← All tools

Development / HXD Labs

JSON formatter and validator

Paste a JSON document to validate it, indent it and copy the formatted result.

Result

Fill in the fields to see the result.

How to use

Paste JSON, choose 2-space, 4-space or compact output, then validate it. When your browser reports an error position, the tool shows its line and column. Formatting keeps values but may change whitespace and the display of some numbers.

How it works

JSON.parse validates syntax and JSON.stringify formats the value with two-space, four-space or compact output. The text stays in your browser.

Example

Paste {"ok":true,"count":2}, choose an output style and copy the formatted result. When the browser reports an error position, the tool shows its line and column.

Good to know

JSON does not allow comments, trailing commas or unquoted keys. Very large numbers may lose precision in JavaScript.