How to use JSON formatter and validator
- Paste your JSON into the box.
- Pick 2 spaces, 4 spaces, tabs, or Minify, and whether to sort keys.
- Select Format and validate.
- If there's an error, read its line and column and select Show me to jump to it; otherwise copy or download the result.
Errors you can act on
When JSON is invalid, the tool tells you the line and column of the first problem and what it is in plain words: a trailing comma before a closing bracket, a key in single quotes, a missing comma between two values, a string that never closes, or a list closed with the wrong bracket. Select Show me and the cursor jumps to that spot in your input.
Browsers word their own JSON errors differently, and some only give a character position. This tool runs its own scanner when parsing fails, so the message and position are the same in every browser.
Formatting options
Choose 2 or 4 spaces or tabs for readable output, or Minify to remove every unnecessary space before sending JSON over the network. Sort keys A–Z orders the keys of every object alphabetically, at every level, which makes two versions of a config file easy to compare.
A summary under the button counts objects, arrays and keys and reports how deeply the document is nested, which is a quick sanity check on an API response.
Large files and privacy
Formatting runs in a background worker, so a file of tens of megabytes doesn't freeze the page, and a job that runs past 30 seconds is stopped. Your JSON is kept only in this tab's memory. It is never written to localStorage, never sent to a server, and disappears when you close the tab. That matters when the JSON is an API response with customer data or a config file with keys in it.
Common uses
Reading a minified API response, finding the typo that breaks a config file, checking a webhook payload, preparing test fixtures, or tidying JSON before committing it to a repository.
Limits
JSON with comments or trailing commas, as allowed in some config formats like JSON5 and tsconfig, is reported as invalid, because standard JSON doesn't allow them. Very large numbers beyond JavaScript's safe integer range may lose precision when reformatted.
Questions
- Is my JSON saved or uploaded?
- Neither. It's formatted in a background worker in this tab and kept only in the page's memory. Close the tab and it's gone. Nothing goes to localStorage, cookies or a server.
- How big a file can it handle?
- Tens of megabytes. Formatting runs in a background worker, so the page stays responsive while it works, and it stops after 30 seconds rather than freezing your browser.
- Why does it say my JSON is invalid?
- The message names the first problem in plain words, such as a trailing comma, single quotes, or a missing comma between two values, with its line and column. Fix that one and run it again.