JSON Formatter

Validate, format & minify JSON instantly

How it works:

Paste JSON code to validate syntax, format with proper indentation, or minify it. Perfect for debugging API responses and working with JSON data.

Paste minified or messy JSON to pretty-print it with clean indentation and instantly see whether it's valid. It's the fastest way to make an API response or config file readable and to catch a syntax error.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for structured data, and it's the common language of web APIs and config files. It has just a few building blocks: objects in { } with "key": value pairs, arrays in [ ], plus strings (always double-quoted), numbers, true/false, and null. That small, strict grammar is exactly why it's easy for programs to parse reliably.

When and why you'd use it

Worked examples

Minified: {"name":"Ada","langs":["Python","C"],"active":true}
Formatted, it becomes an indented object with a nested array — each key on its own line, easy to read.
Invalid: {'name': 'Ada',}
Two problems: single quotes (JSON requires double quotes) and a trailing comma after the last pair. Fixed: {"name": "Ada"}.
Invalid: {name: "Ada"} → keys must be quoted: {"name": "Ada"}.

Frequently asked questions

Why does my JSON say it's invalid?

The usual culprits are all things JSON forbids: trailing commas, single quotes, unquoted keys, and comments. Remove those and it will validate.

Isn't JSON just a JavaScript object?

They look alike, but JSON is stricter: keys must be double-quoted strings, no comments, no functions, no trailing commas. Every JSON document is valid JS, but not every JS object literal is valid JSON.

Does formatting change my data?

No — it only adds or removes whitespace. The keys, values, and structure are identical; it's purely for readability (or minifying).

Can I use comments in JSON?

Not in standard JSON. Formats like JSONC or JSON5 allow comments and are used by some editors, but a strict JSON parser will reject them.

Is my data sent anywhere?

No. Formatting and validation run entirely in your browser.

Strict by design. JSON has no comments and requires double quotes — rules that catch people coming from JavaScript. Very large documents may also be slow to format in a browser tab.