JSON Formatter and Validator
This JSON formatter validates and pretty-prints JSON as you type, shows the exact line and column of any error, sorts keys, minifies, and lets you explore the data in a tree view.
✓ Valid JSON
Need a spreadsheet? Use JSON to CSV.
Everything runs in your browser. Nothing you type is sent or stored.
How to use JSON Formatter
Paste your JSON into the input box.
Choose the indent (2 or 4 spaces, tab, or minify) and whether to sort keys. Errors show the line, column and a pointer.
Copy or download the formatted JSON, or switch to "Tree view" to explore it.
When to use JSON Formatter
- Reading API responses. Turn one long line of JSON into readable, indented text.
- Fixing config files. Find the missing comma or extra bracket quickly.
- Minifying. Make JSON as small as possible before sending it.
Limits and privacy
- Works on the text you paste; very large documents (tens of MB) may be slow.
- Everything runs in your browser. Nothing you type is sent or stored.
Frequently asked questions
How do I validate JSON?
Paste it into the input box. If it is valid, you see "✓ Valid JSON" and the formatted result. If not, the tool shows the error message, the line and column, and the line itself with a ^ under the problem, so you can fix it directly.
Why is my JSON invalid?
The most common causes are a missing comma between items, a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and comments, which JSON does not allow. JavaScript objects often look like JSON but break these rules.
What is minified JSON?
Minified JSON has all unnecessary spaces and line breaks removed, so it is smaller to send and store but hard to read. Choose "Minify" in the indent list to create it, or paste minified JSON and choose 2 spaces to make it readable again.
Related tools
Something not working with JSON Formatter? Report a problem.