π JSON Formatter
Format, minify, and validate JSON online. Choose 2-space or 4-space indentation.
Indent:
About JSON formatting
JSON formatting expands minified JSON into an indented structure so you can read, compare and debug fields. This tool also minifies and validates; parsing happens locally in the browser.
When an API returns a wall of JSON, or a config file fails without telling you where, format it first to understand the shape, then validate to confirm the syntax.
How to use it
Paste JSON into the input, choose 2-space or 4-space indentation, then format, minify or validate. Copy the result when it looks right.
- Format: expand nested objects and arrays.
- Minify: remove unnecessary whitespace for a compact payload.
- Validate: check syntax without changing the content.
Common uses
- Debug API responses and webhook payloads.
- Inspect application config, package metadata or i18n files.
- Minify logged JSON before pasting it into a ticket or chat.
FAQ
- Why does it say my JSON is invalid?
- JSON does not allow comments, trailing commas or single-quoted strings, and every key needs double quotes. A trailing comma is the most common mistake.
- Is JSON the same as a JavaScript object?
- Not exactly. JSON is a stricter data format: keys need double quotes, and functions, undefined and comments are not allowed.
- Does formatting change my data?
- No. It only changes indentation and whitespace; values stay the same, and everything runs locally.