JSON beautifier - format JSON in your browser
JSON on one line is a classic - an API response from a `fetch` call, a monitoring log, a minified config. The beautifier uses Prettier with the json parser. Same as `prettier --write data.json`.
Default: 2-space indent, double quotes (JSON spec requirement, RFC 8259). Aggressive mode for JSON behaves the same as Gentle (JSON has no alternative expanded style).
Accepts `.json`. For JSON5 / JSONC (with comments) - Prettier will accept input, but strict JSON requires no comments and no trailing commas. If your `tsconfig.json` has comments, use our separate JSON formatter tool (it accepts JSONC).
How to use it
- Pick a mode (Gentle / Aggressive / Cosmetic-only) or keep the default.
- Paste your code into the left panel, or use "Upload file".
- Tune settings (gear icon): indent, width, quotes, semicolons.
- Click Format - first click takes a moment (libraries lazy-load).
- On the right you get the output with syntax highlighting - copy, download, or open in new tab.
When this is useful
Five JSON situations:
- DevTools API response. You copied `{"users":[{"id":1,...]}` as one line - beautify, read the structure.
- package.json, tsconfig.json. After manual edits, unify the format before committing.
- GeoJSON, big-data export. Individual objects have thousands of fields - Prettier gives a readable structure.
- OpenAPI / Swagger spec. `openapi.json` often comes one-line from a generator.
- Webhook payload. You captured a Stripe / GitHub webhook log for debugging.