JSON Validator
Paste any JSON and we'll validate it, point to the exact line of any error, and let you format, minify, sort keys, or auto-fix common mistakes.
Paste JSON on the left and click Validate,
or press Ctrl+Enter.
You can also drag & drop a .json file.
Learn More
JSON (JavaScript Object Notation) is a lightweight text-based data interchange format that has become the de facto standard for APIs configuration files and data storage across the web. Despite its name JSON is language-independent and supported by virtually every programming language. JSON supports six data types: strings ( hello ) numbers (42 3.14) booleans (true false) null objects (key-value pairs wrapped in curly braces) and arrays (ordered lists wrapped in square brackets). Objects and arrays can be nested to represent complex data structures. JSON's popularity stems from its simplicity. Unlike XML it has minimal syntax overhead — no closing tags no attributes no schemas required. It's human-readable enough to debug visually yet structured enough for machines to parse efficiently.
The most frequent JSON error is trailing commas. Unlike JavaScript JSON does not allow a comma after the last item in an object or array. a: 1 b: 2 is invalid — remove the trailing comma. Single quotes cause parse failures. JSON requires double quotes for both keys and string values. 'name': 'test' is invalid; name: test is correct. Unquoted keys are another common mistake. While JavaScript objects accept unquoted keys JSON requires every key to be a double-quoted string. name: test fails; name: test works. Other frequent issues include: missing commas between key-value pairs using undefined or NaN (not valid JSON values) incorrect escaping of special characters in strings (use \ for quotes \\ for backslashes \n for newlines) and comments — JSON does not support // or /* */ comments. If you need comments in configuration consider JSONC or YAML instead.
Frequently asked questions
JSON (strict RFC 8259) forbids trailing commas comments unquoted keys and single-quoted strings. JSON5 permits all of them — it's JSON made human-friendly for config files. But JSON5 is NOT interoperable: Node's JSON.parse rejects it Python's json rejects it you need a separate parser (json5 npm package pyjson5. Rule: use strict JSON for API payloads and anywhere cross-language parsing matters. Use JSON5 only for human-edited config where you control both sides. For config YAML or TOML are often better choices.
Because the original JSON spec (Douglas Crockford 2001) took them out to make JSON a strict subset of JavaScript object literals AND to be unambiguous for streaming parsers — a trailing comma makes is there a next element? unclear. ECMAScript later allowed trailing commas in JS object/array literals but JSON's spec is frozen. The modern workaround: JSON5 allows them or use a JSON-with-comments variant like JSONC (VS Code settings.json). For APIs: never emit trailing commas.
JSON Schema (draft-07 / 2020-12 is current) is a vocabulary for validating the shape of JSON documents — types required fields enum values regex patterns nested structures. You'd use it to: validate API request bodies server-side (e.g. via ajv zod-to-json-schema or language-native libs) generate forms from API specs (OpenAPI embeds JSON Schema) test API responses in CI document API shapes for clients. If you're using Zod tRPC or TypeBox you're already using JSON Schema semantics under the hood.
Use streaming. JSONL (JSON Lines aka NDJSON) — one JSON object per line — is the industry standard for log files exports ML datasets. Parse line-by-line with Node's readline Python's built-in for line in file: json.loads(line) or tools like jq -c. For actual streaming parsers (when JSONL isn't an option and the file is one giant object): clarinet (Node) ijson (Python) both walk the tree incrementally without loading the whole file. For 10GB+ datasets convert to Parquet/Arrow first.
(1) Trailing comma after last array/object element — remove it. (2) Unquoted property names ( name: x → name : x . (3) Single quotes instead of double. (4) Literal newlines inside strings (must be \n. (5) Undefined/NaN values (not valid JSON — use null or omit). (6) Comments (strip before parsing or use JSONC/JSON5). (7) BOM at file start — some parsers choke on \ufeff. Our validator reports the exact line and column of each error so you don't have to guess.
More in Data Utilities
Developer validators, formatters and generators for structured data and identifiers.