Back to Blog
JSON-LDTesting

How to Validate JSON-LD

Step-by-step guide to validating JSON-LD structured data using Google Rich Results Test, Schema.org Validator, and command-line tools.

SS
Sanjay Samanta
June 22, 2026
5 min read

Invalid JSON-LD is worse than no JSON-LD at all. A syntax error, missing required field, or wrong property type can silently prevent your page from qualifying for rich results — with no warning in Google Search Console until it’s too late.

This guide covers every validation method available.


1. Google Rich Results Test (Primary Tool)

URL: search.google.com/test/rich-results

This is the most important validation tool because it tests exactly what Google’s crawler will do with your JSON-LD.

How to Use It

  1. Enter your page URL (or paste a code snippet).
  2. Click Test URL.
  3. Review the results:
    • Valid items — Your schema qualifies for rich results.
    • Warnings — Missing recommended properties (won’t prevent rich results, but may reduce quality).
    • Errors — Missing required properties or invalid syntax (rich results will NOT display).

What It Catches

  • Missing required properties per schema type
  • Invalid property values (wrong types, malformed URLs)
  • Unsupported schema types
  • JSON syntax errors

2. Schema Markup Validator

URL: validator.schema.org

This tool validates your JSON-LD against the full Schema.org vocabulary (not just Google’s supported subset). It catches:

  • Properties not defined in Schema.org
  • Type mismatches (e.g., using a string where an object is expected)
  • Deprecated types and properties

Use this alongside the Rich Results Test for comprehensive validation.


3. JSON Syntax Validation

Before testing with schema validators, ensure your JSON-LD is syntactically valid JSON:

# Command line (requires jq)
echo '{"@context":"https://schema.org","@type":"Article"}' | jq .

# Or use Node.js
node -e "JSON.parse(require('fs').readFileSync('schema.json','utf8'))"

Common JSON syntax errors:

  • Trailing commas{"name": "value",} (invalid in JSON, valid in JavaScript)
  • Single quotes{'name': 'value'} (JSON requires double quotes)
  • Unescaped characters — Special characters in strings must be escaped
  • Comments — JSON does not support // or /* */ comments

4. Google Search Console

After deploying, Google Search Console provides ongoing monitoring:

  1. Go to Enhancements in the left sidebar.
  2. Check each structured data type (Articles, FAQs, Products, etc.).
  3. Review any errors or warnings flagged by Google’s crawler.

Search Console shows real production data, so it catches issues that testing tools might miss (e.g., server-side rendering failures that only occur in production).


5. Browser Extensions

Several browser extensions can validate JSON-LD directly on any page you visit:

  • Structured Data Testing Tool (Chrome) — Highlights JSON-LD blocks and validates them.
  • Schema Builder (Chrome) — Visualizes and edits structured data.
  • SEO Meta in 1 Click (Chrome/Firefox) — Displays both OG tags and JSON-LD.

Validation Checklist

Before deploying JSON-LD, verify:

  • JSON syntax is valid (no trailing commas, no single quotes)
  • @context is set to "https://schema.org"
  • @type matches the correct Schema.org type
  • All required properties for the type are present
  • All recommended properties are included where possible
  • URLs are absolute HTTPS
  • Dates use ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ)
  • Nested objects have their own @type
  • No duplicate @type declarations
  • Rich Results Test shows valid items with no errors

Advertisement