JSON-LD (JavaScript Object Notation for Linked Data) is the structured data format that Google recommends for adding schema markup to web pages. It uses a simple JSON syntax wrapped in a <script> tag, completely separate from your HTML content.
If you're implementing schema markup in 2026, JSON-LD is the format you should use. Period.
Why JSON-LD over other formats
There are three formats for structured data: JSON-LD, Microdata, and RDFa. Here's why JSON-LD wins:
Separation of concerns. JSON-LD lives in a <script> tag. It doesn't touch your HTML templates. You can add, modify, or remove structured data without changing a single line of your visible markup.
Easier to maintain. Microdata and RDFa embed data properties into HTML attributes. Change your template structure and you might break your schema. JSON-LD is immune to template changes.
Google's explicit preference. Google's developer documentation states: "Google recommends using JSON-LD for structured data whenever possible."
Dynamic generation. JSON-LD is just JSON. It's trivial to generate programmatically from a CMS, API, or database. Microdata requires rendering into HTML attribute strings.
JSON-LD syntax basics
Every JSON-LD block has the same structure:
{
"@context": "https://schema.org",
"@type": "Thing",
"property": "value"
}
Three key elements:
@context— always"https://schema.org"for web structured data@type— the schema type (Organization, Product, Article, etc.)- Properties — type-specific key-value pairs
You embed it in your HTML like this:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Schema Pilot",
"url": "https://www.schemapilot.app"
}
</script>
The <script> tag can go in <head> or <body>. Position doesn't matter to search engines. Most implementations place it in <head> for cleanliness.
Nested objects
Real-world schema markup usually involves nested entities. An Article has an author (Person or Organization). A Product has an offer. A LocalBusiness has an address.
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "JSON-LD: The Complete Guide",
"datePublished": "2026-03-04",
"author": {
"@type": "Organization",
"name": "Schema Pilot",
"url": "https://www.schemapilot.app"
},
"publisher": {
"@type": "Organization",
"name": "Schema Pilot",
"logo": {
"@type": "ImageObject",
"url": "https://www.schemapilot.app/logo.png"
}
}
}
Nesting follows the same pattern: any property value can be another typed object with its own @type and properties.
Multiple entities on one page
You often need multiple schema blocks on a single page. There are two approaches:
Separate script tags
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Organization", "name": "Acme" }
</script>
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "WebSite", "name": "Acme", "url": "https://acme.com" }
</script>
Graph array
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "Organization",
"name": "Acme",
"url": "https://acme.com"
},
{
"@type": "WebSite",
"name": "Acme",
"url": "https://acme.com"
}
]
}
Both approaches are valid. The @graph approach is cleaner when you have many entities and want to link them with @id references.
Use @graph with @id references when entities on a page relate to each other. For example, an Article's author can reference an Organization's @id instead of duplicating the data.
JSON-LD examples for every common type
Organization
The foundation schema for any business or brand.
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Schema Pilot",
"url": "https://www.schemapilot.app",
"logo": "https://www.schemapilot.app/logo.png",
"sameAs": [
"https://twitter.com/schemapilot",
"https://github.com/schemapilot"
]
}
Free Organization Schema Generator
Schools, NGOs, corporations, and similar entities. Generate valid JSON-LD in seconds.
Article / BlogPosting
For blog posts and news content. BlogPosting is a more specific subtype of Article.
{
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": "JSON-LD: The Complete Guide",
"description": "Everything you need to know about JSON-LD structured data.",
"datePublished": "2026-03-04",
"dateModified": "2026-03-04",
"author": {
"@type": "Organization",
"name": "Schema Pilot"
},
"publisher": {
"@type": "Organization",
"name": "Schema Pilot"
}
}
Free Article Schema Generator
News articles and blog content. Generate valid JSON-LD in seconds.
FAQPage
One of the most effective schema types for SEO. Works on any page that answers questions.
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is JSON-LD?",
"acceptedAnswer": {
"@type": "Answer",
"text": "JSON-LD is a structured data format that uses JSON to encode linked data. It's Google's recommended format for schema markup."
}
},
{
"@type": "Question",
"name": "Where do I put JSON-LD on my page?",
"acceptedAnswer": {
"@type": "Answer",
"text": "Place the JSON-LD script tag in your page's <head> or <body>. The position doesn't matter to search engines."
}
}
]
}
Free FAQ Page Schema Generator
Frequently asked questions on webpages. Generate valid JSON-LD in seconds.
Product
Essential for e-commerce. Include offers with price and availability for rich result eligibility.
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Wireless Bluetooth Headphones",
"description": "Premium over-ear headphones with noise cancellation.",
"image": "https://example.com/headphones.jpg",
"brand": {
"@type": "Brand",
"name": "AudioPro"
},
"offers": {
"@type": "Offer",
"price": "149.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock",
"url": "https://example.com/headphones"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.5",
"reviewCount": "127"
}
}
Free Product Schema Generator
Goods and services with offers and reviews. Generate valid JSON-LD in seconds.
LocalBusiness
For businesses with physical locations. Enables map pack results and business info in search.
{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Joe's Coffee Shop",
"image": "https://example.com/joes-coffee.jpg",
"telephone": "+1-555-123-4567",
"address": {
"@type": "PostalAddress",
"streetAddress": "123 Main Street",
"addressLocality": "Portland",
"addressRegion": "OR",
"postalCode": "97201",
"addressCountry": "US"
},
"openingHoursSpecification": [
{
"@type": "OpeningHoursSpecification",
"dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"opens": "07:00",
"closes": "18:00"
}
],
"geo": {
"@type": "GeoCoordinates",
"latitude": "45.5155",
"longitude": "-122.6789"
}
}
Free Local Business Schema Generator
Physical business locations with hours and contact. Generate valid JSON-LD in seconds.
BreadcrumbList
Shows site hierarchy in search results instead of the raw URL.
{
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Home",
"item": "https://www.example.com"
},
{
"@type": "ListItem",
"position": 2,
"name": "Blog",
"item": "https://www.example.com/blog"
},
{
"@type": "ListItem",
"position": 3,
"name": "JSON-LD Guide"
}
]
}
Free Breadcrumb Schema Generator
Navigation chains showing page hierarchy. Generate valid JSON-LD in seconds.
HowTo
For step-by-step guides and tutorials.
{
"@context": "https://schema.org",
"@type": "HowTo",
"name": "How to Add JSON-LD to Your Website",
"step": [
{
"@type": "HowToStep",
"name": "Create the JSON-LD object",
"text": "Write a JSON object with @context, @type, and the relevant properties for your content."
},
{
"@type": "HowToStep",
"name": "Wrap it in a script tag",
"text": "Place the JSON inside a <script type='application/ld+json'> tag."
},
{
"@type": "HowToStep",
"name": "Add to your page",
"text": "Insert the script tag in your page's <head> or <body>."
},
{
"@type": "HowToStep",
"name": "Validate",
"text": "Test with Google's Rich Results Test to confirm validity."
}
]
}
Free How To Schema Generator
Step-by-step instructions and guides. Generate valid JSON-LD in seconds.
Implementing JSON-LD in popular frameworks
Next.js / React
export default function Page() {
const jsonLd = {
"@context": "https://schema.org",
"@type": "Article",
headline: "My Article Title",
datePublished: "2026-03-04",
};
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<article>{/* content */}</article>
</>
);
}
Static HTML
Paste the <script type="application/ld+json"> block directly into your HTML. Put it in <head> for cleanliness:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"name": "My Page"
}
</script>
</head>
<body>...</body>
</html>
WordPress
Use a plugin like Yoast SEO or Rank Math for automatic schema. For custom JSON-LD, add a custom HTML block or use the wp_head action to inject script tags.
Google Tag Manager
You can inject JSON-LD through GTM using a Custom HTML tag. This is useful when you don't have direct access to page templates. Just make sure the tag fires on the correct pages.
Google has confirmed they can read JSON-LD injected via JavaScript (including GTM). However, server-rendered JSON-LD is always more reliable. Use GTM injection only when you can't modify page templates directly.
Validating JSON-LD
Always validate before deploying. Two essential tools:
Google Rich Results Test
search.google.com/test/rich-results — tests a URL or code snippet against Google's requirements. Shows which rich result types are eligible and flags errors/warnings.
Schema Markup Validator
validator.schema.org — validates against the full Schema.org specification (broader than Google's supported subset). Useful for catching syntax errors.
Common validation errors
| Error | Fix |
|---|---|
| Missing required property | Add the required field (check Google's docs for each type) |
| Invalid URL format | Use full URLs including protocol (https://) |
| Invalid date format | Use ISO 8601 format (YYYY-MM-DD) |
| Incorrect @type | Check spelling and capitalization against Schema.org |
| Duplicate properties | Remove duplicated key-value pairs |
JSON-LD best practices
-
One primary entity per page. A product page should have Product schema. A blog post should have Article schema. Don't try to mark up everything.
-
Match visible content. Every piece of data in your JSON-LD must match what users see on the page. Mismatches can trigger manual actions.
-
Use specific types.
BlogPostingis better thanArticle.LocalBusinessis better thanOrganizationfor a business with a physical location. More specific types give search engines clearer signals. -
Keep it current. Prices change, hours change, content updates. Your JSON-LD must reflect the current state of the page. Stale data is worse than no data.
-
Don't mark up hidden content. If content isn't visible to users, don't include it in schema markup. This includes content hidden behind tabs, accordions, or CSS.
Automating JSON-LD generation
Writing JSON-LD by hand works for a few pages. At scale, you need automation.
Options range from simple (template variables that populate JSON-LD from your CMS) to comprehensive (tools that scan your pages and generate the right schema types automatically).
Schema Pilot takes the fully automated approach: it analyzes each page's content, determines the appropriate schema types, generates valid JSON-LD, and serves it via a lightweight embed script — no manual JSON writing, no template changes, no ongoing maintenance.
Stop writing schema markup by hand
Schema Pilot scans your pages, generates valid JSON-LD, and serves it automatically. No code changes required.
Key takeaways
- JSON-LD is the only structured data format you should use in 2026
- Place it in a
<script type="application/ld+json">tag in your<head>or<body> - Always include
@context,@type, and the required properties for your chosen type - Use
@graphwhen you have multiple related entities on one page - Validate every implementation with Google's Rich Results Test
- Keep your JSON-LD in sync with visible page content — mismatches risk penalties
- For sites with many pages, automate generation rather than maintaining JSON-LD by hand