Schema Validator

Validate JSON-LD structured data and inspect Schema.org markup fields.

Back to all tools on ToolForge

More in SEO Tools

About Schema Validator

This JSON-LD validator checks structured data markup syntax and helps you inspect required Schema.org fields. JSON-LD (JavaScript Object Notation for Linked Data) is the preferred format for adding structured data to web pages, used by Google, Bing, and other search engines for rich results.

JSON-LD Structure Overview

JSON-LD uses a simple structure with context, type, and properties:

Basic JSON-LD Structure:

{
  "@context": "https://schema.org",
  "@type": "EntityType",
  "property1": "value1",
  "property2": "value2",
  "nestedProperty": {
    "@type": "NestedType",
    "nestedValue": "example"
  }
}

Example - Organization Schema:
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "ToolForge",
  "url": "https://toolforge.site",
  "logo": "https://toolforge.site/logo.png",
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer service",
    "telephone": "+1-555-123-4567"
  }
}

Required Fields by Schema Type

Schema Type Required Fields Recommended Fields
Organization name, url logo, contactPoint, sameAs
LocalBusiness name, address, telephone openingHours, priceRange, image
Article headline, image, datePublished author, publisher, dateModified
Product name, image, offers description, brand, review, aggregateRating
FAQPage mainEntity (Question/Answer) name, description
BreadcrumbList itemListElement (ListItem) name, position
Recipe name, image, ingredients cookTime, prepTime, nutrition
Event name, startDate, location image, description, offers

Common Schema Types

Schema.org defines hundreds of types. Most commonly used for SEO:

Category Types
Business Organization, LocalBusiness, Corporation, NGO
Content Article, BlogPosting, NewsArticle, ScholarlyArticle
Commerce Product, Offer, AggregateOffer, Brand
Media ImageObject, VideoObject, AudioObject, MusicRecording
People Person, ContactPoint, PostalAddress
Structured Content FAQPage, HowTo, Recipe, Event, Course
Navigation BreadcrumbList, SiteNavigationElement
Reviews Review, AggregateRating, Rating

JSON-LD Validation Algorithm

JavaScript JSON-LD Validation:

function validateJSONLD(input) {
  const report = [];
  const errors = [];
  const warnings = [];

  // Step 1: Parse JSON
  let data;
  try {
    data = JSON.parse(input);
  } catch (e) {
    return { valid: false, error: "Invalid JSON: " + e.message };
  }

  // Step 2: Check required structural fields
  if (!data["@context"]) {
    errors.push("Missing @context field");
  } else if (data["@context"] !== "https://schema.org") {
    warnings.push("Non-standard @context: " + data["@context"]);
  }

  if (!data["@type"]) {
    errors.push("Missing @type field");
  }

  // Step 3: Check type-specific required fields
  const requiredFields = {
    "Organization": ["name", "url"],
    "LocalBusiness": ["name", "address", "telephone"],
    "Article": ["headline", "image", "datePublished"],
    "Product": ["name", "image", "offers"],
    "FAQPage": ["mainEntity"]
  };

  const type = data["@type"];
  if (requiredFields[type]) {
    requiredFields[type].forEach(field => {
      if (!data[field]) {
        errors.push(`Missing required field for ${type}: ${field}`);
      }
    });
  }

  // Step 4: Check common optional fields
  const commonFields = ["name", "description", "image", "url"];
  commonFields.forEach(field => {
    if (!data[field]) {
      warnings.push(`Missing recommended field: ${field}`);
    }
  });

  return {
    valid: errors.length === 0,
    errors,
    warnings,
    data
  };
}

Example JSON-LD Templates

Organization Schema:
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Company Name",
  "url": "https://example.com",
  "logo": "https://example.com/logo.png",
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+1-800-555-1234",
    "contactType": "customer service"
  }
}

Article/BlogPosting Schema:
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Article Title",
  "image": "https://example.com/image.jpg",
  "datePublished": "2024-01-15",
  "dateModified": "2024-01-20",
  "author": {
    "@type": "Person",
    "name": "Author Name"
  },
  "publisher": {
    "@type": "Organization",
    "name": "Publisher Name",
    "logo": {
      "@type": "ImageObject",
      "url": "https://example.com/logo.png"
    }
  }
}

FAQPage Schema:
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "What is JSON-LD?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "JSON-LD is a lightweight syntax for expressing structured data."
      }
    },
    {
      "@type": "Question",
      "name": "Why use structured data?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Structured data helps search engines understand your content and display rich results."
      }
    }
  ]
}

Product Schema:
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Product Name",
  "image": "https://example.com/product.jpg",
  "description": "Product description",
  "brand": {
    "@type": "Brand",
    "name": "Brand Name"
  },
  "offers": {
    "@type": "Offer",
    "price": "99.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  },
  "aggregateRating": {
    "@type": "AggregateRating",
    "ratingValue": "4.5",
    "reviewCount": "128"
  }
}

LocalBusiness Schema:
{
  "@context": "https://schema.org",
  "@type": "LocalBusiness",
  "name": "Business Name",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "123 Main St",
    "addressLocality": "City",
    "addressRegion": "CA",
    "postalCode": "12345",
    "addressCountry": "US"
  },
  "telephone": "+1-555-123-4567",
  "openingHours": "Mo-Fr 09:00-17:00",
  "priceRange": "$$"
}

BreadcrumbList Schema:
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://example.com"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Products",
      "item": "https://example.com/products"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Widget",
      "item": "https://example.com/products/widget"
    }
  ]
}

ISO 8601 Date Format

Schema.org requires dates in ISO 8601 format:

Format Example Use Case
Date only 2024-01-15 datePublished, birthDate
Date with time 2024-01-15T10:30:00 startDate for events
With timezone 2024-01-15T10:30:00-08:00 Precise timestamps
Duration PT1H30M cookTime, duration (ISO 8601)

Rich Results Eligibility

Google uses structured data to power rich results in search:

Rich Result Type Required Schema
Organization Logo Organization with logo
Article Rich Result Article/BlogPosting/NewsArticle
Product Snippet Product with offers, price
FAQ Rich Result FAQPage with Q/A pairs
Recipe Rich Result Recipe with required fields
Event Rich Result Event with date, location
Breadcrumb BreadcrumbList
Local Business LocalBusiness with NAP

Common JSON-LD Errors

Error Type Example Fix
Invalid JSON Trailing comma, unquoted keys Remove trailing commas, quote all keys
Missing @context No @context field Add "@context": "https://schema.org"
Missing @type No @type field Add appropriate @type value
Wrong property name "title" instead of "headline" Use Schema.org property names
Invalid date format "01/15/2024" Use ISO 8601: "2024-01-15"
Nested type error Missing @type in nested object Add @type to all nested objects

Common Use Cases

Limitations

Best Practices

How to Use Schema Validator

  1. Paste JSON-LD: Enter your structured data markup in the input textarea.
  2. Click Validate: The tool checks JSON syntax and required fields.
  3. Review report: Check for missing required fields and warnings.
  4. Fix errors: Update your markup based on validation feedback.
  5. Copy report: Use Copy Report to save validation results.

Tips

Frequently Asked Questions

What is JSON-LD structured data?
JSON-LD (JavaScript Object Notation for Linked Data) is a lightweight syntax for expressing structured data using Schema.org vocabulary. It's embedded in web pages using script tags with type='application/ld+json'. Search engines like Google use JSON-LD to understand page content and display rich results (rich snippets, knowledge panels, carousels).
What are required fields for Schema.org types?
Required fields vary by type. Organization requires 'name' and 'url'. Article requires 'headline', 'image', 'datePublished'. Product requires 'name', 'image', 'offers'. FAQPage requires 'mainEntity' with question/answer pairs. LocalBusiness requires 'name', 'address', 'telephone'. Missing required fields may prevent rich result eligibility.
How do I validate JSON-LD syntax?
First, ensure the JSON is valid (proper brackets, quotes, commas). Check that @context and @type are present. Verify property names match Schema.org vocabulary. Use validators like Google's Rich Results Test, Schema Markup Validator, or this tool to catch syntax errors and missing required fields.
What is the difference between @context and @type?
@context defines the vocabulary being used (typically 'https://schema.org' for Schema.org). @type specifies the entity type (e.g., 'Organization', 'Article', 'Product'). @context tells parsers how to interpret terms; @type tells them what kind of thing is being described.
Can JSON-LD have multiple types?
Yes, you can specify multiple types using an array: '@type': ['Article', 'ScholarlyArticle']. This indicates the entity belongs to multiple categories. You can also have multiple separate JSON-LD objects in the same script tag or across multiple script tags on the same page.
What are common JSON-LD errors?
Common errors include: invalid JSON syntax (missing quotes, trailing commas), missing @context or @type, using wrong property names, missing required properties, incorrect nesting of objects, using text where URL is expected, and date format errors (should be ISO 8601: YYYY-MM-DD).