BackendBench
Coffee
Free tool

JSON formatter & validator

Paste JSON to validate it, make it readable, shrink it, or sort its keys. Errors point to the exact line and column.

Result

What a JSON formatter is for

API responses and log lines usually arrive as one long line. Pretty-printing adds indentation so you can read the structure, and minifying removes whitespace to cut payload size. Validation catches syntax errors before they break a deployment, such as a trailing comma in a config file.

Sorting keys is useful when comparing two documents: if both are sorted, a plain text diff shows only the real differences.

Frequently asked questions

Why does my JSON say "Unexpected token"?

The most common causes are a trailing comma, single quotes instead of double quotes, an unquoted key, or a comment. JSON allows none of these. The error below shows the line and column.

Does JSON allow comments or trailing commas?

No. Strict JSON allows neither. Config formats like JSON5 and HJSON do.

Is my data sent anywhere?

No. Formatting happens in your browser with the built-in JSON parser.

What does sort keys do?

It orders object keys alphabetically at every level, which makes two JSON files easy to compare with a diff tool.

More tools you might need