Skip to main content
ToolsBay

JSON Formatter

Beautify, minify and inspect JSON with clear syntax errors.

Runs entirely in your browser — nothing is uploaded

Your JSON

1 line

Formatted

1 line

Frequently asked questions

What is the difference between formatting and validating?

Formatting only changes whitespace — the data is identical. Validating checks the document parses at all. This tool does both: if it cannot parse, you get the error and its position; if it can, you get formatted output.

Does formatting change my data?

No. The JSON is parsed and re-printed, so keys, values and array order are preserved exactly. Numbers are re-serialised from their parsed value, so 1.50 becomes 1.5 — the same number, written canonically.

Why does the reported line number look wrong?

A parser reports where it gave up, not where you made the mistake. A brace left unclosed on line 4 is only detected at the end of the document, so the error points at the last line.

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser with the built-in JSON functions, so API responses containing customer data or tokens stay on your machine.

Formatting and minifying JSON

JSON is transmitted minified — no line breaks, no indentation — because every byte counts on the wire. That is the right format for a machine and the wrong one for a person. Formatting adds the structure back so you can see the nesting; minifying strips it again when you need to paste the result into a config or a request body.

The indentation choice is a matter of convention rather than correctness. Two spaces is the JavaScript ecosystem default and what most APIs return. Four is common in Python and .NET codebases. Tabs render at whatever width the reader has configured, which some people prefer for accessibility.

The errors you will actually hit

JSON is strict in ways that JavaScript is not, and almost every failure comes from that gap: a trailing comma after the last element, single quotes instead of double, unquoted keys, or a comment. All four are legal JavaScript and none are legal JSON.

Related: the JSON validator focuses on the error report, JSON to CSV flattens records into a spreadsheet, and JSON to XML converts for systems that need markup. For YAML, use the YAML validator.

All developer tools