Trailing comma in an object
Strict JSON does not allow a comma after the final property.
Validate JSON payloads instantly in your browser to catch syntax errors.
Paste JSON below to validate it locally.
Verified malformed JSON samples with corrected versions.
Strict JSON does not allow a comma after the final property.
The final array item must be followed by ] rather than a comma.
Object members must be separated by commas.
JSON requires every object property name to be a double-quoted string.
Single-quoted strings are valid in some JavaScript contexts but not in JSON.
Literal double quotes inside a JSON string must be escaped with a backslash.
A JSON string cannot contain a raw newline; use the escaped sequence \n.
Every opening object brace must have a matching closing brace.
The array must close with ] before the containing object closes.
JSON arrays use square brackets and objects use curly braces.
JSON numbers cannot use leading zeroes unless the number is exactly 0.
JSON permits a minus sign but not a leading plus sign.
JSON only recognizes specific escapes; an unknown escape such as \q is invalid.
Standard JSON has no comment syntax. Use documentation outside the JSON document.
JSON supports null, but not JavaScript's undefined value.
NaN is a JavaScript number value, not a valid JSON literal.
Infinity is not one of JSON's permitted literal values.
A property must have one JSON value; multiple values require an array.
A JSON document must contain one complete value and nothing else after it.
An empty string is not a JSON document. Use null, an object, or an array when an empty value is needed.
JSON literals are lowercase: true, false, and null.
This online JSON validator evaluates your input against strict RFC 8259 syntax specifications. Valid payloads display an immediate green confirmation; malformed inputs reveal the underlying parser error message along with the estimated line number and character offset.
Standard JSON (RFC 8259) is stricter than JavaScript object literals. Here are the most common syntax errors developers encounter:
Commas are separators, not terminators. Placing a comma after the last property is illegal.
JSON keys and string values must strictly use ASCII double quotes (").
In JavaScript, keys can omit quotes. In JSON, every object key must be a double-quoted string.
Raw newlines and backslashes inside string values must be escaped with \\n and \\\\.
Code patterns for automated syntax validation in APIs, scripts, and pre-commit hooks:
function isValidJSON(text) {
try {
JSON.parse(text);
return true;
} catch (err) {
console.error("Syntax Error at:", err.message);
return false;
}
}import json
def is_valid_json(payload_str):
try:
json.loads(payload_str)
return True
except json.JSONDecodeError as err:
print(f"Error at line {err.lineno}, col {err.colno}: {err.msg}")
return False# Validate and exit with non-zero if invalid (great for git pre-commit hooks) jq empty config.json # Using Python in terminal python3 -c "import json, sys; json.load(sys.stdin)" < config.json
Once your JSON syntax is valid, format it with clean 2-space indentation or minify for production.
10 common JSON syntax errors with corrected examples — trailing commas, single quotes, and escaping.
Learn JSON syntax rules, all six data types, and the most common errors with practical examples.
Convert valid JSON payloads directly to human-friendly YAML for Kubernetes configs.
Convert JSON arrays to CSV spreadsheets or parse tabular CSV back to JSON.
Convert validated JSON structures to XML tags or parse XML documents into JSON.
The three most frequent errors are: 1) Trailing commas after the last item in an array or object (e.g. {"a": 1,}). 2) Single quotes instead of double quotes for keys or string values. 3) Unescaped special characters (such as raw newlines or unescaped backslashes) inside strings.
RFC 8259 intentionally disallows trailing commas to ensure unambiguous, deterministic parsing across hundreds of different programming language implementations. While JavaScript arrays and Python dictionaries permit trailing commas, strict JSON parsers will throw a syntax error.
In Bash or Linux/macOS terminals, use 'jq empty filename.json' (exits with code 0 if valid, non-zero on syntax error) or Python: 'python3 -m json.tool filename.json > /dev/null'. In Node.js CI environments, run 'npx jsonlint filename.json'.
This tool validates structural JSON syntax (RFC 8259). It confirms that the payload is well-formed JSON that any standard parser can deserialize. It does not enforce custom business rules or validate against a domain-specific JSON Schema document.
No. The validator runs 100% locally on your machine using the browser's native JavaScript parser. Your data never touches our servers, ensuring total privacy for sensitive tokens, API payloads, and config files.
Because processing is local, performance depends on your device's available memory. Most modern desktop browsers can validate JSON files up to 50MB in less than a second.