JSON-LD vs Microdata vs RDFa: which to use
Structured data is the concept: labeling your content so machines can read it. The syntax is how you write it into a page, and there are three: JSON-LD, Microdata, and RDFa. They can all express the same Schema.org vocabulary, so the choice is about format, not meaning. For almost everyone the answer is JSON-LD, but it is worth understanding why, and when the others still make sense.
The short version
Google recommends JSON-LD. Its Search Central documentation names JSON-LD as the preferred format because it is the easiest to add and maintain, and Google supports all three where they are implemented correctly. If you have no legacy reason to do otherwise, use JSON-LD and stop reading. The rest of this explains the trade-offs.
JSON-LD: a separate block of data
JSON-LD stands for JavaScript Object Notation for Linked Data. Instead of tagging your visible HTML, you place a single <script type="application/ld+json"> block, usually in the page head, that describes the page's entities as structured data. The visible markup stays untouched.
That separation is the whole appeal. Because the data lives in its own block, a redesign of your HTML will not accidentally break your structured data, and vice versa. You can generate the block server-side, inject it with a tag manager, or template it, without weaving attributes through your content. It is also the natural format for expressing relationships between multiple entities: several nodes in one @graph, each with a unique @id, referencing one another cleanly.
The one thing to keep honest is that the data must still match what is on the page. Because JSON-LD is not attached to visible elements, it is easy to let it drift out of sync, describing a price or a rating that the page no longer shows. Keep them aligned.
Microdata: attributes on your HTML
Microdata is an HTML specification that embeds structured data directly in your visible markup using attributes: itemscope, itemtype, and itemprop. You wrap the element that represents an entity, then label each child element with the property it holds.
The upside is that the data is bound to the content you can see, so it is harder for them to fall out of sync. The downside is that it clutters your HTML, and it is fragile: a template change that moves or removes an element can quietly break the markup, and expressing relationships between separate entities is awkward. Microdata is common in older codebases and in some CMS themes that were built before JSON-LD became the default.
RDFa: attributes with a linked-data heritage
RDFa (Resource Description Framework in attributes) is, like Microdata, an attribute-based approach that annotates visible HTML, using attributes such as vocab, typeof, and property. It comes from the broader linked-data and semantic-web world and is more expressive than Microdata in some respects, including working with vocabularies beyond Schema.org.
In practice, for typical SEO structured data, RDFa carries the same in-markup drawbacks as Microdata: it lives inside your HTML, so it clutters templates and is vulnerable to design changes. You will see it most often on sites with an existing semantic-web investment or specific publishing systems that emit it.
Why the format almost never changes the outcome
A point worth stressing: all three express the same Schema.org vocabulary. A Product is a Product whether you write it as JSON-LD, Microdata, or RDFa. Google does not reward one syntax with better rankings; the choice affects how easy the data is to build and maintain, not what it means. So there is no SEO advantage hidden in the format itself, only in getting the data correct and honest.
A quick comparison
- JSON-LD. Separate script block. Easiest to add and maintain, survives redesigns, best for multiple linked entities. Google's recommended format. Watch for drift from the visible content.
- Microdata. Attributes on visible HTML. Bound to content, but clutters markup, fragile to template changes, awkward for relationships. Common in legacy sites.
- RDFa. Attributes on visible HTML, with linked-data roots and support for other vocabularies. Same in-markup drawbacks as Microdata for typical SEO use.
What to do
For a new build, use JSON-LD. It is what Google recommends, it is the least likely to break, and it is the only one of the three that makes combining several entities on a page genuinely pleasant to write. If you have inherited a site with Microdata or RDFa that works and validates, there is no urgency to rip it out; it is not harming you. But do not maintain two systems at once, and do not add new markup in the older formats when JSON-LD is available.
When you are ready to write some, the generator outputs JSON-LD, and the JSON-LD builder handles the multi-entity @graph case with unique @ids wired for you.