JSON-LD vs Microdata vs RDFa: Differences and Which to Use
JSON-LD, Microdata and RDFa compared: syntax, Google support and maintenance, with an example in each format, a comparison table and a recommendation.

JSON-LD, Microdata and RDFa are three ways to write the same schema.org structured data. JSON-LD puts the data in a separate <script type="application/ld+json"> block as JSON, independent of the visible HTML. Microdata adds itemscope, itemtype and itemprop attributes to the visible elements. RDFa also annotates the visible elements, with vocab, typeof and property attributes, and comes from the wider RDF and Linked Data world. Google reads all three and treats them equally for rich results, but recommends JSON-LD because it is the easiest to write and maintain. For new work, use JSON-LD.
The rest of this article shows the same entity in each syntax, compares them side by side, and explains when Microdata or RDFa still make sense.
The three formats in one example
A minimal Organization in each syntax. In JSON-LD the markup is a separate script, independent of the visible HTML:
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Organization", "name": "ACME", "url": "https://acme.example/" }
</script>
In Microdata the markup is attributes on the visible elements themselves:
<div itemscope itemtype="https://schema.org/Organization">
<a itemprop="url" href="https://acme.example/"><span itemprop="name">ACME</span></a>
</div>
In RDFa the idea is the same as Microdata, with different attribute names:
<div vocab="https://schema.org/" typeof="Organization">
<a property="url" href="https://acme.example/"><span property="name">ACME</span></a>
</div>
What RDFa is, and how it differs from Microdata
RDFa (Resource Description Framework in Attributes) is a W3C standard for embedding RDF data in HTML. The subset that search engines care about is RDFa Lite, which has five attributes:
vocabsets the vocabulary, usuallyhttps://schema.org/.typeofstarts an entity and sets its type, likeitemscope+itemtypein Microdata.propertynames a property, likeitemprop.resourcegives the entity an identifier (a URL), which other entities can refer to.prefixlets you mix several vocabularies on one page, such as schema.org and Open Graph.
The practical differences from Microdata are small: RDFa can combine vocabularies and link entities by identifier, Microdata cannot do either cleanly. In return RDFa is more verbose and fewer people know it. You will meet it mostly in older CMS themes (Drupal shipped RDFa by default for years) and in sites built around Linked Data. Like Microdata, it is tied to the HTML structure, so a template change can silently break it.
JSON-LD vs Microdata vs RDFa compared
| JSON-LD | Microdata | RDFa | |
|---|---|---|---|
| Where the data lives | Separate <script> block |
Attributes on visible elements | Attributes on visible elements |
| Syntax | JSON | itemscope, itemtype, itemprop |
vocab, typeof, property |
| Google rich results | Supported, recommended | Supported | Supported |
| Survives a redesign | Yes, independent of layout | Breaks if elements move or lose attributes | Breaks if elements move or lose attributes |
| Matches visible content | Your job to keep in sync | Automatically, it annotates the content | Automatically, it annotates the content |
Nested entities and @id links |
Easy, including @graph |
Awkward, itemref only |
Possible via resource |
| Several vocabularies on a page | Yes, via @context |
No | Yes, via prefix |
| Generated by CMS and SEO plugins | Almost always | Some older themes | Rare, mostly older Drupal |
| Easy to test in code | Yes, it is plain JSON | Needs an HTML parser | Needs an RDFa parser |
What Google says
Google’s documentation recommends JSON-LD, and new features are usually documented with JSON-LD examples first. Microdata and RDFa remain fully supported for all rich result types; there is no ranking or eligibility difference. The recommendation is about ease of implementation, not about results.
Why JSON-LD usually wins
- It is decoupled from the layout. A redesign cannot accidentally drop an
itempropfrom a heading. The markup is generated from data, not from the DOM structure. - It can describe things that are not on the page in the same shape. Nested entities,
@graph,@idreferences between blocks: all of this is awkward or impossible in Microdata. - It is easy to generate and test. It is just JSON: serialize an object, assert on it in a unit test, validate it in CI.
- It is easy to inject from a CMS plugin without touching templates, which is why most SEO plugins use it.
Where Microdata still makes sense
- The site already has it and it works. Rewriting correct Microdata to JSON-LD gains nothing in search. Spend the effort on pages that have no markup.
- You want the markup to be guaranteed to match the visible content. Because Microdata annotates the real elements, the price in the markup is the price the user sees. With JSON-LD, keeping the two in sync is your job.
- Email markup and some other consumers historically preferred Microdata. This is niche.
Where RDFa still makes sense
- Your CMS emits it and it validates. As with Microdata, a rewrite brings no search benefit.
- You publish Linked Data. If the same pages feed RDF tools, knowledge graphs or library catalogues, RDFa lets one set of attributes serve both search engines and those consumers.
- You need several vocabularies on the same elements. RDFa’s
prefixhandles this; Microdata has no equivalent.
If none of these apply, there is no reason to start a new project in RDFa.
The mixed-format trap
The one thing to avoid is two formats describing the same entity on one page with different values: Microdata in the theme says the product costs 19.99, the plugin’s JSON-LD says 24.99. Google may pick either, and validators report duplicate entities. If you migrate, remove the old format in the same release.
Mixed formats describing different things are fine: breadcrumbs in Microdata from the theme and a Product in JSON-LD from the shop plugin coexist without conflict.
Checking each format
Whichever syntax you use, validate against three layers: syntax, the schema.org vocabulary, and Google’s per-type requirements. The Schema Markup Checker extracts both JSON-LD and Microdata from a page and reports them side by side. RDFa is detected and flagged, but not validated yet. For Microdata the Chrome extension highlights the annotated elements on the page itself, which is the fastest way to see which itemprop a template forgot.
FAQ
What’s the difference between JSON-LD, Microdata and RDFa?
They are three syntaxes for the same schema.org data. JSON-LD is a separate JSON script; Microdata and RDFa are attributes added to the visible HTML elements, with different attribute names. Google supports all three equally for rich results.
Which format does Google recommend?
JSON-LD. Google supports Microdata and RDFa just as well, but recommends JSON-LD because it is easier to add and maintain at scale.
Is JSON-LD better for SEO than Microdata?
No. Rankings and rich result eligibility do not depend on the format. JSON-LD is better for maintenance: it is less likely to break when templates change.
Can I use JSON-LD and Microdata on the same page?
Yes, as long as they describe different entities. Do not describe the same entity in both formats, especially with different values.
Should I convert my Microdata or RDFa to JSON-LD?
Only if it is broken or you are rebuilding the templates anyway. Markup that already validates gains nothing in search from a rewrite.
Recommendation
For new work, use JSON-LD, rendered on the server, generated from the same data that renders the page. For existing Microdata or RDFa that validates cleanly, leave it alone, and never run two formats on the same entity. Then put a site scan on a schedule so the next redesign does not quietly break what you built.