JSON Formatter and Validator
Paste an API response or config file and it is checked as you go. When something is wrong you get the line, the column and a plain explanation, which saves a lot of scrolling through long payloads.
Your JSON never leaves the browser, so it's fine to inspect data that contains tokens or customer records.
Your files and text are processed only in this browser. Nothing is uploaded or stored on a server.
How to use
- Paste JSON or open a .json file (up to 20 MB).
- If an error appears, jump to the reported line and column and fix it.
- Choose 2 spaces, 4 spaces or tabs to beautify, or minify it.
- Copy the result or download it as a file.
Features and limits
- Validation follows strict JSON (RFC 8259): comments and trailing commas are reported as errors.
- Error messages name the cause, for example a missing comma, a trailing comma, an unquoted key or an unterminated string.
- Minify removes all insignificant whitespace and line breaks.
- "Sort keys" orders object keys alphabetically at every nesting level.
FAQ
Why is my JSON invalid when it works in JavaScript?
JavaScript object literals allow single quotes, unquoted keys, comments and trailing commas, but JSON does not. The error message points to the first place where your text breaks those rules.
Does JSON allow comments?
Standard JSON does not. Formats like JSONC or JSON5 do, but this validator only accepts strict JSON, so comments are flagged as errors.
How do I fix "Unexpected token" errors?
Look just before the reported position. The usual culprits are a missing comma between items, a single-quoted string or a key without double quotes.
How can I compare two JSON documents more easily?
Format both with the same indentation and turn on key sorting. With keys in the same order, a regular diff tool shows only the real differences.