Online JSON Formatter, Validator and Minifier
Make JSON easier to read, check its syntax, or remove unnecessary whitespace. The formatter uses your browser’s JSON parser and serializer; processing happens locally.
How to Format and Validate JSON
- Paste a JSON object or array into the input area, or load the sample.
- Choose an indentation size and select Format. Use the tree view to inspect nested values.
- Select Validate to check syntax, or Compress to produce compact JSON.
- Copy the output after checking the result.
JSON Formatting Example
These compact and indented objects represent the same data:
Compact:
{"name":"MiniTools","enabled":true,"items":[1,2]}
Indented:
{
"name": "MiniTools",
"enabled": true,
"items": [
1,
2
]
}Common JSON Errors
JSON requires double quotes around property names and string values. Single quotes, comments, undefined, and trailing commas are not valid JSON. For example, {"count":1,} must become {"count":1}.
Syntax validation does not check your application’s required fields, types, or business rules. This tool does not perform JSON Schema validation.
Number Precision and Round-Trip Limits
Numbers are parsed as JavaScript numbers. Integers outside the safe range −9,007,199,254,740,991 to 9,007,199,254,740,991 may lose precision. Store identifiers requiring exact digits as quoted strings before processing.
Formatting is not a byte-preserving operation: number notation, escapes and whitespace may change, and duplicate object keys collapse to the last value. Keep the original when exact source text matters. The standalone JSON value null is valid, but this interface currently does not generate a new output for it.
Frequently Asked Questions
What is the difference between formatting and minifying JSON?
Formatting adds indentation and line breaks for readability. Minifying removes unnecessary whitespace. Both parse and serialize the input, so the round-trip limitations above apply.
Does this formatter support JSON comments or trailing commas?
No. Remove comments and trailing commas first. JavaScript object literals and JSON5 are not accepted as strict JSON.
Can I validate an API response here?
Yes, paste its JSON body to check syntax and inspect its structure. A syntax pass does not establish that the response matches an API schema.
Is my JSON uploaded?
The formatting and validation code runs in your browser and does not send the JSON input to a processing server. The website also loads third-party analytics and advertising scripts.