Pretty-print an API response
Turn a one-line payload into a readable structure before comparing fields or nested arrays.
{"user":{"id":42,"roles":["admin","billing"]},"active":true} Learn how to pretty-print, validate, and minify JSON safely, with examples of common syntax mistakes and a formatter you can use immediately.
Formatting JSON is one of the fastest ways to make API payloads, configuration files, and logs readable again. Minified payloads are efficient for machines, but painful for humans to inspect.
A good JSON workflow starts with validation. If the payload is invalid, pretty-printing fails and the real job becomes finding missing commas, unquoted keys, or trailing commas.
JSON formatting means taking a valid JSON object or array and rewriting it with indentation, consistent spacing, and line breaks.
Most developers also expect the formatter to validate syntax and optionally minify the same payload back into a compact one-line representation.
Turn a one-line payload into a readable structure before comparing fields or nested arrays.
{"user":{"id":42,"roles":["admin","billing"]},"active":true} Use the same validated object and switch to minified output when you need a compact body for curl or test fixtures.
Pretty print, validate and minify JSON.
Open full tool pageMost often the payload contains JavaScript syntax, comments, single quotes, or a trailing comma. JSON is stricter than a JavaScript object literal.
Usually no. Formatted JSON is easier for humans, but minified JSON is smaller. Keep pretty output for inspection and compact output for transport.