Learn/Practical Guides

JSON-LD & Structured Data for SEO

JSON-LD is how you tell search engines what your content means. This guide shows you how to implement structured data for rich snippets — FAQ accordions, star ratings, breadcrumb trails, product cards, and more — all using the JSON you already know.

What Is JSON-LD?

JSON-LD (JSON for Linked Data) is a lightweight format for encoding structured data using JSON. It maps your content to the Schema.org vocabulary so search engines understand the meaning of your pages — not just the text.

Basic JSON-LD in HTMLhtml
1<script type="application/ld+json">
2{
3 "@context": "https://schema.org",
4 "@type": "Article",
5 "headline": "JSON-LD & Structured Data for SEO",
6 "author": {
7 "@type": "Person",
8 "name": "DevToolsBuilder Team"
9 },
10 "datePublished": "2026-04-02",
11 "description": "Learn how to implement JSON-LD structured data."
12}
13</script>
How JSON-LD Works

The @context and @type Properties

Every JSON-LD block needs two required properties:

PropertyPurposeExample
@contextThe vocabulary being used"https://schema.org"
@typeThe schema type (what this data describes)"Article", "Product", "FAQPage"

Tip

@context is almost always "https://schema.org". The @type determines which properties are valid. Check the Schema.org type list for all options.

Essential Schema Types for Developers

1. Article / BlogPosting

For blog posts, guides, and documentation pages:

1{
2 "@context": "https://schema.org",
3 "@type": "Article",
4 "headline": "JSON-LD & Structured Data for SEO",
5 "author": { "@type": "Person", "name": "Alice Chen" },
6 "publisher": {
7 "@type": "Organization",
8 "name": "DevToolsBuilder",
9 "logo": { "@type": "ImageObject", "url": "https://devtoolsbuilder.com/logo.png" }
10 },
11 "datePublished": "2026-04-02",
12 "dateModified": "2026-04-02",
13 "image": "https://devtoolsbuilder.com/og/json-ld-seo.png",
14 "description": "Complete guide to implementing JSON-LD structured data."
15}

2. FAQPage

Displays FAQ accordions directly in search results — one of the highest-impact schema types:

1{
2 "@context": "https://schema.org",
3 "@type": "FAQPage",
4 "mainEntity": [
5 {
6 "@type": "Question",
7 "name": "What is JSON-LD?",
8 "acceptedAnswer": {
9 "@type": "Answer",
10 "text": "JSON-LD is a format for encoding structured data using JSON syntax."
11 }
12 },
13 {
14 "@type": "Question",
15 "name": "Does JSON-LD help SEO?",
16 "acceptedAnswer": {
17 "@type": "Answer",
18 "text": "Yes — it enables rich results that increase click-through rates."
19 }
20 }
21 ]
22}

3. BreadcrumbList

Shows a navigational breadcrumb trail in search results:

1{
2 "@context": "https://schema.org",
3 "@type": "BreadcrumbList",
4 "itemListElement": [
5 { "@type": "ListItem", "position": 1, "name": "Home", "item": "https://devtoolsbuilder.com/" },
6 { "@type": "ListItem", "position": 2, "name": "Learn", "item": "https://devtoolsbuilder.com/learn" },
7 { "@type": "ListItem", "position": 3, "name": "JSON-LD & SEO" }
8 ]
9}

4. SoftwareApplication

For web tools and applications — shows ratings and pricing in search:

1{
2 "@context": "https://schema.org",
3 "@type": "SoftwareApplication",
4 "name": "JSON Validator",
5 "applicationCategory": "DeveloperApplication",
6 "operatingSystem": "Web",
7 "offers": {
8 "@type": "Offer",
9 "price": "0",
10 "priceCurrency": "USD"
11 }
12}

5. HowTo

For step-by-step guides and tutorials:

1{
2 "@context": "https://schema.org",
3 "@type": "HowTo",
4 "name": "How to Validate JSON",
5 "step": [
6 { "@type": "HowToStep", "text": "Paste your JSON into the validator." },
7 { "@type": "HowToStep", "text": "Click 'Validate' to check for errors." },
8 { "@type": "HowToStep", "text": "Fix any highlighted syntax issues." }
9 ]
10}

6. Product

For e-commerce and SaaS product pages:

1{
2 "@context": "https://schema.org",
3 "@type": "Product",
4 "name": "JSON Pro Toolkit",
5 "description": "Professional JSON development suite.",
6 "offers": {
7 "@type": "Offer",
8 "price": "29.99",
9 "priceCurrency": "USD",
10 "availability": "https://schema.org/InStock"
11 },
12 "aggregateRating": {
13 "@type": "AggregateRating",
14 "ratingValue": "4.8",
15 "reviewCount": "124"
16 }
17}

JSON-LD in Next.js

In Next.js (App Router), the recommended approach is to render JSON-LD in a server component:

components/JsonLd.tsxtypescript
1interface JsonLdProps {
2 data: Record<string, unknown>;
3}
4
5export function JsonLd({ data }: JsonLdProps) {
6 return (
7 <script
8 type="application/ld+json"
9 dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
10 />
11 );
12}
13
14// Usage in a page
15<JsonLd data={{
16 "@context": "https://schema.org",
17 "@type": "Article",
18 "headline": "My Article Title",
19 "author": { "@type": "Person", "name": "Alice" },
20}} />

Tip

Use JSON.stringify() to ensure the data is valid JSON. Never manually write JSON strings in template literals — that is error-prone and vulnerable to injection.

Common Mistakes

1. Missing Required Properties

Each schema type has required fields. For Article, you need headline, author, and datePublished. Google will ignore incomplete schemas.

2. Mismatched Content

The structured data must match visible page content. If your JSON-LD says the price is $29.99 but the page shows $39.99, Google may penalize or ignore the markup.

3. Using Wrong @type

Using BlogPosting for a product page or Product for a blog post will not trigger the right rich results and may be seen as spam.

4. Invalid JSON Syntax

Trailing commas, unquoted keys, or single quotes will break the entire JSON-LD block. Use a JSON Validator before deploying.

Testing & Debugging

ToolURLPurpose
Rich Results Testsearch.google.com/test/rich-resultsTest if your page qualifies for rich results
Schema Markup Validatorvalidator.schema.orgValidate JSON-LD against Schema.org specs
Google Search Consolesearch.google.com/search-consoleMonitor structured data errors across your site

Try It — Validate JSON-LD Syntax

Try It Yourself

Valid FAQPage JSON-LD — try adding more questions

Frequently Asked Questions

What is JSON-LD?
JSON-LD (JSON for Linked Data) is a method of encoding structured data using JSON syntax. It uses @context and @type properties to link your data to Schema.org vocabulary, allowing search engines to understand the meaning of your content — not just the text.
Does JSON-LD affect SEO rankings?
JSON-LD structured data does not directly boost rankings, but it enables rich results (stars, prices, FAQs, breadcrumbs) in search. Rich results significantly increase click-through rates, which indirectly improves your search performance.
Where should I place JSON-LD in HTML?
Place JSON-LD inside a <script type="application/ld+json"> tag, typically in the <head> section. Google reads it from anywhere in the HTML, but the head is conventional. In Next.js, use the metadata API or a dedicated component.
Can I have multiple JSON-LD blocks on one page?
Yes. You can have separate <script type="application/ld+json"> tags for different schema types (e.g., one for Article, one for BreadcrumbList, one for FAQPage). Google processes all of them.
What is the difference between JSON-LD, Microdata, and RDFa?
All three are formats for structured data. JSON-LD uses a script tag with JSON — it is separate from your HTML markup. Microdata and RDFa embed attributes directly in HTML elements. Google recommends JSON-LD because it is easier to implement, maintain, and debug.
How do I test my JSON-LD?
Use Google's Rich Results Test (search.google.com/test/rich-results) or the Schema Markup Validator (validator.schema.org). Both will parse your JSON-LD, flag errors, and show which rich result types are eligible.