Free & Instant

JSON Formatter

Beautify, validate, and minify JSON data. Paste your JSON below — get instant formatting with error detection and stats.

Indent:
0 bytes

What is JSON?

JSON (JavaScript Object Notation) is the most widely used data format for web APIs, configuration files, and data exchange between applications. It was derived from JavaScript but is language-independent — virtually every programming language can parse and generate JSON.

JSON Syntax Rules

JSON has a simple, strict syntax. Data is represented as key-value pairs in objects (curly braces) or ordered lists in arrays (square brackets). Keys must be strings in double quotes. Values can be strings, numbers, booleans, null, objects, or arrays.

{ "name": "Alice", "age": 28, "isStudent": false, "address": { "city": "Paris", "zip": "75001" }, "hobbies": ["reading", "cycling"] }

Common JSON Errors

The most frequent mistakes that cause JSON to be invalid include trailing commas after the last item in an object or array, using single quotes instead of double quotes for strings, unquoted keys, comments (JSON doesn't support them), and missing commas between items.

Invalid: {name: 'Alice', age: 28,}
Valid: {"name": "Alice", "age": 28}

Keys must use double quotes, strings must use double quotes, and no trailing comma.

Formatting vs. Minifying

Formatting (beautifying) adds indentation and line breaks to make JSON human-readable — essential for debugging and code review. Minifying does the opposite: it strips all whitespace to produce the smallest possible output, reducing bandwidth for API responses and file sizes for storage. Both operations preserve the data exactly — only whitespace changes.

JSON Data Types

JSON supports six data types: strings (in double quotes), numbers (integer or float, no quotes), booleans (true or false), null, objects (curly braces containing key-value pairs), and arrays (square brackets containing ordered values). Understanding these types helps you spot errors faster when validation fails.

Frequently Asked Questions

Related Tools