JSON Formatter & Validator
Paste your JSON to instantly format it with readable indentation, minify it to a single line, or validate it for syntax errors. Runs entirely in your browser — no data sent to servers.
JSON Input
Output — Format
Output appears here as you type…What each mode does
Format
Adds newlines and 2-space indentation. Makes nested structures easy to read. Use when debugging APIs or reading config files.
Minify
Removes all whitespace. Produces the smallest valid JSON string. Use for API payloads or reducing file size.
Sort keys
Reorders all keys inside every object alphabetically (A→Z or Z→A), recursively. Useful for diffing or normalising config files.
Frequently Asked Questions
What does the JSON formatter do?▾
The formatter parses your JSON and re-serializes it with 2-space indentation, making nested objects and arrays easy to read. It also validates your JSON in the process — if the input is invalid, an error message shows the exact problem.
What is the difference between format and minify?▾
Format (beautify) adds newlines and spaces to make JSON human-readable. Minify does the opposite — it removes all unnecessary whitespace to produce the smallest possible JSON string, which is useful for APIs and data storage.
How do I validate JSON?▾
Click the "Validate" button after pasting your JSON. If valid, a green confirmation appears. If invalid, the error message from the JSON parser shows exactly where the problem is — for example, "Unexpected token } at position 42".
Is my JSON data sent to a server?▾
No. All formatting, minifying, and validation runs entirely in your browser using the built-in JavaScript JSON parser. Your data never leaves your device.
What JSON is supported?▾
Standard JSON as defined by RFC 8259. This means quoted string keys, and values of type string, number, boolean, null, object, or array. Comments and trailing commas (common in JSON5 or JSONC) are not supported by the standard parser and will cause a validation error.
Can I format very large JSON files?▾
Yes, within browser memory limits. The tool handles JSON up to a few megabytes without issue. For very large files (tens of MB), performance depends on your device. There is no artificial size limit imposed by the tool.