Format and validate JSON
Paste JSON, make it readable or compact, and find out instantly if it is valid.
Loading the tool… If nothing appears, please enable JavaScript.
What this tool does
The JSON Formatter checks that your text is valid JSON and rewrites it in a clean, indented layout that is easy to read. A second button minifies it, removing all extra spaces and line breaks to make it as short as possible for use in code or requests.
It is useful when you are reading an API response, checking a configuration file, or tidying data before you share it.
How to format JSON
- Paste your JSON into the JSON Input box.
- Click Format JSON for a readable version (indented with four spaces), or Minify JSON for the compact version.
- Select the result and copy it, or use the Copy button.
- If the text is not valid JSON, you will see an error message instead.
Common reasons JSON is invalid
- A trailing comma after the last item in an object or list.
- Single quotes instead of double quotes around keys and text.
- Unquoted keys, such as {name: "Ann"} instead of {"name": "Ann"}.
- Comments. JSON does not allow // or /* */ comments.
Tips for better results
- Format first, then read: indentation makes mismatched brackets much easier to spot.
- Minify only the final copy you actually send or store; keep a formatted version for editing.
- Large JSON files can slow a browser tab, so split very big files when you can.
Privacy: what happens to your data
This tool runs in your browser, so the content you enter stays on your device and is not sent to Tantool's servers. See the Privacy Policy for the full picture.
Even so, avoid pasting live passwords, API keys or personal data into any online tool; use sample data when you can.
Limitations to know about
- Errors say that the JSON is invalid but do not point to a line or column.
- Only strict JSON is accepted; relaxed formats such as JSON5 or JSON with comments are not.
- The output is plain text, with no collapsible tree view or syntax colouring.
- Keys are kept in their original order; there is no sorting option.
Frequently asked questions
What is the difference between format and minify?
Formatting adds indentation and line breaks to make JSON readable. Minifying removes them to make the text as small as possible. The data itself is identical.
Why does my JSON say invalid?
Look for trailing commas, single quotes, unquoted keys or comments, which are the most common causes.
Is my data uploaded?
No. The JSON is parsed in your browser and is not sent to Tantool.