JSON Formatter and Validator
Paste JSON to pretty-print it with 2 spaces, 4 spaces or tabs, minify it for transport, or simply check that it is valid. When the JSON is broken, the tool explains the problem and points to the line and column. An option sorts object keys alphabetically, which helps when comparing two responses. Nothing is uploaded, so it is safe for API responses.
JSON Formatter and Validator
Runs in your browser. Nothing you enter is uploaded or saved.
How to use this tool
- Paste the JSON. Paste an API response, config file or any JSON text into the input box.
- Pick options. Choose the indent and whether to sort keys alphabetically.
- Format, minify or validate. Press a button. Errors show the line and column and the cursor jumps to the problem.
- Copy the result. Copy the output for your code, documentation or a diff tool.
Common JSON errors
Most errors come from a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, comments (JSON has none) or a missing bracket. Values must be strings, numbers, true, false, null, objects or arrays.
Formatting versus minifying
Formatted JSON is easier to read and review. Minified JSON removes whitespace to save bytes when sending data; with HTTP compression the saving is often small, so readability usually matters more in config files.
Limits to be aware of
The tool uses the browser’s own JSON parser. Integers above 9,007,199,254,740,991 lose precision, and duplicate keys keep only the last value. Sorting places integer-like keys first, as JavaScript objects do.
Frequently asked questions
What is the difference between JSON and a JavaScript object?
JSON is a text format with stricter rules: keys and strings need double quotes, and functions, comments and trailing commas are not allowed.
Can I format JSON with comments (JSONC)?
No. Remove the comments first; standard JSON does not allow them.
Is my data sent to a server?
No. Parsing and formatting happen in your browser.