JSON formatter

Paste JSON to check it, prettify it with the indentation you like, or minify it to a single line.

How it works

The text is parsed with the browser’s strict JSON parser. If it is valid it is printed again with JSON.stringify and the indentation you choose; “minify” removes every space outside strings. Errors are reported with the line and column of the first problem.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser with JSON.parse, and the JSON is not put into the page link.

Why is my JSON invalid?

The usual causes are trailing commas, single quotes instead of double quotes, keys without quotes, and comments. JSON allows none of them. The error message shows the line and column.

What does sorting keys do?

It orders the keys of every object alphabetically, which makes two JSON documents easier to compare. Arrays keep their order.