JSON Formatter
Format, validate, and minify JSON with syntax highlighting.
Why format JSON
JSON (JavaScript Object Notation) is the most common data exchange format for web APIs, config files, and structured data storage. When it comes from an API response or a log system, JSON is often minified — all on one line, no spaces — which makes it hard to read.
Formatting (or "prettifying") organizes JSON with consistent indentation and line breaks, making it easier to identify the structure of nested objects and arrays. Minifying does the opposite: it removes unnecessary spaces and line breaks to reduce file size before sending it over the network.
Syntax validation
Valid JSON follows strict rules: keys in double quotes, no trailing comma on the last item, and only supported types (string, number, boolean, null, object, array). Common mistakes include trailing commas, single quotes instead of double, and unquoted keys — all rejected by the JSON standard, even though they are accepted in regular JavaScript objects.
Frequently asked questions
Why doesn't my JSON validate even though it looks correct?
The most common errors are a trailing comma after the last item in an object or array, single quotes instead of double quotes, and unquoted keys. JSON is stricter than JavaScript object syntax.
What is the difference between formatting and minifying?
Formatting adds indentation and line breaks for human readability. Minifying removes all unnecessary whitespace to reduce file size, useful for production and network transmission.
Is my data sent to any server?
No. All processing happens in your browser — no data pasted here is sent to external servers.