JSON Formatter and Validator

Processed locally in your browser. Your input is not uploaded or saved by this tool.

Text output preserves number spelling and duplicate keys. The tree uses JavaScript values: large numbers can round and duplicate keys show only the last value.

Please enter all values to see results.

Paste JSON, then choose Format, Minify or Validate.

How it works

Format adds whitespace with 2- or 4-space indentation. Minify removes whitespace outside strings. Both preserve original strings, number spelling and key order. Validation uses the browser’s strict JSON parser: comments, trailing commas and single-quoted strings are not JSON. Error line and column are shown when the browser supplies a position.

Example

Formatting {"count":2,"items":[true,null]} places properties and array values on separate indented lines. Minifying it removes only unnecessary whitespace, not spaces inside string values.

Frequently asked questions

Can I format JSON containing large integers?

Yes. Formatted text and downloads retain numeric tokens such as 9007199254740993 without rounding. The optional tree view uses native JavaScript numbers and may show rounded values.

Can I paste confidential JSON?

This tool processes JSON locally without uploading or saving it. Still, avoid working with secrets on a shared device and do not share clipboard contents with untrusted applications.