JSON Formatter & Validator
Paste messy JSON and get it back clean, indented and validated. If something is wrong, you get the exact line and column, not a vague "unexpected token".
- Free
- No sign-up
- Runs in your browser
Everything runs in your browser. What you type here is never uploaded, stored or sent anywhere.
What does a JSON formatter do?
JSON is the format most APIs, config files and web apps use to pass data around. It is meant for machines, so it often arrives as one long unreadable line. A JSON formatter (also called a beautifier or pretty printer) adds line breaks and indentation so you can actually read it.
This one also validates as you go. JSON is strict: keys need double quotes, a trailing comma is an error, and comments are not allowed. When your input breaks one of those rules, the tool tells you which rule and where, so you can fix it in seconds instead of hunting through a wall of text.
Need the opposite? Minify strips every space and line break, which is handy before you store JSON in a database field or send it in a request. Working with spreadsheets instead? Try the CSV Converter.
How to format JSON online
- Paste your JSON into the input box, or click Load sample to see how it works. You can also open a
.jsonfile. - Pick an indent size. Two spaces is the common default; choose Sort keys if you want the keys in alphabetical order.
- Click Format to beautify, or Minify to compress to one line.
- If the JSON is invalid, the message under the boxes shows the line and column. The cursor jumps to that spot in your input.
- Click Copy or Download to take the result with you.
Where people use it
- Reading an API response copied from the browser Network tab or a tool like Postman.
- Cleaning up a
package.json,composer.jsonortsconfig.jsonbefore committing it. - Finding the one missing comma in a JSON config that refuses to load.
- Minifying JSON before storing it in a database column or sending it in a request.
- Sorting keys so two JSON files are easier to compare in a diff.
Frequently asked questions
How do I find the error in my JSON?
Paste it in and press Format. If the JSON is invalid, the tool shows the problem in plain English with the line and column, and moves the cursor to that position. The usual suspects are a trailing comma, single quotes instead of double quotes, an unquoted key, or a missing comma between two items.
Is my JSON uploaded anywhere?
No. Formatting and validation run entirely in your browser with JavaScript. Nothing you paste is sent to a server or saved, so it is safe to use with API responses and config files. Still, avoid pasting live passwords or secret keys into any website.
Why does JSON not allow comments or trailing commas?
The JSON standard (RFC 8259) does not include them. Some tools accept a relaxed version called JSON5 or JSONC, but strict parsers will reject it. This tool validates against the strict standard, which is what most APIs and JSON.parse expect.
What is the difference between format and minify?
Formatting adds indentation and line breaks to make JSON readable. Minifying removes all the extra whitespace to make it as small as possible. The data inside is identical either way.
Can it handle large numbers without losing precision?
JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 can lose precision when parsed. If your JSON contains very large IDs, keep them as strings. The tool warns you when it spots a number that cannot be represented exactly.
How large a file can I paste?
A few megabytes works fine on a normal laptop. Very large files (tens of MB) may slow your browser, because everything is processed locally.
