Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
Strict RFC 8259 validation · Exact error location

JSON Validator Online

Paste JSON below and instantly see whether it conforms to the JSON specification. If invalid, get the exact line and column of the error with a clear description of what went wrong. Free, fast, and 100% browser-based.

JSON to validate 0 bytes
1
Validation result
Validation results will appear here

What is a JSON validator?

A JSON validator is a tool that checks whether a piece of text conforms to the JSON specification (RFC 8259). It tells you immediately whether your JSON is syntactically correct and, if not, where the problem is. Unlike a JSON formatter — which assumes input is already valid — a validator's primary job is error detection.

JSON validation matters because most JSON consumers (REST APIs, databases, config loaders) fail loudly when they encounter invalid JSON. A trailing comma in a config file can crash an entire application. An unquoted key in an API request can return a confusing 400 error. Catching these issues with a validator before the data reaches production is faster than debugging downstream failures.

Our JSON validator uses the browser's native JSON.parse for validation — the same parser used by every JavaScript runtime, fully compliant with RFC 8259 and ECMA-404. When validation fails, we extract the parser's error position and convert it to a precise line and column number, then explain what went wrong in plain English.

How to validate JSON online

Three steps:

  1. Paste your JSON into the input area. You can also upload a .json file or drag and drop one onto the panel.
  2. Validation is automatic. The tool checks your JSON as you type with a 150ms debounce. A green indicator means valid; red means invalid.
  3. If invalid, read the error. The status message tells you the exact line and column where parsing failed, plus an explanation of what's wrong (missing comma, unexpected token, unquoted key, etc.).

For valid JSON, the right panel shows your data pretty-printed with syntax highlighting — making it easy to spot logical issues (wrong types, missing fields, unexpected nesting) even after the syntax checks out.

What kinds of errors does this validator catch?

Every type of error the JSON specification considers invalid:

, Trailing commas

The #1 cause of "invalid JSON" — a comma right before } or ]. The validator points to the comma's exact column.

' Single quotes

JSON allows only double quotes for strings and keys. {'a':'b'} fails; {"a":"b"} works. The validator highlights the offending quote.

a Unquoted property keys

JavaScript object literal syntax allows unquoted keys, but JSON requires every key in double quotes.

// Comments

JSON has no comment syntax. Both // and /* */ cause validation errors. For comment support you need JSONC or JSON5.

{} Unbalanced brackets

Missing opening or closing braces and brackets are caught with the line where the parser ran out of expected tokens.

∞ Non-JSON values

undefined, NaN, Infinity, and functions all fail validation. Use null or string sentinels instead.

\ Bad escape sequences

Inside strings, only specific backslash escapes are legal: \\, \", \/, \b, \f, \n, \r, \t, \uXXXX. Anything else is rejected.

. Leading zeros & decimals

JSON numbers don't allow leading zeros (except for 0 itself) or trailing decimals like 5.. Numbers must be written canonically.

U+ Invalid Unicode

Unescaped control characters (U+0000 through U+001F) inside strings are illegal. Use Unicode escapes like \u0001 if you need them.

When do you need a JSON validator?

JSON validation is essential in every development workflow that involves machine-readable data:

  • Before sending an API request. If you're constructing JSON manually for a curl command or HTTP request, validate it first to avoid 400 errors that don't always explain the cause.
  • After receiving an API response. Sometimes APIs return mostly-JSON with stray HTML or error text mixed in. Validation reveals when a response isn't what you expected.
  • Committing config files. A broken package.json or tsconfig.json can break your build for the whole team. Validate before committing.
  • Migrating data. When exporting JSON from one system to import into another, validation catches corruption or truncation early.
  • Writing JSON by hand. Hand-edited JSON is the most common source of syntax errors. The validator turns trial-and-error into a one-step fix.
  • Debugging integrations. When two services communicate in JSON and something breaks, validating the payloads at the boundary often pinpoints which side has the bug.

JSON validation in code (alternatives to this tool)

For programmatic validation, every language has built-in support:

  • JavaScript: JSON.parse(text) throws SyntaxError if invalid; wrap in try/catch.
  • Python: json.loads(text) raises json.JSONDecodeError with line/column info.
  • Go: json.Unmarshal(data, &v) returns a SyntaxError with byte offset.
  • Rust: serde_json::from_str::<Value>(text) returns a Result with detailed error info.
  • Java: Jackson or Gson — both throw exceptions with line numbers.
  • Command line: jq . file.json validates and pretty-prints in one step; jsonlint file.json is dedicated to validation.

Our online validator complements these for situations where you don't want to write or run code — quick spot checks, debugging in a browser, or sharing the validation result with someone who can't run command-line tools.

FAQ — Json Validator

What is JSON validation and why does it matter?
JSON validation is the process of checking whether a piece of text follows the rules of the JSON specification (RFC 8259). It matters because the consumers of your JSON — APIs, databases, configuration parsers — will reject invalid input, often with cryptic error messages. Catching syntax errors with a dedicated validator is faster than debugging downstream failures.
Which JSON spec does this validator follow?
RFC 8259, the current canonical JSON specification (equivalent to ECMA-404). This is what every modern JSON library validates against. We don't support JSON5 (which allows comments, trailing commas, and unquoted keys) or JSONC (JSON with comments) — those are extensions, not JSON proper.
Why does my JSON validate in Python/JavaScript but fail here?
Most likely your code is using a permissive parser or a JSON5/JSONC library. The validators built into standard libraries (Python's json.loads, JavaScript's JSON.parse) are strict — if one of them accepts your input, ours will too. If you're using a third-party library like json5 or simplejson with relaxed flags, those accept input we correctly reject.
How accurate is the line and column error reporting?
Very accurate for syntax errors that have a clear position — like trailing commas, unexpected tokens, or unbalanced brackets. For some errors (especially in older browsers), the parser only reports a character offset, which we convert to line and column by walking through the text. Multi-byte Unicode characters might shift the column by one or two in rare cases.
Can I validate JSON against a schema?
Schema validation is different from syntax validation — it checks the structure (required fields, types, allowed values) against a JSON Schema definition. For that, use our JSON Schema Validator. The tool on this page only checks whether the JSON is syntactically valid.
Does the validator detect logical issues like duplicate keys?
JSON technically allows duplicate keys — the spec doesn't forbid them, though it warns implementations to handle them inconsistently. We currently don't flag duplicates because they're valid JSON. For most use cases you'd want to treat them as errors, which most language-level parsers do (keeping the last value and silently discarding earlier ones).
Will the validator catch type mismatches?
No — that's not a syntax concern. {"age": "thirty"} is valid JSON even if your code expected age to be a number. To enforce types, you need schema validation. The syntax validator only checks that the input parses as valid JSON; it makes no assumptions about what the data should mean.
How big a JSON file can I validate at once?
Comfortably up to 50 MB. The browser's native parser is fast enough that even 100 MB validates in a few seconds. Above that, you may hit memory limits — for very large files, use a streaming parser like jq or a language-specific streaming library.
Is there a difference between JSON validation and JSON linting?
In casual usage, the terms overlap. Strictly speaking, validation checks for correctness against the spec (must pass before anything else), while linting checks for style and convention issues (consistent indentation, no duplicates, sensible naming) — even on valid JSON. This tool does validation; for linting you might want a stricter tool like jsonlint --strict or biome.
Can I validate JSON without an internet connection?
Yes. Once this page is loaded, all validation runs locally in your browser. You can disconnect from the internet, close your network adapter, and the tool keeps working. For long-term offline use, save the page (Ctrl+S / Cmd+S) and you'll have a self-contained validator.
Does the validator preserve the exact byte representation of my input?
Yes for validation purposes. We don't modify your input text — we just run it through the parser and report whether it succeeded. If you also choose to format the output, that produces a new pretty-printed string from the parsed data, but the original input is untouched.
How does this validator differ from jsonlint.com?
Functionally similar. The main differences: (1) ours runs entirely in your browser — no data uploaded to any server; (2) our error messages are friendlier and point to exact line/column; (3) the UI is uncluttered. If you're validating sensitive data, our browser-side approach is meaningfully more private.

Everything on this page runs in your browser — no upload, no server-side processing. How it works →