JSON formatter & validator
Paste JSON to beautify it, minify it, sort its keys or find syntax errors with the exact line and column. Your data never leaves your browser.
- Files stay on your device
- Free, no sign-up
- No installation
- Instant results
How to use it
- Paste your JSON, or type it, in the box.
- Press Format to beautify it, Minify to shrink it, or Sort keys to order every object alphabetically.
- If the JSON is invalid, the message shows the line and column and the cursor jumps to the problem.
JSON (JavaScript Object Notation) is the most common format for exchanging data between web services, apps and configuration files. It is strict: keys must be wrapped in double quotes, trailing commas are not allowed, and comments are not part of the standard. Most “invalid JSON” problems come from a trailing comma, single quotes instead of double quotes, an unquoted key or a missing bracket.
This tool uses your browser’s built-in JSON parser, so it follows the same rules as JavaScript and most APIs. When parsing fails it tells you the line and column where the parser stopped and selects that spot in the box. Formatting uses 2 or 4 spaces or tabs, minifying removes all whitespace, and sorting keys makes two JSON documents easier to compare.
Large documents are processed locally and nothing is uploaded, so you can safely paste API responses and configuration files. Very large inputs (several megabytes) can make the tree view slow, in which case use Format and the text box instead.
A closer look
Formatting JSON makes nested data readable, and validating it shows the exact line where a bracket, comma or quote is missing. Everything is checked in your browser, so sensitive payloads are not sent anywhere.
Developers often paste sample data into online tools, so a tool that runs locally in the browser, without sending the content to a server, is the safer habit for tokens, keys and customer records.
Frequently asked questions
Why does my JSON say “Unexpected token”?
The parser found a character it did not expect: usually a trailing comma, single quotes, an unquoted key, a missing comma or a stray character before or after the data.
Does this tool upload my JSON?
No. Parsing, formatting and the tree view all run in your browser.
Can JSON have comments?
Not in standard JSON. Remove // and /* */ comments before validating.
What does sorting keys do?
It reorders the keys of every object alphabetically, which makes it easier to compare two documents. Arrays keep their order.
More free tools
A practical example
Paste a sample webhook body using fictional values. Format it to inspect nested objects, then change one bracket to see where the validator reports the error.