JSON Formatter

Validate JSON, format it with indentation or compact it by removing whitespace.

Tool details

Processing and privacy
🔒 Your files never leave your device – processing happens in your browser.
Output format:
JSON

Review your results; support depends on the file and its encoding. How it works and limitations

Validate JSON, format it with indentation or compact it by removing whitespace. ≤1 MB

How to use JSON Formatter

  1. Paste valid JSON text.
  2. Choose two-space pretty formatting or compact output and start processing.
  3. Correct source syntax if an error appears; otherwise review and download formatted.json.

Does formatting JSON also repair invalid JSON?

Paste JSON and choose pretty or compact output. Valid input is parsed in your browser and prepared as formatted.json. Invalid text is not repaired by guessing; correct its syntax before formatting.

Content and tool behavior checked:

Does formatting JSON also repair invalid JSON?
Task / exampleWhat to do
Read nested propertiesChoose pretty output for indentation with two spaces.
Remove formatting whitespaceChoose compact output. Spaces inside string values are preserved.
Preserve a very large identifierRepresent it as a quoted string, for example "9007199254740993", rather than a numeric value.

Input is limited to 1,000,000 UTF-8 bytes. Unsafe integer values are rejected. This is not JSON Schema validation. For duplicate object keys, the parser keeps the last value. Source key order and numeric notation may change.

Continue with a related tool

Frequently asked questions

How to use JSON Formatter

Paste JSON and choose indented formatting or compact output. Invalid JSON and integers that JavaScript cannot represent safely are rejected; store long identifiers as quoted strings in your JSON. Download the result as a .json file.

Link to this answer

Output settings

≤1 MB

Link to this answer

Can I use comments or single quotes?

No. JSON uses double quotes for strings and property names. Comments and trailing commas are invalid; this tool is not a JSON5 parser.

Link to this answer

Does compact mode compress embedded images or long strings?

No. It removes formatting whitespace. String contents are not compressed, and no binary ZIP compression is applied.

Link to this answer

Related tools