← All tools/Minifiers/Code/JSON Formatter

JSON Formatter

Readable JSON, in your browser — paste JSON in, formatted or minified JSON out, with errors explained.

Paste JSON here. Choose Pretty or Compact below; errors are shown, never hidden.

Result

—

How it works

Pretty = JSON.stringify(value, null, 2)
Compact = JSON.stringify(value)
Invalid JSON = the parser error, shown as-is

Worked example: the sample in Pretty mode becomes a 6-line indented object starting with "name": "WhiteUI", and in Compact mode it becomes {"name":"WhiteUI","tools":["EMI Calculator","SIP Calculator"],"free":true,"tools_count":2} — same data, no spaces. An input like {oops} is not valid JSON, so the tool shows the parser error instead of a result.

Frequently asked questions

Is my JSON sent anywhere?

No. Everything runs in your browser. Nothing is uploaded, stored or logged.

Why does it say my JSON is invalid?

Usually a missing quote, a trailing comma, or single quotes instead of double quotes. The error message names the position, so fix that spot and paste again.

Does formatting change my data?

No. Pretty and Compact are two views of the same parsed value; keys, values and order are preserved, only whitespace changes.

Can it handle very large JSON?

Yes, up to what your browser can hold. For files of many megabytes, a desktop editor is more comfortable, but the maths is identical.

More tools

Tell us what you think

Loving this tool, or stuck on something? Tell us — it takes a minute.

We’ll only use your name and email to reply if needed. The tool and page are filled in for you.