JSON Formatter and Validator
Validate JSON syntax, format with indentation or minify to one line. Original number and string tokens are preserved.
Enter JSON or choose a file.
Your input is not sent to a server. Original key order is preserved unless you enable key sorting.
How to Format and Validate JSON
- Paste JSON or choose a UTF-8 JSON file.
- Use automatic validation or Validate Syntax to find errors.
- Choose two spaces, four spaces or tabs, then select Format JSON.
- Optionally minify to one line, then copy the result or download a JSON file.
Common JSON Syntax Errors
Use double quotes for object keys and strings, and commas between members. Do not add a comma after the last member. Comments and JavaScript code are not valid JSON.
JSON Formatting That Preserves Large Numbers and Duplicate Keys
Original number digits, notation and string escapes are preserved; only whitespace outside strings is formatted. Duplicate keys trigger a warning instead of being removed. Object key sorting is optional, and array order stays unchanged.
Frequently Asked Questions
Is my JSON sent to a server?
No. Validation and formatting happen only in your browser. Your JSON and files are not sent to or stored on Congdy Coding's server.
Are large integers and decimals preserved?
Numbers are not converted to JavaScript Number values. Original large integers, precise decimals, exponent notation and negative zero are preserved when formatting.
What happens with duplicate keys?
Duplicate object keys trigger a warning, and all members are preserved. Programs interpret duplicates differently, so resolve them before using the data.
Are comments and trailing commas allowed?
No. This tool validates standard JSON, rejecting comments, single-quoted strings, unquoted keys and trailing commas. It is not a JSON5 or JSONC validator.
Can I validate a JSON file?
Yes. Choose a UTF-8 JSON file up to 5 MB. For browser performance, nesting is limited to 200 levels and the number of values to 200,000.
Does passing validation make my JSON ready for an API?
This tool validates JSON syntax only, not an API's required fields, data types or business rules. Check the API specification as well.
JSON syntax validation is different from a service's data validation. Review important data before using the result.