JSON Formatter

About the JSON Formatter

JSON (JavaScript Object Notation) is the de facto data format for APIs, config files, and structured logs — but raw JSON from a minified API response or a log line is often a single unreadable line of text.

This tool validates your JSON and pretty-prints it with proper indentation, or minifies it down to the smallest possible representation, entirely in your browser.

How it works

Common use cases

Frequently asked questions

Why does Format fail with 'Unexpected token'?

This is JavaScript's native JSON parser telling you exactly where the syntax is invalid — common causes include trailing commas, single quotes instead of double quotes, or unquoted object keys, none of which are valid in standard JSON.

Does JSON support comments?

No — the JSON specification has no comment syntax. If you need comments, consider JSON5, JSONC, or YAML (see the YAML ↔ JSON Converter), which do support them.

What's the difference between Format and Minify?

Format adds indentation and line breaks for human readability; Minify removes all non-essential whitespace to produce the smallest possible payload, which is what you'd typically send over the network.

Is there a size limit?

The tool runs entirely in your browser's memory, so very large JSON files (tens of megabytes) may be slow depending on your device, but there's no artificial size cap imposed by the tool itself.

This tool runs entirely in your browser — nothing you enter is sent to a server. Read more in the Privacy Policy, or browse the full list of tools.