JSON-LD vs Microdata vs RDFa: Which Format Should You Use?

Last Updated: February 25, 2026 · 11 min read

There are three ways to add structured data to a page: JSON-LD, Microdata, and RDFa. All three are understood by Google. Only one is recommended. This guide shows you the same Product schema written in all three formats, explains Google's documented preference, and walks through migrating legacy Microdata to JSON-LD.

TL;DR: Use JSON-LD

Google explicitly recommends JSON-LD as the preferred format for structured data. If you're starting fresh, use JSON-LD. If you have legacy Microdata, migrate it.

1. Side-by-Side: Same Schema in All Three Formats

The following examples all describe the same thing: a product named "Wireless Headphones" priced at $79.99.

JSON-LD ✅ (Recommended)

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Wireless Headphones",
  "offers": {
    "@type": "Offer",
    "price": "79.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}
</script>

Microdata ⚠️ (Avoid for new projects)

<div itemscope itemtype="https://schema.org/Product">
  <span itemprop="name">Wireless Headphones</span>
  <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    <span itemprop="price" content="79.99">$79.99</span>
    <meta itemprop="priceCurrency" content="USD">
    <link itemprop="availability" href="https://schema.org/InStock">
  </div>
</div>

RDFa ⚠️ (XML/XHTML contexts only)

<div vocab="https://schema.org/" typeof="Product">
  <span property="name">Wireless Headphones</span>
  <div property="offers" typeof="Offer">
    <span property="price" content="79.99">$79.99</span>
    <span property="priceCurrency" content="USD"></span>
    <link property="availability" href="https://schema.org/InStock">
  </div>
</div>

2. Comparison Table

CriterionJSON-LDMicrodataRDFa
Google recommendation✅ Recommended⚠️ Supported⚠️ Supported
Separated from HTML✅ Completely❌ Inline attributes❌ Inline attributes
Easy to update✅ One JSON block❌ Spread across HTML❌ Spread across HTML
Works with SPAs/JS frameworks✅ Server-rendered❌ Brittle with React❌ Brittle with React
Supports nested entities✅ Clean nesting⚠️ Verbose⚠️ Complex
Readable for non-devs✅ Clear JSON❌ HTML clutter❌ Attribute soup
Standard bodyW3C + Google endorsedW3C HTML5W3C
Best forAny new projectLegacy sites onlyXHTML / CMS with RDFa built-in

3. How to Migrate Microdata to JSON-LD

1

Audit existing Microdata — run a crawl (Screaming Frog, Sitebulb) and export all pages with itemscope/itemtype attributes. This gives you the full migration scope.

2

Map each Microdata block to its JSON-LD equivalent. The @type value is the same as itemtype URL path. The itemprop names become JSON keys.

3

Write the JSON-LD equivalent (or generate it with a tool). Validate the new JSON-LD with SchemaValidator.org before removing the Microdata.

4

Deploy JSON-LD and Microdata simultaneously for one crawl cycle (1–2 weeks). This prevents a gap in Google's structured data index.

5

Remove the Microdata attributes from HTML. Clean HTML reduces rendering complexity and maintenance burden.

6

Confirm in GSC Enhancements — validate counts should remain stable or increase. If they drop, check for migration errors.

4. JavaScript Frameworks: Why Microdata Is a Maintenance Problem

If your site uses React, Vue, Next.js, Angular, or any JavaScript-rendered architecture, Microdata becomes a serious technical liability:

⚠️ Attributes scattered across components

Microdata requires itemscope, itemtype, and itemprop on the exact HTML elements that render the data. In a React component tree, these attributes are spread across many files. Adding or updating schema means touching multiple components simultaneously.

⚠️ SSR hydration conflicts

Server-side rendered HTML with Microdata attributes sometimes causes React hydration mismatches when client-side state does not perfectly mirror the server-rendered attributes. JSON-LD in a single script block has no hydration impact whatsoever.

⚠️ Googlebot rendering unpredictability

Microdata attributes on dynamically inserted elements (added via JavaScript after DOM load) can be missed by Googlebot depending on its rendering queue. JSON-LD in the document head is always crawled reliably.

⚠️ Team maintenance complexity

Junior developers or non-technical content editors working in component files may accidentally remove itemprop attributes during UI changes without realising the SEO impact. JSON-LD isolated in a separate script is far easier to protect.

5. Common Errors When Converting Microdata to JSON-LD

Most migration mistakes are mechanical. Here are the patterns that appear repeatedly in schema audits:

Microdata sourceIncorrect JSON-LD migrationCorrect JSON-LD
itemtype='https://schema.org/Product'"type": "Product""@type": "Product"
itemprop='image' content='url'"image": "url""image": { "@type": "ImageObject", "url": "..." }
itemprop='ratingValue'"ratingValue": 4.5"aggregateRating": { "@type": "AggregateRating", "ratingValue": "4.5" }
Nested itemscope blocksFlat JSON propertiesNested JSON objects with @type on each entity
meta itemprop='price' content='19.99'"price": 19.99 (number)"price": "19.99" (string)

6. Is RDFa Ever the Right Choice?

RDFa has genuine use cases, even in 2026. It is worth knowing when to use it rather than defaulting to JSON-LD:

CMS hardcoded RDFa support

Some older enterprise CMSes and EPiServer/Sitecore deployments have RDFa built into their default templates. The cost of stripping it out may exceed the maintenance benefit of migrating to JSON-LD. If it is working and producing no validation errors, leave it.

XHTML document requirements

Organisations publishing XHTML 1.0 documents (academic journals, government publications, legacy web standards contexts) use RDFa because it integrates cleanly with strict XHTML markup where custom script tags are discouraged.

Semantic annotation of inline content

RDFa is designed to annotate the actual visible text on the page. For content where the schema annotation must be tied to the exact displayed text (some academic citation systems, linked data applications), RDFa is architecturally more appropriate than JSON-LD.

Linked Open Data publishing

If you are publishing general-purpose linked data for consumption by multiple systems beyond just search engines, RDFa and Turtle are more standard choices than JSON-LD. JSON-LD was designed with search engine consumption as the primary use case.

7. Performance Impact: JSON-LD, Microdata, and Page Speed

All three formats are essentially zero-impact on Core Web Vitals when implemented correctly, but there are practical differences:

JSON-LD in <head>

Script tags in <head> are render-blocking by default. However, application/ld+json scripts are NOT render-blocking — Google's spec ensures parsers skip the content block and do not block HTML rendering.

Inline JSON-LD in <body>

Same behaviour as in <head>. Non-blocking. Slightly less clean architecturally but functionally identical.

Microdata on HTML elements

Zero additional HTTP requests. However, attribute bloat on complex schemas can increase HTML payload size by 1–10kB for dense product pages. Minor, but worth noting.

RDFa on HTML elements

Similar to Microdata. Attribute-heavy RDFa can marginally inflate HTML size but does not affect render-blocking or JavaScript execution.

Frequently Asked Questions

Does Google treat JSON-LD and Microdata as equal for rich results?

Both formats are technically eligible for rich results, but Google officially recommends JSON-LD. In practice, JSON-LD is less error-prone because it is isolated from HTML. Any rendering issue specific to Microdata (JS hydration conflicts, missed attributes) will not affect a properly server-rendered JSON-LD block.

Can I mix JSON-LD and Microdata on the same page?

Yes. Google can parse both on the same page. However, you must not duplicate the same entity in both formats simultaneously — this creates conflicting signals. If you are migrating, run both temporarily for one crawl cycle, then remove the Microdata.

Is Microdata still valid for Product schema?

Technically yes, but it is error-prone for e-commerce. Product schema requires nested entities (Offer, AggregateRating, Brand). Expressing these as nested itemscope blocks in HTML components is fragile and difficult to maintain compared to a single JSON-LD object in a server component.

What about Schema.org's own examples — they use many formats. Which should I follow?

Schema.org shows examples in Microdata, RDFa, and JSON-LD for documentation purposes. The Google Search documentation is the authoritative guide for rich results — and it uses JSON-LD in every example. Follow Google's documentation for SEO purposes.

How long does migrating a 500-page site from Microdata to JSON-LD take?

For a template-driven site (WordPress, Shopify, custom CMS), the migration typically affects 3–10 templates, not 500 individual pages. One developer should be able to migrate a typical CMS site in 1–3 days. The longest part is usually auditing existing Microdata coverage and validating all schema types post-migration.

Does RDFa 1.1 Lite work with Google?

Yes — RDFa 1.1 Lite is supported. However, the same maintainability concerns apply. Unless your CMS or publishing system generates RDFa automatically, switching to JSON-LD is almost always lower-effort to maintain and produces fewer validation errors.

What is the easiest way to find all Microdata on my site?

Run a Screaming Frog crawl with Custom Extraction configured to extract elements matching [itemscope]. This gives a URL-by-URL inventory. Alternatively, run `grep -r "itemscope" ./` in your project source to find all template files using Microdata attributes.

After migrating, how long before Google updates its rich result count?

GSC rich result reports update when Googlebot recrawls and reprocesses those pages. For a typical site, expect 1–4 weeks for most pages to refresh. High-priority pages (homepage, top linked pages) typically recrawl within a few days. Use the URL Inspection tool for individual fast-reindex requests.

Validate Your JSON-LD or Microdata

SchemaValidator.org supports both JSON-LD and Microdata validation — paste your code or enter a URL.

Validate Structured Data →