The free online JSON formatter beautifies, minifies and validates JSON, with a tree view and a clear line and column for any error. Because it runs in the browser, the JSON is never uploaded.
Developer tools by OnlinePCApps since 2013
A minified API response is one long line, and a broken payload fails without saying where. The free online JSON formatter makes it readable and points to the exact error.
An API response or a webhook body often arrives minified, one dense line with no spacing. Beautifying it adds indentation and line breaks, so the nesting and the shape of the data become clear at a glance.
A trailing comma or a missing quote breaks a whole payload, and a plain parser only says it failed. Validating points to the line and column of the problem, so the one bad character is found rather than hunted for.
A JSON payload often carries a token, a key or real user records, none of it meant for an outside server. The formatting runs in the browser, so the payload stays on the device rather than being pasted into a hosted tool.
Paste the JSON into the panel above, or drop a .json file. An API response, a config, a webhook body or any JSON text is read on the device as it goes in.
Beautify with a 2-space, 4-space or tab indent. Minify to one compact line, or validate to check it is well formed. A tree view collapses the nesting, and any error shows its line and column.
Copy the formatted JSON to the clipboard, or download it as a .json file. The input stays untouched, so the same JSON can be beautified or minified again at any time.
To format JSON is to tidy, validate or compact the same data. The tool does that on the device.
The JSON is pretty-printed with a 2-space, 4-space or tab indent, so the nesting reads clearly. Only the whitespace changes, since the parse then re-serialise keeps every key and value exactly as it was.
Minifying strips every space and newline to the most compact valid JSON, the form a production payload ships in. The structure is untouched, so it parses to exactly the same data as the pretty-printed version.
The parser checks the JSON against the strict standard and reports the line and column of the first problem, such as a trailing comma or a missing quote. A valid payload is confirmed, and a broken one is pinned to its exact spot.
A tree view collapses and expands each level, so a deep object is explored one branch at a time. Keys can be sorted for a stable order, while the default keeps the members in the order they arrived.
To format JSON, to beautify a payload and to validate a config all name the same tool. A search for JSON formatter or JSON validator reaches this page, and the input is left as it is.
JSON has a strict grammar, and formatting tidies without changing the data. These points decide the result.
| The case | Result | What happens and why |
|---|---|---|
| Beautify | 2, 4 or tab | Pretty-prints with the chosen indent, changing only the whitespace. |
| Minify | one line | Strips every space and newline to the most compact valid JSON. |
| Validate | line, column | Reports the exact spot of the first error against the strict grammar. |
| Data types | six only | String, number, boolean, null, object and array only. |
| Strict rules | RFC 8259 | Double-quoted keys, no trailing comma and no comments in standard JSON. |
| JSON5 | rejected | Single quotes, trailing commas and comments are flagged, not accepted. |
| Big numbers | precision | An integer beyond the safe range can lose precision as a 64-bit float. |
| Duplicate keys | deduplicated | A repeated key is collapsed to the last value on the parse round trip. |
| Where it runs | on the device | The JSON is formatted in the browser, so nothing is uploaded. |
How JSON Formatting Works
JSON, short for JavaScript Object Notation, is a text format for data made of six building blocks: a string, a number, a boolean, null, an object and an array. It came out of work by Douglas Crockford and is now fixed by two standards that agree, RFC 8259 and ECMA-404. Formatting does not change the data, only its shape on the page. The tool parses the text with the browser's native JSON.parse and then re-serialises it, with an indent for a beautify or with none for a minify, so the same payload reads clearly or ships compact. The strict grammar is where the honest points live. Standard JSON needs double-quoted keys, allows no trailing comma and permits no comment, which is exactly why a payload copied from JavaScript often fails to validate. Those relaxed features belong to JSON5, a separate superset this tool rejects rather than quietly accepts. Two more points are worth stating. A number beyond the safe integer range can lose precision, since JSON numbers ride on a 64-bit float, and a duplicate key is collapsed to its last value when the data round-trips through the parser. The references below define the standard.
Both format JSON. The trade is between a quick visual tidy and a scriptable query engine.
| Point of comparison | This tool Formatted in the browser On the device | The command line A local terminal tool |
|---|---|---|
| Where the payload goes | Stays in the browser | Stays on the machine |
| Price and caps | Free with no file cap | Free tier often capped |
| A multi-gigabyte file | Bound by tab memory | Streams from disk |
| Query and transform | Format and validate here | jq filters and reshapes |
| A quick tidy or check | Paste, see the tree, done | A filter to write first |
jq on the command line wins for a multi-gigabyte file or a query that filters and reshapes the data in a script. This page wins for a fast beautify, minify or validate with a tree view and no install. Both keep the payload local.
The JSON is parsed and re-serialised inside the browser by the native JSON.parse and JSON.stringify, so the work is client-side and the payload stays on the machine that opened it. Nothing is handed to a server to format it.
A JSON payload often carries an access token, an API key or real user records never meant for an outside server. A hosted formatter has to receive all of that on upload, needless exposure when the browser can tidy it locally.
Each of these formats JSON. They vary in reach, in effort and in where the payload goes.
jq, an editor and a code console all format JSON, yet each needs a query language, an open file or the terminal. This page beautifies, minifies and validates with a tree view, kept local with nothing to set up.
A little context saves a puzzling error.
Standard JSON allows no trailing comma, no comment and no single quotes. Those are JSON5 features, and pasting them in will flag an error. Remove the non-standard syntax first, then format the strict JSON that is left.
A JSON number rides on a 64-bit float, so an integer beyond the safe range, such as a long ID, can lose precision on a round trip. Where an exact big number matters, carry it as a string rather than a number.
Standard JSON does not forbid a repeated key, but a parser keeps only the last one. So a beautify silently drops the earlier duplicate, which is worth knowing if a payload was built with a key written twice.
The browser formats a payload that fits a tab in memory, which suits most debugging. A multi-gigabyte file, a folder of JSON or a query that filters the data belongs on jq or the desktop edition, which reads from disk and works across the whole set.
A multi-gigabyte file is streamed from disk and formatted, past what a browser tab keeps in memory at once.
jq filters, maps and reshapes the data with a query, far past what a beautify or a minify does on its own.
A format or validate step runs inside a build or a hook, so a payload is checked automatically, ready for a repeated workflow.
Free and online, with no sign-up and no upload. Beautify, minify or validate JSON in the browser, all on the device.