JSON Formatter & Validator
Paste JSON to make it readable, shrink it, or find out exactly where it is broken.
Paste JSON to format, minify or validate it.
How to use the JSON formatter
- Paste your JSON into the left box, or open a .json file.
- Choose Format to make it readable or Minify to remove all extra spaces. Pick the indent size and, if you like, sort the keys.
- If the JSON is valid you see a green message with the number of keys. If not, the message shows the line and column of the problem.
- Copy the result or download it as a .json file.
About this tool
JSON is the most common format for sending data between websites, apps and APIs. Machines do not mind if it is squeezed onto one line, but people need indentation to read it. This formatter adds the indentation for you, and the minify option does the opposite to save space.
The validator reads your JSON the same way a web browser does, so if it passes here it will be accepted by JavaScript’s JSON.parse. Everything happens in your browser, which means API responses, configuration files and other private data are never uploaded.
Frequently asked questions
Why does it say my JSON is invalid?
The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, comments, and a missing comma or bracket. The error message shows the line and column where parsing stopped, which is usually at or just after the real mistake.
What does Sort keys do?
It sorts the keys of every object alphabetically, at all levels. The order of items inside arrays is not changed. This makes two JSON files easier to compare.
Are very large numbers safe?
Numbers with more than about 15 digits can lose precision, because they are read as standard JavaScript numbers. If your data has long IDs, keep them as strings in the JSON.
Is my JSON uploaded anywhere?
No. Formatting and validation run entirely in your browser.