Free · runs in your browser · no upload · no quota
JSON Formatter & Validator
Paste JSON to pretty-print it with 2 or 4 spaces or tabs, minify it to one line, or sort its keys. If it is not valid, you see what is wrong and the exact line and column. Big numbers and the exact way values are written are kept as they are.
Good to know
Duplicate keys are kept and reported.
JSON with the same key twice in one object is legal but risky: most programs silently keep only the last value. The formatter keeps both and warns you.
Sorting is by key name, A to Z.
Keys are sorted by their character codes, so capital letters come before lowercase ones and digits before both. Arrays keep their order, since their order has meaning.
Large files are fine.
Files of tens of megabytes format in a second or two. Very large outputs are slow to display in a text box; downloading the result is quicker than scrolling it.
How to Format and Validate JSON
- Add your JSON
Paste it into the left box, drop a .json file onto it or click Open file. - Choose the layout
Format indents it for reading, Minify removes all white space. Tick Sort keys A–Z to order every object's keys. - Fix or copy
Valid JSON appears on the right, ready to copy or download. Invalid JSON shows what is wrong and where, so you can fix it on the left.
Example
{"name":"Ana","age":31,"tags":["admin","editor"],"active":true}{
"name": "Ana",
"age": 31,
"tags": [
"admin",
"editor"
],
"active": true
}Frequently Asked Questions
-
How do I find the error in my JSON?The message under the boxes names the problem and its line and column, for example Trailing comma before "}" at line 4, column 1. The most common causes are a comma after the last item, keys or strings in single quotes, comments, and a missing comma between two items.
-
Are comments or trailing commas allowed?Not in JSON. They are allowed in JavaScript and in formats like JSON5 and JSONC (used by VS Code settings), but a strict JSON parser rejects them, so this validator reports them as errors and tells you where they are.
-
Will formatting change my numbers?No. Many online formatters run the text through JavaScript, which rounds 12345678901234567890 to 12345678901234567000 and turns 1.0 into 1. This one keeps every number and string exactly as written and only changes the white space between them.
-
What does Minify do?It removes all spaces and line breaks outside strings, giving the smallest valid JSON. Use it for API requests, config values and anything sent over the network.
-
Is my JSON sent to a server?No. Formatting and validation run in your browser, so API keys, tokens and customer data in your JSON stay on your device.