JSON Formatter / Validator

Format, validate, minify, and sort JSON - instant feedback, no server required.

Indent
Examples
Nested object
Array of objects
Invalid JSON (validation demo)
How it works

Format - Parses via JSON.parse() then serializes with JSON.stringify(obj, null, indent). Any syntax error is caught and shown immediately.

Minify - Serializes with JSON.stringify(obj) (no indent) for the smallest possible output.

Sort keys - Recursively walks the object and rebuilds it with keys in alphabetical order. Arrays are preserved as-is.

Validation - JSON.parse() follows the ECMA-404 JSON standard. Common mistakes caught: trailing commas, unquoted keys, single quotes, comments, undefined.