JSON Formatter
Format and validate JSON
Paste JSON to see the formatted result.
What is JSON Formatter?
JSON Formatter is a tool for making JSON strings easier to read while also helping you check for syntax errors. It is useful when you want to inspect an API response, tidy up a config file, or quickly verify whether pasted JSON is valid.
The tool formats the input automatically and shows the error location with line and column when the JSON cannot be parsed. It works well for quick browser-based checks during debugging or data inspection.
How to Use
- Paste a JSON string into the input area.
- Review the formatted output.
- Change the output format, indentation, or key sorting if needed.
- If an error appears, use the displayed line and column to fix it. When the repair button is shown, use it to fix the input.
Main Settings
Output Format
You can choose from two output styles:
- Format: Adds line breaks and indentation for readability
- Minify: Compresses the result into a single line without whitespace. Useful before sending JSON somewhere.
Number notations such as 1.0 are normalized the way JSON writes numbers.
Indent
When you use the formatted output, you can choose 2, 4, or a tab as the indentation width. Pick the one that matches your project's formatting rules. This setting has no effect on minified output.
Sort Keys
When turned on, object keys are reordered from A to Z at every level. Array order never changes. Useful for normalizing a config file before saving it.
Use Cases
- Inspecting API responses in a readable format
- Tidying config files or example JSON data
- Expanding minified JSON back into something readable
- Compressing JSON into one line before sending it
- Doing a quick syntax check before using JSON elsewhere
What to Check When an Error Appears
When the input has an error, the cause is shown with line and column instead of the result. Common causes are:
- Whether strings use double quotes
- Whether there is an extra trailing comma
- Whether an object or array is missing a closing bracket
- Whether keys and values are separated correctly with a colon
Common slips such as trailing commas, single quotes, or comments can be fixed with the repair button. Applying the repair replaces the input, so the result can be checked and adjusted in place. If the error cannot be repaired, fix it by hand using the displayed position.
This tool mainly helps with syntax problems. It does not tell you whether the values themselves make sense for a specific API or schema, so that part still needs to be checked separately.
Input and Output Example
{ "name": "Taro Tanaka", "age": 30, "hobbies": ["reading", "traveling"] }When you paste a one-line JSON string like this, the tool reformats it as:
{
"name": "Taro Tanaka",
"age": 30,
"hobbies": [
"reading",
"traveling"
]
}Last updated:

