Upload a JSON file to validate its syntax and confirm it’s valid JSON in seconds.
.json file onto the editor. The validator accepts anything from a single primitive (true, null, a number, a quoted string) to multi-megabyte object trees. Files never leave your browser session.JSON.parse() and reports either a green "Valid JSON" banner or the line and column of the first syntax error — for example, Unexpected token } in JSON at position 247 mapped to line 12, column 5.NaN / Infinity literals — none of which are legal in standard JSON.JSON is everywhere — REST APIs, config files (package.json, tsconfig.json, AWS IAM policies, Firebase rules), webhook payloads, NoSQL documents, JWT claims — and a single misplaced comma can break an entire pipeline. RFC 8259 (the current IETF JSON standard, jointly authoritative with ECMA-404) defines a strict grammar: double-quoted strings only, no trailing commas, no comments, no NaN or Infinity, only true/false/null as literals. Validating before you ship catches these problems while they're still cheap to fix.
400 Bad Request with "Invalid JSON", paste the body in and you'll see the exact character that tripped the server. Saves trawling a 600-line payload by eye.tsconfig.json, package.json, AWS IAM policies, Kubernetes manifests, GCP service-account keys — one stray comma after the last property and your build, deploy, or container won't start. Validate after every edit.undefined. Validation immediately surfaces the difference.Working with related formats? Try JSON to CSV, JSON to YAML, JSON to XML, or CSV to JSON.
| Feature | Standard JSON (RFC 8259 / ECMA-404) | JSONC (VS Code, tsconfig) | JSON5 |
|---|---|---|---|
| Double-quoted strings | Required | Required | Allowed (also single quotes) |
| Single-quoted strings | Rejected | Rejected | Allowed |
| Unquoted object keys | Rejected | Rejected | Allowed (if valid identifier) |
| Trailing commas | Rejected | Allowed | Allowed |
// and /* */ comments |
Rejected | Allowed | Allowed |
NaN, Infinity, -Infinity |
Rejected | Rejected | Allowed |
Hex numbers (0xFF) |
Rejected | Rejected | Allowed |
Multi-line strings (with \) |
Rejected | Rejected | Allowed |
Top-level primitives (42, "x", true) |
Allowed (since RFC 7159) | Allowed | Allowed |
| Validates here | Yes | No — strip comments/commas first | No — convert to JSON first |
This validator checks standard JSON only. If your file is JSONC (the dialect VS Code uses for tsconfig.json and settings.json) or JSON5 (an ES5-inspired superset), strip comments and trailing commas before validating, or use a tool that targets that dialect specifically.
| Error pattern | Cause | Fix |
|---|---|---|
Unexpected token } in JSON after a property |
Trailing comma before } |
Remove the trailing comma |
Unexpected token ] in JSON after an element |
Trailing comma before ] |
Remove the trailing comma |
Unexpected token ' |
Single-quoted string or key | Replace ' with " |
Unexpected token n at a key position |
Unquoted key (e.g., name: "...") |
Wrap key in double quotes: "name": "..." |
Unexpected token / |
// or /* */ comment in the input |
Remove comments (JSON has none) |
Unexpected token N / Unexpected token I |
Bare NaN or Infinity literal |
Use null or a quoted string instead |
Unexpected end of JSON input |
Unclosed bracket, brace, or string | Match every { with }, every [ with ], every " with " |
Bad control character in string literal |
Unescaped newline, tab, or backslash inside a string | Escape as \n, \t, \\ |
Unexpected token in JSON at position 0 |
BOM, leading whitespace garbage, or HTML response | Strip the BOM / verify the source returned JSON, not HTML |
No — this is a syntax validator only. It confirms your input is well-formed JSON per RFC 8259, but it does not check that fields match a contract (e.g., "age must be an integer between 0 and 150"). For schema validation you need a JSON Schema engine such as Ajv (Node/browser), python-jsonschema, or everit-org/json-schema (Java). Syntax validity is a prerequisite for schema validation, so this tool is still the right first step.
No. JSON5 (which permits comments, trailing commas, single quotes, hex numbers, NaN, and Infinity) and JSONC (the VS Code dialect with comments and trailing commas, used in tsconfig.json and settings.json) will both fail validation here. That's by design — the tool reports compliance with the standard, not with any superset. Strip non-standard features first or use a JSON5-aware parser.
RFC 8259 grammar treats , strictly as a separator between elements, with no provision for one after the last element. JavaScript permits trailing commas (since ES5 in arrays, ES2017 in function calls, ES2017 in object literals), which is why developers reach for them by reflex — but standard JSON parsers including JSON.parse(), Python's json module, Go's encoding/json, and Java's Jackson all reject them. Remove the comma after the last property or element.
A literal backslash in a JSON string must be written as \\. Common offenders: Windows file paths ("C:\Users\Alice" is invalid — write "C:\\Users\\Alice"), regex source (write "\\d+" not "\d+"), and LaTeX (\\ becomes \\\\). If a parser complains about an "invalid escape", scan for lone backslashes followed by characters other than ", \, /, b, f, n, r, t, or u — those are the only legal escape sequences.
Not directly. RFC 8259 says a string runs until its closing " and a raw newline character inside that string is invalid. The standard escapes are \n (newline) and \r (carriage return). If you have a multi-line block to encode, either escape the newlines ("line one\nline two") or split it into an array of lines (["line one", "line two"]). JSON5 and YAML allow real line breaks; standard JSON does not.
Per RFC 8259, no — and the document explicitly notes that Douglas Crockford removed comments from JSON early on because implementations were using them for parsing directives, which broke interoperability. If you want comments, use JSON5, JSONC, or YAML; alternatively, add a convention like an underscore-prefixed key ("_comment": "explanation here") that consumers ignore.
NaN, Infinity, and -Infinity?Not legal in standard JSON. The RFC states explicitly that "numeric values that cannot be represented in the grammar below (such as Infinity and NaN) are not permitted." Many parsers (Python's json with allow_nan=True, JavaScript's JSON.stringify when given these values) emit them anyway as an extension — but the result will fail strict validation. Use null, a quoted string "Infinity", or your own sentinel value instead.
The original RFC 4627 (2006) required a JSON document to be either an object or an array at the top level. RFC 7159 (2014) and the current RFC 8259 (2017) loosened this — a single primitive like 42, "hello", true, false, or null is now a valid JSON document. Old validators or parsers may still reject these. This tool follows the current spec and accepts top-level primitives.
The validator handles inputs up to several megabytes comfortably; beyond ~10 MB performance depends on your browser and device RAM since JSON.parse() reads the whole document into memory. For very large files (logs, dumps), use a streaming parser on the command line: jq . file.json > /dev/null (errors on stderr), python -m json.tool file.json > /dev/null, or ijson for true streaming in Python.
No. All parsing happens client-side via the browser's JSON.parse() after the page loads — no upload, no server round-trip, no logging. You can validate API keys, PII, healthcare data, or internal configs safely. Disconnect from the network after the page loads and validation still works.