JSON Formatter
Pretty-print JSON with 2 spaces, 4 spaces or tabs, or squeeze it onto one line. Sort keys if you like. Errors point to the exact line and column.
JSON Formatter turns cramped or messy JSON into neatly indented text with 2 spaces, 4 spaces or tabs, or minifies it onto one line. It can sort keys, keeps every number exactly as written, and points to the line and column of any error.
What does a JSON formatter do?
Beautify
Adds line breaks and indentation so each key and value sits on its own line and nesting is easy to follow. The data itself does not change.
Minify
Removes every space and line break that JSON does not need, which makes the text smaller for sending over a network or storing in a config field.
Why use JSON Formatter?
- Read API responses. A one-line response from a server becomes a structure you can scan by eye in a second.
- Numbers stay exact. Long IDs such as 12345678901234567890 and values such as 1.50 come out exactly as they went in, which many formatters quietly round.
- Private. Formatting happens in this tab, so tokens, customer records and config files are never uploaded.
How to use JSON Formatter, step by step

- Paste your JSON into JSON Formatter. Or press Try an example to see it work.
- Choose a layout. Pick 2 spaces, 4 spaces, tabs or minified, and tick Sort keys if you want them in A to Z order.
- Copy or download. The result updates as you type. If the JSON is broken, the message names the line and column to fix.
Frequently asked questions
Why does it say my JSON is invalid?
Common causes are a trailing comma after the last item, single quotes instead of double quotes, comments, or a missing comma between items. The error message shows where the first problem is.
Does sorting keys change my data?
No. Objects in JSON have no meaningful key order, so sorting only changes how it reads. Array order is never changed.
Is there a size limit?
No fixed limit. Several megabytes format quickly on a normal laptop because nothing is sent anywhere.
Looking for the long version? The guides cover each of these jobs in depth.