JSON is the standard way applications exchange data, but raw JSON is often squashed into one unreadable line. A JSON formatter adds indentation so you can read it, and a minifier does the opposite to save space.
What the tool does
- Format: adds line breaks and indentation.
- Minify: removes extra spaces to make the JSON compact.
- Error check: tells you when your JSON is not valid.
How to use it
- Open the JSON Formatter.
- Paste your JSON into the input box.
- Click Format or Minify.
- Click Copy result.
Common JSON mistakes
- Using single quotes instead of double quotes.
- Leaving a comma after the last item.
- Forgetting quotes around property names.
- Missing a closing bracket or brace.
If the tool reports an error, check these first. Everything runs in your browser, so your data is not uploaded, which is useful when it contains private information.
Try it with the JSON Formatter. You may also like the Base64 tool and the URL encoder.
Common JSON errors and how to spot them
- Trailing commas: a comma after the last item in an object or list is not allowed in JSON.
- Single quotes: keys and strings must use double quotes.
- Unquoted keys: every key must be wrapped in double quotes.
- Comments: JSON does not support comments, so remove them before formatting.
When the formatter reports an error, look at the line it points to and also the line just before it, because a missing comma or bracket is often noticed one line late. Formatting a file before you commit it also makes differences easier to read in code reviews.
Frequently asked questions
What makes JSON invalid?
Common mistakes are trailing commas, single quotes instead of double quotes, and keys that are not wrapped in double quotes.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so people can read it. Minifying removes them to make the data smaller.
Is my JSON sent to a server?
No. It is processed in your browser, so it stays on your device.
More free tools
Why formatting JSON helps
JSON is the common format that websites and apps use to exchange data. When it arrives as one long line it is very hard to read, and a single missing comma or bracket can break the whole thing. A formatter adds indentation so you can see the structure, and the validator points to the place where the problem is.
Common JSON errors
- Trailing comma: a comma after the last item in an object or list is not allowed in JSON.
- Single quotes: keys and text values must use double quotes, not single quotes.
- Unquoted keys: every key must be wrapped in double quotes.
- Missing bracket: every opening brace or bracket needs a matching closing one.
- Comments: JSON does not allow comments, so remove them before validating.
Format or minify?
Use the formatted version while you read or edit data. Use the minified version when you want the smallest size, for example when sending data in a request or storing it in a setting. The two versions contain exactly the same data.
A note on private data
Developers often paste real API responses into online tools. Because this formatter works inside your browser, your data is not uploaded, but you should still avoid sharing passwords, tokens or personal details in any tool when you can remove them first.
More questions and answers
Does formatting change my data? No. Only spaces and line breaks change.
What is the difference between JSON and a JavaScript object? JSON is a strict text format with double-quoted keys, while a JavaScript object is code and is more flexible.
