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, validate, and minify JSON in your browser with copyable output and parser error messages.
Paste JSON to format or minify it locally in your browser.
Your formatted or minified JSON will appear here.
This JSON formatter parses the text in your browser before producing either readable, two-space-indented JSON or compact JSON without extra whitespace. Invalid input shows a clear error and its line and column when available, while valid output can be copied or downloaded for APIs, configuration files and application data.
Each action starts with the same browser JSON parser, but the output serves a different task.
| Task | What this tool does | When to use it |
|---|---|---|
| Format | Parses the input and writes it with two-space indentation | Reading API responses, configuration and nested data |
| Validate | Reports a clear error and its line and column when available | Checking syntax before using a payload or file |
| Minify | Parses 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 |
Important: this tool uses JavaScript JSON.parse and JSON.stringify. Numeric literals outside JavaScript’s safe integer range (±9,007,199,254,740,991) may lose precision when parsed. Keep very large identifiers as quoted strings if their exact digits must be preserved.
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 two-space indentation and line breaks for readability. Minifying removes unnecessary whitespace and writes the parsed JSON as compact text.
Both Format and Minify first pass the input to the browser JSON parser. Valid input produces output; invalid input displays a clear error and its line and column when the browser provides a 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.
Normal JSON structures and values are re-serialised, but whitespace, escape forms and number notation may change. Very large numeric literals may also lose precision because JavaScript parses them as Number values.
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.