Everything runs on your machine — your file is processed right here in your browser and never uploaded to any server.
InputJSON
Loading...
OutputJSON
Loading...

About this tool

This formatter takes dense or minified JSON and pretty-prints it into cleanly indented output you can actually read. Paste into the left editor and the formatted version appears in the right editor immediately; the toolbar dropdown switches the indentation between 2 spaces, 4 spaces, and tabs, re-rendering the output the moment you change it.

The parser is deliberately forgiving. It accepts relaxed JSON5-style input — single-quoted strings, trailing commas, and comments — the kind of almost-JSON found in hand-edited config files and copied code snippets, and it always emits strict, standards-compliant JSON. Typical jobs include making an API response readable before debugging, tidying a configuration file, expanding a one-line log payload, and preparing JSON for a code review.

How to use

  1. Paste your JSON into the left editor, or click Load File to open a .json file from your computer.
  2. Select 2 spaces, 4 spaces, or tabs from the toolbar dropdown to control the indentation.
  3. The formatted output appears instantly on the right and reflows whenever you edit the input or change the indent setting.
  4. Click Copy to put the result on your clipboard, Download to save it as a file, or Clear to reset.

JSON frequently contains the most sensitive data a developer handles — API responses, tokens, customer records — and none of it should have to transit a third-party server just to be re-indented. Here the parsing and printing execute as local JavaScript inside your own tab, so the site has no way to observe what you format.

Frequently asked questions

Does formatting change the order of my keys?

No. Keys are emitted in exactly the order they appear in your input, and no values are altered, added, or removed. The only changes are whitespace and the normalization of relaxed syntax into strict JSON.

Why does this tool accept JSON that other parsers reject?

It reads the relaxed JSON5 dialect, which permits comments, single quotes, and trailing commas — conveniences that strict JSON forbids but that show up constantly in real-world files. Whatever it accepts, it always writes back out as standard JSON that any parser will take.

Which indentation setting should I pick?

Two spaces is the common convention in the JavaScript ecosystem, four spaces reads more clearly in deeply nested documents, and tabs keep the file smaller while letting every editor display them at whatever width the reader prefers. The choice is purely cosmetic — all three produce equivalent JSON.