# JSON formatter and validator

> Free JSON formatter and validator: pretty-print with 2 or 4 spaces or tabs, minify, sort keys, and see the exact line and column of a syntax error. Runs in your browser.

Paste JSON and this tool validates it, then pretty-prints it with the indentation you choose or minifies it to one line. Keys can be sorted alphabetically. When the JSON is invalid it shows the line and column where parsing stopped. Nothing is uploaded: the formatting runs in your browser.

## FAQ

### Is my JSON sent anywhere?

No. The page parses and formats the text with your browser’s own JSON parser; there is no request to a server while you use it.

### Why does valid JavaScript fail as JSON?

JSON is stricter than a JavaScript object literal: keys and strings need double quotes, trailing commas are not allowed, and there are no comments, undefined values, NaN or Infinity.

### Does sorting keys change the data?

No. Object key order carries no meaning in JSON, so sorting only changes how the document reads. Array order is kept exactly as it was.

### How large a document can it handle?

The limit is your browser’s memory, not a server quota. A very large document takes longer to display than to parse.

Page: https://upapi.io/tools/json-formatter · Updated 2026-10-21.
