You know your site needs structured data. You've read that it can unlock rich results in search. But then you open a tutorial and hit a wall of unfamiliar terms — JSON-LD, Microdata, RDFa — three different ways to write what looks like the same information, with no clear answer on which one you're actually supposed to pick.
The good news: this decision is a lot simpler than it looks. All three formats describe the same schema.org vocabulary to search engines, they just differ in where the code lives and how much of your HTML it touches. Once you see them side by side, the right choice becomes obvious for almost every site.
JSON-LD, Microdata, and RDFa are three syntaxes for writing the same schema.org structured data. JSON-LD lives in a single separate script block and is Google's recommended format because it's the easiest to add, edit, and validate. Microdata and RDFa are written directly inside your visible HTML using inline attributes, which makes them harder to maintain. For nearly every modern site, JSON-LD is the right default.
What are JSON-LD, Microdata, and RDFa?
All three are syntaxes for writing structured data — most commonly the schema.org vocabulary — into a webpage so search engines can read it. The vocabulary is identical across all three; only the way it's written differs.
- JSON-LD. A self-contained block of JavaScript-style code, usually placed in the page's
<head>, that describes the page's content separately from the visible HTML. - Microdata. A set of HTML attributes —
itemscope,itemtype,itemprop— added directly onto the existing visible elements of a page. - RDFa. Similar to Microdata in that it's inline, but uses attributes like
vocab,typeof, andproperty, originally designed for the broader semantic web rather than schema.org specifically. - Same destination, different route. A search engine parsing any of the three ends up with the same structured facts about the page — a name, a price, a rating — just extracted through a different method.
The practical takeaway: this isn't a choice between three different kinds of structured data. It's a choice about how much you want that structured data entangled with your visible page markup.
Why the format you choose matters
Google parses all three formats correctly, so this isn't about rankings — it's about maintainability, risk, and how your workflow actually works day to day:
- Separation from visible HTML. JSON-LD sits in its own block, so a redesign or content edit doesn't accidentally break your structured data — inline formats can't make that promise.
- Ease of automation. A single JSON-LD block can be generated by a tool or template and dropped in wholesale, while Microdata and RDFa require touching individual HTML elements one at a time.
- Lower risk of visible-content mismatch. Because Microdata and RDFa attributes sit on the same elements a visitor sees, it's easy to accidentally mark up something that no longer matches the visible text after an edit.
- Debugging and validation. A single JSON-LD block is far easier to scan for errors than attributes scattered across dozens of HTML tags.
Step-by-step: choosing and implementing a format
- Default to JSON-LD unless you have a specific reason not to. For the vast majority of sites, JSON-LD is the right starting point — it's Google's recommended format and requires no changes to your existing HTML.
- Check what your CMS or theme already outputs. Some older WordPress themes and plugins still generate Microdata by default; check your page source before adding a second, conflicting format on top.
- Identify the schema.org type for the content. Whether you use JSON-LD, Microdata, or RDFa, the underlying type — Article, Product, FAQPage — needs to accurately match what's on the page.
-
Write or generate the markup in your chosen format. Use a generator tool for JSON-LD, or carefully add
itemscope/itemtype/itempropattributes if you're extending existing Microdata. - Only mark up content that's visible on the page. This rule applies identically to all three formats — invisible or fabricated data violates Google's structured data guidelines regardless of syntax.
- Avoid mixing formats for the same content. Pick one format per page for a given piece of content to prevent duplicate or conflicting data from confusing parsers.
- Validate with the Rich Results Test. Paste the page URL or code snippet in before publishing to confirm there are no errors, regardless of which format you used.
Common mistakes when working with these formats
1. Mixing two formats for the same content
Adding a JSON-LD block for Article data while an old theme still outputs Microdata for the same page creates duplicate, sometimes conflicting, structured data that can confuse validators and search engines alike.
2. Editing visible content without updating inline attributes
With Microdata and RDFa, updating a headline or price in the visible HTML doesn't automatically update the structured data sitting on the same element — the two can quietly drift apart until a validator catches the mismatch.
3. Assuming RDFa's extra flexibility is needed
RDFa supports vocabularies beyond schema.org, but most SEO-focused sites never use that capability. Choosing RDFa for its flexibility when only schema.org properties are needed just adds unnecessary complexity.
4. Never validating after a format migration
Switching from Microdata to JSON-LD without removing the old inline attributes can leave both formats live at once. Skipping validation afterward means a silent conflict can sit unnoticed indefinitely.
Real-world examples
The same Product data, written in each of the three formats, to show how the underlying facts stay identical while the syntax changes:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Trail Running Shoes",
"offers": {
"@type": "Offer",
"price": "89.00",
"priceCurrency": "USD"
}
}
</script>
<div itemscope itemtype="https://schema.org/Product">
<span itemprop="name">Trail Running Shoes</span>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
<span itemprop="price">89.00</span>
<meta itemprop="priceCurrency" content="USD">
</div>
</div>
<div vocab="https://schema.org/" typeof="Product">
<span property="name">Trail Running Shoes</span>
<div property="offers" typeof="Offer">
<span property="price">89.00</span>
<span property="priceCurrency" content="USD"></span>
</div>
</div>
JSON-LD vs Microdata vs RDFa compared
A side-by-side look at how the three formats differ in practice, and where each one tends to fit best.
| Format | Where it lives | Ease of use | Best for |
|---|---|---|---|
| JSON-LD | Separate script block | Easiest to add and edit | Nearly all modern sites; Google's recommended format |
| Microdata | Inline HTML attributes | Tied directly to markup | Legacy sites already using it extensively |
| RDFa | Inline HTML attributes | More complex syntax | Sites with existing RDFa-based content systems or broader semantic-web needs |
Generate your JSON-LD schema markup right now — free
Skip the syntax debate entirely. The Rebrixe Schema Generator builds clean, validated JSON-LD for the most common schema types — Article, Product, FAQPage, Recipe, and more. No account, no watermark, just a ready-to-paste code block.