← All tools Make structured data readable

JSON Formatter

Format or minify JSON, validate its syntax, optionally sort object keys, and copy or download the result.

Format or minify Clear validation errors Paste, upload, copy, or download

JSON input

Paste JSON here or drop a UTF-8 .json file.

Result

Formatted or minified valid JSON appears here.

Document Tools guide

How to use JSON Formatter

Turn compact or uneven JSON into readable structured text, validate its syntax, or create a smaller minified version.

Three simple steps

  1. Paste JSON or load a UTF-8 .json file.
  2. Choose indentation and optional object-key sorting, then format or minify the content.
  3. Review the valid result, copy it, or create and download a JSON file.

Formatting behavior

  • Formatting preserves number and string tokens, duplicate properties, and array order while changing presentation whitespace.
  • Optional key sorting applies recursively to objects but never reorders arrays.
  • Minifying removes presentation whitespace, and invalid JSON must be corrected before any result is created.

Frequently asked questions

Does formatting change JSON values?

It preserves the original JSON tokens and structure while changing whitespace; optional key sorting changes object-property order.

Will Sort object keys reorder arrays?

No. Object properties are sorted recursively, but array items remain in their original order.

Can the tool format JSON with comments or trailing commas?

No. Comments, trailing commas, single-quoted strings, and unquoted property names are not valid JSON and are reported as errors.