JSON-LD vs Microdata for Ecommerce: Which Schema Format Should You Use
Three formats exist for structured data: JSON-LD, Microdata, and RDFa. Here's why JSON-LD wins for ecommerce in 2026, with examples of each.
Search engines accept three formats for structured data: JSON-LD, Microdata, and RDFa. Each does the same job — telling Google what your page is about — but they differ in how they're embedded, how easy they are to maintain, and how Google ranks them in its own preferences.
For ecommerce in 2026, JSON-LD wins on every measurable axis. This guide explains why, with side-by-side examples for product schema.
The Three Formats
JSON-LD (JavaScript Object Notation for Linked Data)
Embedded as a separate <script type="application/ld+json"> block, usually in the <head>. Looks like JSON, completely separate from the rendered HTML.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Patagonia Better Sweater Fleece",
"image": "https://example.com/img.jpg",
"offers": {
"@type": "Offer",
"price": "129.00",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
}
}
</script>
Microdata
Inline HTML attributes (itemscope, itemtype, itemprop) wrapping visible content. Couples your structured data to your HTML structure.
<div itemscope itemtype="https://schema.org/Product">
<span itemprop="name">Patagonia Better Sweater Fleece</span>
<img itemprop="image" src="...">
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
<span itemprop="price">129.00</span>
<meta itemprop="priceCurrency" content="USD">
</div>
</div>
RDFa (Resource Description Framework in Attributes)
Similar to Microdata but uses different attributes (vocab, typeof, property). Mostly used for academic and government sites, rarely for ecommerce.
Why JSON-LD Wins for Ecommerce
1. Google Recommends It
Google's official documentation states JSON-LD is "the recommended format" for structured data. While Google still parses Microdata and RDFa, every new schema example in their docs uses JSON-LD. Following Google's preferred format reduces the chance of edge cases where one format works and another doesn't.
2. Decoupling From HTML Makes Maintenance Easier
Microdata embeds schema markers directly into your visible HTML. If your designer wraps a product name in a different tag, the schema can break silently. JSON-LD lives in its own block — your visual templates can be redesigned without touching schema, and schema changes don't require touching templates.
3. Easier to Generate Programmatically
Most ecommerce platforms now generate product schema as JSON-LD. Shopify's built-in product templates include JSON-LD. Liquid, Twig, Blade, and JSX templates all output JSON cleanly. Generating Microdata from a template requires interleaving attribute strings into your HTML, which is harder to validate.
4. Includes Data Not Visible on the Page
Microdata can only mark up what's already visible to users. If you want to include manufacturer SKUs, GTINs, or shipping details that aren't shown in your visible HTML, you need to add them as hidden text or meta tags — clutter that JSON-LD avoids entirely.
5. Validation and Debugging Are Easier
JSON-LD is plain JSON. Paste it into a validator, get a clear error. Microdata errors require parsing the rendered HTML and tracing attribute relationships — slower, harder to debug.
6. Multiple Schema Types Per Page Without Conflict
A product page often needs Product, Offer, Review, AggregateRating, Brand, and BreadcrumbList schemas. With JSON-LD, you can either nest them in one block or use separate <script> tags. With Microdata, you have to interleave them into your HTML structure, which gets ugly fast.
When Microdata Is Still Acceptable
Microdata isn't broken — it's just no longer the best option. You can keep existing Microdata if:
- Your platform generates it automatically and migration is expensive
- Your team has more bandwidth to maintain HTML than separate JSON
- You're constrained by a CMS that only supports Microdata
Don't mix formats on the same page — pick one. Mixing JSON-LD and Microdata for the same product can create duplicate or conflicting interpretations.
The Mobile-First Argument
Mobile-first indexing means Google's crawler renders the mobile version of your page. Heavy Microdata markup adds bytes to every HTML response. JSON-LD is typically smaller — the schema block is one self-contained chunk that compresses well, and you don't pay the per-element attribute overhead.
Recommended JSON-LD Schemas for Ecommerce
- Product — every product page (with Offer, AggregateRating, Review)
- BreadcrumbList — every product and category page
- Organization — homepage (with logo, social links, contact)
- WebSite — homepage (enables sitelinks search box)
- FAQPage — FAQ pages and product pages with Q&A
- Article / BlogPosting — every blog post
- VideoObject — pages with video product demos
Validation Tools
- Google Rich Results Test — what Google specifically extracts and which rich results you qualify for
- Schema.org Validator — strict validation of any structured data format
- Google Search Console → Enhancements — ongoing report of schema errors detected on your live site
- StoreVitals scans — flags pages missing structured data and detects which format(s) you're using
If You're Migrating From Microdata to JSON-LD
- Generate the JSON-LD equivalents for your top page templates first (homepage, product, collection)
- Add JSON-LD alongside existing Microdata on a small percentage of pages
- Verify in Google Search Console that no rich results are lost
- Roll out site-wide
- Remove the Microdata after verifying JSON-LD is working
- Monitor for two weeks before considering the migration complete
The migration usually pays for itself in cleaner templates and easier ongoing schema maintenance, even if rich result coverage stays the same.
Run a free StoreVitals scan to see which pages on your store have structured data, what format they use, and which key schemas are missing.