What is a JSON formatter?
A JSON formatter parses JSON text and rewrites it with consistent indentation and line breaks. This makes nested objects and arrays easier to read without adding new data.
Tools
Format and validate JSON, explore nested data in a tree, or search the output. Copy or download the result without uploading your data.
Formatting, validation, tree view and search run locally in your browser. This tool does not upload or store your JSON, and analytics never include its contents.
Paste up to 1,000,000 characters. Processing stays in this browser.
Format or minify valid JSON to see the result.
This browser-based JSON formatter validates and rewrites JSON with two spaces, four spaces or tabs, or minifies it without extra whitespace. It preserves numeric literals exactly, including integers beyond JavaScript’s safe range. Search the line-numbered, syntax-highlighted output or inspect nested data in a collapsible tree, then copy or download the complete result.
Each action starts with the same local JSON validator, but the output serves a different task.
| Task | What this tool does | When to use it |
|---|---|---|
| Format | Validates the input and writes it with two spaces, four spaces or tabs | Reading API responses, configuration and nested data |
| Validate | Reports the error line and column and can select that position in the input | Checking syntax before using a payload or file |
| Minify | Validates the input and writes compact JSON without indentation | Reducing unnecessary whitespace before copying data |
Standard JSON syntax is stricter than a JavaScript object literal. These inputs will fail to parse.
| Problem | Invalid example | What to check |
|---|---|---|
| Single quotes | {'name':'Ada'} | Use double quotes around strings and object keys |
| Unquoted key | {name:"Ada"} | Put every object key in double quotes |
| Trailing comma | {"ok":true,} | Remove the comma after the final item |
| Comment | {"ok":true // note} | Remove // and /* */ comments |
| Missing separator or bracket | {"a":1 "b":2} | Check commas, braces, brackets and closing quotes |
Large-number safety: this tool validates JSON tokens and only rewrites whitespace. It does not convert numeric literals to JavaScript Number values, so unquoted large integers, decimals, exponents and negative zero keep their original digits and notation.
Formatting, minifying and parsing run in this browser. This tool does not send the JSON you paste to a server for conversion.
Avoid pasting production secrets into any browser tool unless your organisation permits it. Browser extensions, screen sharing and copied output remain outside this tool’s control.
A JSON formatter parses JSON text and rewrites it with consistent indentation and line breaks. This makes nested objects and arrays easier to read without adding new data.
Formatting adds line breaks with your choice of two spaces, four spaces or tabs. Minifying removes unnecessary whitespace and writes compact JSON.
Both Format and Minify use a strict JSON tokenizer and parser in your browser. Invalid input displays the error line and column, with a button that selects the relevant position.
They are not valid JSON syntax. JSON requires double-quoted strings and keys, does not allow a comma after the final item, and does not support comments.
Yes. The formatter only changes whitespace between JSON tokens. String escapes, duplicate keys and numeric notation are kept as entered, including unquoted integers beyond JavaScript’s safe range.
No. Formatting, minifying and parsing happen in your browser, and this tool does not send the pasted JSON to a server for conversion.
Continue checking encoded values, token payloads and dates found in your JSON or API response.