JSON Formatter & Validator
Paste raw or minified JSON to instantly format it with proper indentation and syntax highlighting. Validate for errors, minify for production, and copy the result. All in your browser — nothing sent to servers.
What Is JSON?
JSON (JavaScript Object Notation) is a lightweight, human-readable data interchange format. It is the dominant format for REST API responses, configuration files, and data storage. JSON represents data as key-value pairs, arrays, strings, numbers, booleans, and null — making it both machine-parseable and human-writable.
How to Use This Tool
- Format — Paste raw or minified JSON and click Format. The tool validates the input and pretty-prints it with 2-space indentation and syntax highlighting.
- Minify — Remove all whitespace and formatting for production use. Minified JSON is smaller and faster to transmit.
- Sort Keys — Alphabetically sort all object keys at every nesting level — useful for diffing and canonical serialization.
- Error highlighting — If your JSON is invalid, the tool shows the exact error message with the position of the syntax error.
- Copy — Click the Copy button to copy the formatted output to your clipboard.
JSON Syntax Rules
- Keys must be double-quoted strings:
"name"notname - Strings must use double quotes:
"value"not'value' - Trailing commas are not allowed:
[1, 2, 3,]is invalid - Comments are not allowed in standard JSON
- Numbers can be integer or float but not Infinity or NaN
- Boolean values are lowercase:
trueandfalse, notTrueorFalse