How to format JSON online
- Paste your JSON into the input box. It is validated instantly.
- Click Beautify for readable, indented JSON, or Minify to remove all extra whitespace.
- If the JSON has syntax mistakes, click Fix & format to repair common problems automatically.
- Switch to the Tree view to explore nested data, then copy the result.
What is a JSON formatter?
A JSON formatter, also called a JSON beautifier or pretty printer, rewrites a JSON document with consistent indentation and line breaks. It does not change the data, only how it is displayed. Formatting makes API responses, configuration files and logs far easier to read and debug.
Beautify vs minify
Beautify adds indentation and line breaks for humans. Minify removes every unnecessary space and line break to reduce file size, which is useful for network payloads and storage.
Common JSON syntax errors
- Trailing commas:
{"a":1,}is invalid. Remove the last comma. - Single quotes:
{'a':1}is invalid. JSON requires double quotes. - Unquoted keys:
{a:1}is valid JavaScript but not JSON. Keys must be strings. - Comments: JSON does not allow
//or/* */comments. - Missing or extra brackets: every
{and[needs a matching closing bracket.
The validator shows the line and column of the first error, and Fix & format repairs the first four problems automatically.
Example
Input: {name:'app', tags:['api','node',], /* note */ debug:true,}
Fixed: {
"name": "app",
"tags": ["api", "node"],
"debug": true
}
Frequently asked questions
What is a JSON formatter?
A JSON formatter, also called a beautifier or pretty printer, rewrites JSON with consistent indentation and line breaks so it is easy to read.
How do I validate JSON?
Paste your JSON into the tool. It is validated instantly, and if it is invalid the error is shown with its line and column.
What is the difference between beautify and minify?
Beautify adds indentation and line breaks for readability, while minify removes all unnecessary whitespace to make the JSON as small as possible.
What are the most common JSON errors?
Trailing commas, single-quoted strings, unquoted keys and comments are the most common mistakes. They are valid in JavaScript but not in JSON.
Is my JSON uploaded anywhere?
No. Everything runs in your browser, and your data is never sent to a server or stored.