JSON Formatter, Validator & Minifier

Format JSON with selectable indentation and optional key sorting. Validate JSON syntax with detailed error location and structure statistics. Minify JSON to a single compact line with compression ratio. Also: JSON Compare | JSON ↔ String | JSON ↔ CSV/TSV | All JSON Tools | JSON Viewer / Editor | JSONPath Evaluator | JSON Schema Validator | JSON → SQL / TOML.
All processing happens locally in your browser — your data is never uploaded to any server.
Mode: Indent:
Format: Pretty-prints JSON with configurable indentation (2 spaces, 4 spaces, or tabs). Optionally sorts object keys alphabetically.
Validate: Checks JSON syntax and reports errors with exact line and column numbers. On success, displays structure statistics (depth, key count, data type, size).
Minify: Compresses JSON to a single line by removing all unnecessary whitespace. Shows compression ratio and byte savings.
Tip: All three modes implicitly validate the JSON first. Invalid input will produce an error message in all modes.
Format, validate, minify — one pipeline

All three operations run the same pipeline: parse the text, then re-serialize. Formatting pretty-prints the parsed tree; minifying strips every optional space; validating stops at the first syntax error and reports its exact line and column. Because parsing happens first, formatted output is always semantically identical to the input — only whitespace changes.

Key sorting is the one option that changes structure — object keys are reordered alphabetically.