Paste JSON to format, beautify, and validate it instantly. Clear error messages show exactly where syntax problems are.
Paste JSON from an API response or config file to instantly check whether it is valid. The formatter shows a clear error message with the position of any syntax mistake.
Formatted (prettified) JSON uses indentation and line breaks for readability. Minified JSON removes all whitespace to reduce file size. This tool prettifies JSON — use the formatted output when debugging, and minify for production use in APIs.
The most common mistakes in JSON are: trailing commas after the last item in an object or array (not allowed in JSON, only in JavaScript), using single quotes instead of double quotes, and unquoted property names.
JSON is a text format derived from JavaScript object syntax, but they are not the same. JSON requires double quotes around all keys and string values, does not support undefined, functions, or comments, and must have a single root value.
Paste any JSON into the input panel and click Format to beautify it with proper indentation and validate its syntax. All processing is done in your browser.
Minified JSON input
{"name":"Alice","age":30,"city":"London"}
After formatting
{ "name": "Alice", "age": 30, "city": "London" }
Invalid JSON (trailing comma)
{"key": "value",} → Error: Unexpected token }
Common JSON syntax rules
Valid JSON: {"name": "Alice", "scores": [10, 20, 30], "active": true}
JSON (JavaScript Object Notation) was popularised by Douglas Crockford in the early 2000s as a lightweight alternative to XML for data interchange. It was formally specified in RFC 4627 in 2006. Despite its name, JSON is now used with nearly every programming language and is the dominant format for REST APIs, replacing XML almost entirely in web development.
Valid JSON uses double-quoted property names and strings, commas between items, matching braces and brackets, and the values true, false, null, numbers, strings, arrays, or objects. It does not allow comments or trailing commas. Paste the complete document into the validator to locate syntax problems before sending it to an API.
Formatting adds indentation and line breaks to make the same structure easier to inspect. It should not change property names, values, or array order. Validate the result after editing, and remember that a formatter is not a schema checker: syntactically valid JSON can still contain missing fields or values an application rejects.
Treat any online formatter as unsuitable for secrets unless you have assessed its privacy model. Never paste passwords, API keys, session tokens, private customer data, or production exports into an untrusted page. For sensitive material, use a local developer tool or remove and replace confidential values before formatting.
A validator checks JSON syntax, not whether the document matches an API’s schema, types, required fields, or business rules. Compare property names and value formats with the endpoint documentation, then inspect the server’s error response. Validate a minimal test payload before adding optional or nested data.