jsondecode.com logo

Validate JSON Online

Paste your JSON below. The validator checks syntax instantly, highlights the exact error line, and explains what went wrong — all in your browser with no data leaving your device.

Input JSON
Formatted Output
Formatted JSON will appear here

What Gets Validated

The validator checks every rule in the JSON specification (RFC 8259):

RuleWhat We CheckCommon Mistake
String quotingAll strings must use double quotesUsing single quotes
Key quotingAll object keys must be quoted stringsBare keys like {name: ...}
No trailing commasComma must separate two valuesComma after last item
No commentsJSON has no comment syntax// or /* */ inside JSON
Valid values onlyOnly string/number/object/array/true/false/nullundefined, NaN, Infinity
Balanced bracketsEvery { and [ must be closedMissing } or ]
Escaped charactersSpecial chars in strings must be escapedUnescaped newlines in strings

Validate JSON in Your Code

For runtime validation in JavaScript and Python:

// JavaScript — simple validator
function isValidJSON(str) {
  try {
    JSON.parse(str);
    return true;
  } catch {
    return false;
  }
}

// Python
import json
def is_valid_json(s):
    try:
        json.loads(s)
        return True
    except json.JSONDecodeError:
        return False

Validation vs. Schema Validation

This tool validates JSON syntax. If you need to validate that your JSON matches a specific structure (required fields, type constraints, enum values), use the JSON Schema Validator which supports JSON Schema Draft-07.

Frequently Asked Questions

What does a JSON validator check?

A JSON validator checks that your text conforms to the JSON grammar defined in RFC 8259. It verifies: all strings use double quotes, all object keys are quoted strings, no trailing commas exist, values are only strings/numbers/objects/arrays/true/false/null, and the overall structure is balanced (all braces and brackets are closed).

What is the difference between JSON validation and JSON schema validation?

JSON validation checks syntax — whether the text is parseable JSON at all. JSON Schema validation goes further and checks structure: whether an object has required fields, whether values match expected types, and whether numbers are within ranges. Use the JSON Schema Validator tool on this site for schema-level validation.

Is my JSON data sent to a server when I validate it?

No. The validator on this page runs entirely in your browser using the browser's built-in JSON.parse() function. Your JSON data never leaves your device.

How do I validate JSON in JavaScript code?

Wrap JSON.parse() in a try/catch: try { JSON.parse(str); return true; } catch { return false; }. This is the simplest and most reliable approach since the JS engine parses it with the same rules as any other JSON parser.

What are the most common JSON validation errors?

The five most common are: (1) trailing commas after the last array element or object property, (2) single-quoted strings instead of double-quoted, (3) unquoted object keys, (4) JavaScript comments inside JSON, and (5) undefined, NaN, or Infinity values.

If jsondecode.com saved you time, share it with your team

Free forever. No ads. No sign-up. Help other developers find it.