JSON Formatter & Validator

Format, minify, and validate JSON with syntax highlighting and detailed error info.

Frequently Asked Questions

What is JSON and why is it everywhere?

JSON (JavaScript Object Notation) is a lightweight, human-readable data format using key-value pairs, arrays, strings, numbers, booleans, and null. It became the dominant data interchange format because it's easy for humans to read/write and trivial for machines to parse. REST APIs, configuration files (package.json, tsconfig.json), databases (MongoDB, Firebase), and logs all use JSON.

What is the difference between pretty-printed and minified JSON?

Pretty-printed JSON has indentation and line breaks for readability — ideal for debugging and development. Minified JSON removes all unnecessary whitespace, producing a compact single-line string. A minified 100KB JSON file might be 80KB, saving ~20% bandwidth. Use minified for production APIs and pretty-printed for human review.

What are the most common JSON syntax errors?

The validator shows exact line/column for errors. Common mistakes: trailing commas after the last item in an object {} or array [] (valid in JavaScript, invalid in JSON), single quotes instead of double quotes, unquoted keys ({"key" not {key}), missing commas between items, and comments (// or /* */ are not supported in JSON — use JSONC format instead).

How do I find and count all keys in a JSON object?

This tool recursively counts all keys across every nested object in the JSON, not just the top level. A JSON like {"a": 1, "b": {"c": 2, "d": 3}} has 3 total keys (a, b, c, d — wait that's 4). The nesting depth indicator shows how deeply nested the deepest key is.