JSON QuickFix › JSON formatter and beautifier

JSON formatter and beautifier

Paste minified or messy JSON and press Format to indent it neatly. Choose 2 spaces, 4 spaces or tabs, sort keys A–Z for easier diffs, and switch to the Tree tab to fold and explore large documents.

Input

Paste some JSON, drop a .json file, or load the sample to get started.
Advertisement

How to format JSON

  1. Paste your JSON, drop a .json file on the input, or use Open file.
  2. Pick the indentation: 2 spaces, 4 spaces or tabs.
  3. Press Format. Tick Sort keys to order every object alphabetically.
  4. Copy the result or download it as a .json file.

Tree view for large files

The Tree tab shows objects and arrays as collapsible nodes with item counts, so you can open only the branch you care about. Large arrays are rendered in chunks to keep the page responsive.

If the JSON won't format

Formatting needs valid JSON. If yours has trailing commas, single quotes, comments or Python values, press Quick Fix first; it repairs the syntax and formats the result in one step.

Advertisement

Frequently asked questions

Is 2 or 4 spaces better for JSON?

Both are valid. Two spaces is the most common choice for web APIs and package.json files; four spaces or tabs can be easier to read for deeply nested data.

Does sorting keys change my data?

No. Object key order has no meaning in JSON, so sorting only changes the presentation. Array order is never changed.

How large a file can it format?

Files of several megabytes format in well under a second on a typical laptop, because everything runs locally in your browser.