JSON Formatter / Validator

Paste messy JSON to validate it with precise error locations, then pretty-print or minify — all in your browser.

From a wall of JSON to something readable

APIs and log pipelines love emitting JSON as a single line. This tool parses your input with the same strict rules as JSON.parse, then re-emits it either formatted (2 spaces, 4 spaces or tabs — your choice, remembered for next time) or minified for production payloads, with a live "% smaller" readout. The optional sort keys mode orders every object's keys alphabetically — invaluable when you need to diff two JSON blobs.

Validation with real error locations

When JSON is invalid, the browser normally tells you little more than "Unexpected token". This validator converts the parser's character offset into a line and column number and shows the offending line, so you can jump straight to the trailing comma, unquoted key, or stray single-quote that broke it.

FAQ

Why is my JSON invalid when it works in JavaScript?

JSON is stricter than JavaScript object literals: keys must be double-quoted, strings must use double quotes, and trailing commas, comments, undefined and NaN are all forbidden. The usual suspects are trailing commas and single-quoted strings.

Does formatting change my data?

No — only whitespace (and key order, if you enable sort keys). Values, numbers and strings are preserved exactly as the parser understood them. Note that like every JSON tool, numbers beyond 253 lose precision because JavaScript parses them as floats.

Is my JSON uploaded anywhere?

No. Parsing and formatting run entirely in your browser — paste production payloads without worry, and verify in the network tab that nothing is transmitted.

Built by Abasthan Cloud

Free tools are just the start

Deploy your next app on bare-metal cloud with per-second billing — your first app is free, no credit card required.