JSON-LD vs Microdata vs RDFa: Which Format Should You Use?
Google supports three structured data formats: JSON-LD, Microdata, and RDFa. All three can enable rich results. Only one of them is worth using in 2026.
The short answer
Use JSON-LD. Google officially recommends it. It is the only format that keeps structured data completely separate from your HTML, making it easier to write, maintain, and test. The other two formats exist for legacy reasons and should not be chosen for new projects.
What each format looks like
JSON-LD โ structured data in a script tag (recommended)
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [{ "@type": "Question", "name": "Is this free?", "acceptedAnswer": { "@type": "Answer", "text": "Yes." } }]
}
</script>Microdata โ attributes embedded in HTML (not recommended)
<div itemscope itemtype="https://schema.org/FAQPage">
<div itemprop="mainEntity" itemscope itemtype="https://schema.org/Question">
<h3 itemprop="name">Is this free?</h3>
<div itemprop="acceptedAnswer" itemscope itemtype="https://schema.org/Answer">
<p itemprop="text">Yes.</p>
</div>
</div>
</div>RDFa โ a superset of Microdata, more flexible but more complex (not recommended)
<div vocab="https://schema.org/" typeof="FAQPage">
<div property="mainEntity" typeof="Question">
<h3 property="name">Is this free?</h3>
<div property="acceptedAnswer" typeof="Answer">
<p property="text">Yes.</p>
</div>
</div>
</div>The comparison
| Criterion | JSON-LD | Microdata | RDFa |
|---|---|---|---|
| Google recommended | โ Yes | โ ๏ธ Supported | โ ๏ธ Supported |
| Separate from HTML | โ Yes | โ Inline attrs | โ Inline attrs |
| Works with React/Next.js | โ Easy | โ ๏ธ Manual | โ ๏ธ Manual |
| Easy to test / validate | โ Copy-paste | โ ๏ธ Harder | โ ๏ธ Harder |
| Dynamic data support | โ JS object | โ ๏ธ Re-render DOM | โ ๏ธ Re-render DOM |
| Can describe off-page content | โ Yes | โ No | โ ๏ธ Limited |
When Microdata or RDFa might appear
- โLegacy CMS that inlines Microdata (e.g. old WordPress plugins) โ migrate to JSON-LD when you can
- โContent that must be semantically annotated for non-Google consumers (academic publishing, government data portals)
- โExisting RDFa-heavy Drupal or older Joomla sites โ migration cost may not be worth it
The one exception: Open Graph tags
Open Graph tags (og:title, og:image, etc.) are not Schema.org and use neither JSON-LD, Microdata, nor RDFa. They live in <meta> tags in your <head> and control how links appear when shared on LinkedIn, X, Slack, and iMessage. They are separate from structured data entirely and are always required alongside your JSON-LD.
To generate JSON-LD without writing it by hand, use the Schema.org JSON-LD Generator โ supports FAQPage, Product, Article, LocalBusiness, and BreadcrumbList with live validation and a copy button.
Try the related tool
Schema.org JSON-LD Generator โ free, runs 100% in your browser.
Open Schema.org JSON-LD Generator โEnjoyed this? Get notified when Pro launches.
