Format & validation

JSON Formatter

Beautify and indent JSON with optional key sorting — entirely in your browser.

JSON input

Settings

Output

Result appears here after you select

{ } How to use

  1. Paste or type your JSON in the input box.
  2. Choose an indentation and whether to sort keys.
  3. Select Process, then copy or download the formatted result.

{ } How it works

JSON Formatter works on the text you provide. Adjust the options, then select Process ▸ and it runs entirely in your browser — nothing is uploaded to a server — then shows the result in the Output panel.

Inputs

  • JSON input — paste or type your input in the left panel (use Sample for an example)
  • Indentation — choose one — 2 spaces, 4 spaces, Tab (default: 2 spaces)
  • Sort keys — on/off toggle (default: off)

Output

JSON — copy it, download it, or switch the Output panel to Tree view to explore it.

{ } Common uses

  • Make a minified API response readable before you debug it.
  • Apply one indentation style across a project’s config files.
  • Sort keys so two versions of the same document can be compared line by line.

{ } Limitations

  • The input must be valid JSON. Formatting re-serializes the parsed document, so a syntax error is reported with its line and column instead of being formatted — run JSON Repair first if the input is broken.
  • Comments and trailing commas are not part of JSON and are rejected rather than preserved.
  • Sort keys reorders keys at every level, including inside arrays of objects. The order of an array is never changed.

{ } FAQ

Is my data uploaded to a server?

No. Everything runs locally in your browser — your files never leave your device.

Can I process more than one file at once?

This tool works on one input at a time.

Is this tool free?

Yes — it’s completely free and needs no sign-up.

Does formatting change my data?

No. Only the whitespace between tokens changes. Turning on Sort keys reorders keys, which changes the text but not a single value.

Which indentation should I choose?

Two spaces is the common default for JSON and what most linters expect. Choose Tab if your project stores tabs, or 4 spaces to match the surrounding code.

{ } Guides