Tool Logo

JSON Formatter

Turn minified or messy JSON into clean, indented, readable JSON.

0 characters

Loading tool…

How to use the json formatter

Paste JSON from a log, an API or a minified file and get it back neatly indented. Choose 2, 4 or 8 spaces or tabs, and sort object keys alphabetically if you want a stable order for diffs and reviews. Invalid JSON is reported instead of formatted, so the output is always valid.

  1. Paste or upload your JSON.
  2. Pick the indentation (2, 4 or 8 spaces, or tabs) and choose whether to sort keys.
  3. Copy the formatted JSON.

When to use it

  • Reading API responses

    Expand a one-line response so you can see its structure.

  • Code reviews and diffs

    Sort keys so two versions of a file line up when compared.

  • Documentation

    Paste readable, consistently indented examples into docs and tickets.

Frequently asked questions

What is the difference between a JSON formatter and a validator?

A validator only tells you whether the JSON is valid. The formatter also rewrites valid JSON with clean indentation; if the input is invalid it shows the error instead.

Does formatting change my data?

No. Only whitespace changes, plus key order if you turn on sorting. Values, types and array order stay exactly the same.

Which indentation should I use?

Two spaces is the most common choice for JSON files and APIs. Use four spaces or tabs if that matches your project's style.

Why sort keys?

Sorted keys give every object a predictable order, which makes diffs and code reviews easier. Arrays are never reordered.

Is my JSON uploaded?

No. Everything runs in your browser; nothing you paste or upload is sent to our servers.