JSON Formatter & Validator
Validate, prettify and minify JSON, with the exact line and column of any syntax error.
Why use this tool?
Validate, pretty-print and minify JSON from APIs and config files. If the JSON is invalid, you get the exact line and column of the error - a missing comma, quote or bracket.
How to use it
- Paste your JSON.
- Click Format / Prettify or Minify.
- Fix any error at the reported line and column, then copy or download the result.
Format, minify and validate
Formatting (pretty-printing) adds indentation and line breaks so nested objects and arrays are readable. Minifying does the opposite, removing all unnecessary whitespace to make the payload as small as possible for sending over a network or storing. Both keep the data identical.
Validation happens on every format. If the JSON isn't valid, the tool reports the exact line and column where parsing failed, which points you straight at the problem instead of making you scan a long document.
The errors you'll see most
JSON is stricter than JavaScript. Keys and strings must use double quotes ('single' quotes are invalid); there must be no trailing comma after the last item in an object or array; comments aren't allowed; and values like undefined, NaN or functions don't exist in JSON. A missing comma between two items and an unclosed bracket are the other usual culprits.
When the reported position is the very end of the document, something earlier was never closed: count your { and [ against } and ]. Copying JSON from logs can also introduce smart quotes (“ ”) that look right but aren't valid.
Working with large or sensitive JSON
Everything is parsed in your browser, so API responses containing tokens, customer records or internal data never leave your device. That matters: pasting production data into online formatters that upload it is a common source of leaks.
For comparing two versions of a JSON document, format both first and then use the Text & Code Diff Checker; with one key per line, the diff shows exactly which values changed.
Frequently asked questions
Why is my JSON invalid when it works in JavaScript?
JavaScript object syntax allows single quotes, unquoted keys, trailing commas and comments. JSON allows none of these.
Does formatting change my data?
No. Formatting and minifying only change whitespace; keys, values and order stay the same.
Is my JSON uploaded?
No. Parsing and formatting happen entirely in your browser.