← All guides

JSON guide

How to Format and Validate JSON

Learn how to format, validate, minify, and troubleshoot JSON payloads used in APIs, webhooks, configuration files, and logs.

What valid JSON requires

JSON uses double-quoted property names and string values. Objects use braces, arrays use brackets, and every value except the last in an object or array is followed by a comma. JSON does not allow comments or trailing commas.

Format a compact payload

Paste the payload into the formatter and select Format. Indentation reveals nested objects and arrays, making API responses and webhook payloads easier to scan. If parsing fails, use the reported position to check nearby quotes, commas, and brackets.

{"user":{"id":42,"roles":["admin","editor"]},"active":true}

Validate before sending a request

Validate request bodies before testing an endpoint. This separates JSON syntax problems from authentication, routing, or server-side errors and makes debugging faster.

When to minify JSON

Minification removes unnecessary whitespace. It is useful when copying payloads into environment variables, command-line requests, or systems with strict size limits. Keep a formatted copy for humans and minify only when needed.

Format your JSON now

Validate, beautify, or minify a payload directly in your browser.

Open JSON Formatter