JSON Formatter & Validator
Paste JSON to format, minify or check it for errors. Everything happens on your device, so it is safe for API keys and private data.
Ctrl+Enter to format
OUTPUT
{
"site": "tool-kit.space",
"free": true,
"categories": [
"video",
"images",
"pdf",
"text",
"developer",
"calculators"
],
"tool": {
"name": "JSON formatter",
"runsIn": "browser",
"uploads": 0
}
}What this JSON formatter does
Format turns one long line of JSON into readable, indented text. Pick 2 spaces, 4 spaces or tabs.
Minify strips all the whitespace for the smallest possible payload, ready to paste into a config file or an API request.
Validate checks the JSON while you type. When it doesn't parse, you see what is wrong and on which line, for example a missing comma, a trailing comma or a key without quotes.
Common JSON mistakes
JSON is stricter than JavaScript. These are the errors people run into most:
- Trailing commas, as in
[1, 2, 3,]. JSON doesn't allow a comma after the last item. - Single quotes. Strings and keys need double quotes:
"name", not'name'. - Comments. JSON has no
//or/* */comments. Remove them before parsing. - Unquoted keys, as in
{name: "Ada"}. Every key must be a string in double quotes.
How to format JSON
- 1
Paste your JSON
Paste it into the input pane, or press Sample to try the tool with example data.
- 2
Pick Format or Minify
Format indents it with 2 spaces, 4 spaces or tabs. Minify puts it all on one line.
- 3
Copy or download
Copy the result to your clipboard or save it as a .json file.
Frequently asked questions
Is my JSON sent to a server?
No. Formatting runs in JavaScript on your device. You can even turn off Wi-Fi and it keeps working.
How large a file can it handle?
It depends on your device's memory. Files of a few megabytes format instantly on a normal laptop. Very large files can take a few seconds.
Does it fix broken JSON?
It points to the error and the line it is on, so you can fix it yourself. It never changes your data without asking.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so people can read the JSON. Minifying removes all of that to make the file as small as possible, which is what you send over a network.