JSON Formatter

Format and validate JSON

Output format settings
Indent

Paste JSON to see the formatted result.

JSON data
Formatted result
Read-only

What is JSON Formatter?

Paste JSON to see the formatted result and syntax status at the same time. If there is an error, its position is shown so you can fix it; once the JSON is valid, you can adjust the output and take it with you.

Use it to inspect API responses, tidy config files, or compress JSON before sending.

How to Use

The formatted result and error status update as you type. Switch the output format, indentation, or key sorting as needed.

Main Settings

Output Format

Choose Format when readability matters, or Minify to remove indentation and line breaks before sending.

Indent

When formatting, choose 2 spaces, 4 spaces, or a tab for each level. Matching your project's convention keeps diffs consistent. Minified output ignores this setting.

Sort Keys

Sort object keys from A to Z, including nested objects. Array order is unchanged. Useful for normalizing a config file before saving.

Use Cases

  • Following nested data in an API response
  • Aligning key order and indentation in a config file before saving
  • Compressing JSON before sending to reduce payload size
  • Catching JSON syntax errors before deployment

How to Read Errors

When the JSON has an error, the cause and line/column are shown 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

Frequently Asked Questions

What can the automatic repair fix?

It targets trailing commas, single quotes, comments, unquoted keys, full-width symbols, and values such as NaN or Infinity. It cannot fix every error; if repair is not possible, use the line and column to edit the JSON manually.

Why does 1.0 become 1?

Both represent the same JSON number, so the output uses 1. If you need to keep the text 1.0, treat it as a string.

Does it check values against an API schema?

No. This tool focuses on syntax. Value meaning and API compatibility need to be checked separately.

Things to Keep in Mind

  • Applying a repair replaces the input. Copy the original JSON first if you need to keep it.
  • Large integers are handled as JavaScript numbers, so values such as 9007199254740993 may be rounded in the output.