Picture a florist who sells bouquets online. The shop wants AI tools to read the name, the price, and the stock status of each bouquet without guessing. There are three ways to write those facts in code, and they all use the same vocabulary from schema.org. The choice is not about which facts to state. It is about where the facts sit on the page, who has to maintain them, and which format your shop system makes easy. This guide compares the three formats, shows the same bouquet in the two most common ones, and helps you pick the one to use.

The three formats are JSON-LD, microdata, and RDFa. Google supports all three, unless a feature's documentation says otherwise. Google recommends JSON-LD, and says all three are equally fine for Google as long as the markup is valid and properly implemented. That sentence is the whole decision in short form. The rest of this guide explains why it is true, and when the other two still make sense.

The vocabulary is the same. The format is the wrapping.

Start with the distinction that matters most. Schema.org is the vocabulary: the shared list of types and properties, such as Product, Offer, price, and availability. JSON-LD, microdata, and RDFa are formats: three different ways of writing that vocabulary into a page. The same facts, written in any of the three, describe the same product. A tool that reads schema.org should understand all three, because the meaning comes from the vocabulary, not from the wrapping.

That means you do not gain new facts by switching formats. A shop that writes its price in microdata and switches to JSON-LD has the same price, the same stock status, and the same product name, written in a different place. What changes is maintenance: how easy the code is to write, to read, to test, and to keep in step with the page.

Google's own introduction to structured data puts it this way: in general, use the format that is easiest for you to implement and maintain, and in most cases that is JSON-LD. The recommendation is about ease, not about Google reading one format better than another. All three are equally fine for Google when the markup is valid.

JSON-LD: a separate block, away from the visible text

JSON-LD stands for JavaScript Object Notation for Linked Data. It is a block of data inside a script tag, placed in the head or the body of the page, separate from the text shoppers see. The markup is not mixed in with the visible HTML, which makes nested facts easier to express, such as an Offer inside a Product, or a return policy inside an Offer.

Here is a bouquet marked up in JSON-LD. Swap in your own business, product, and web address. The example business here is a florist selling a seasonal bouquet.

code
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Meadow Bouquet, Large",
  "image": [
    "https://example-shop.com/images/meadow-bouquet-large.jpg"
  ],
  "description": "A seasonal bouquet of garden roses, ranunculus, and eucalyptus, wrapped in kraft paper.",
  "sku": "FL-MBW-L",
  "brand": {
    "@type": "Brand",
    "name": "Meadow Lane Florist"
  },
  "offers": {
    "@type": "Offer",
    "url": "https://example-shop.com/products/meadow-bouquet-large",
    "price": "48.00",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock",
    "itemCondition": "https://schema.org/NewCondition"
  }
}
</script>

Why shops usually pick this format:

The risk with JSON-LD is drift. Because the block sits apart from the visible text, it is easy to change the page and forget the block. A price that moves on the page and stays old in the block is the most common failure in product markup. The fix is the same as for any format: generate the block from the same data as the page, and check the two side by side after a change.

Microdata: labels woven into the visible page

Microdata is an open HTML specification used to nest structured data within HTML content. Instead of a separate block, it adds attributes to the HTML tags that already hold the content. The tags carry the facts: itemscope and itemtype say what the thing is, and itemprop says which fact each piece of text holds.

Here is the same bouquet marked up in microdata. Read it next to the JSON-LD version above and notice that every fact is the same. Only the wrapping changed.

code
<div itemscope itemtype="https://schema.org/Product">
  <span itemprop="name">Meadow Bouquet, Large</span>
  <img itemprop="image" src="https://example-shop.com/images/meadow-bouquet-large.jpg" alt="Meadow Bouquet, Large" />
  <span itemprop="description">A seasonal bouquet of garden roses, ranunculus, and eucalyptus, wrapped in kraft paper.</span>
  <span itemprop="sku">FL-MBW-L</span>
  <div itemprop="brand" itemscope itemtype="https://schema.org/Brand">
    <span itemprop="name">Meadow Lane Florist</span>
  </div>
  <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    <link itemprop="url" href="https://example-shop.com/products/meadow-bouquet-large" />
    <span itemprop="priceCurrency" content="USD">USD</span>
    <span itemprop="price" content="48.00">$48.00</span>
    <link itemprop="availability" href="https://schema.org/InStock" />
    <link itemprop="itemCondition" href="https://schema.org/NewCondition" />
  </div>
</div>

Why some shops still use this format:

Why shops move away from it:

Microdata is not broken, and it is not penalized. It is a valid format that Google supports, and a shop with working microdata does not need to migrate for Google's sake. Migrate when your own maintenance gets painful, or when nested facts become hard to express in attributes, not because someone told you the format is dead.

RDFa: the third format, and when it appears

RDFa is an HTML5 extension that supports linked data by introducing HTML tag attributes that correspond to the visible content you want to describe. Like microdata, it weaves labels into the visible page, but with a different set of attributes: vocab and typeof say what the thing is, and property says which fact each piece holds.

Google supports RDFa alongside the other two, and the same rule applies: it is equally fine when the markup is valid and properly implemented. In practice, RDFa shows up least often on small shops. It is the format of choice where structured data feeds a wider linked data system rather than a search engine, or where a content management system already uses it. If your pages already carry valid RDFa, the same advice holds as for microdata: it works, leave it alone unless maintenance becomes painful. If you are starting fresh, there is no reason to pick RDFa over JSON-LD for a shop.

How to choose

Use this short decision list, in order.

First, if your shop system already writes one format correctly, keep it. A working block in any format beats a half finished migration to another. Check what your theme or SEO app already writes by opening a product page, viewing the page source, and searching for application/ld+json for JSON-LD, or for itemscope for microdata. If a block is already there and it is valid, improve that block instead of adding a second one in a different format.

Second, if you are starting fresh, or adding markup for the first time, use JSON-LD. It is Google's recommended format, it is the easiest to implement and maintain for most sites, and it keeps the facts in one block that can be generated from your product data. That is the format the rest of this series uses, and the format your developer will find easiest to test.

Third, if your theme already prints microdata and it validates, do not spend a project converting it to JSON-LD for Google's benefit. Convert when the nesting gets painful, when design changes keep breaking the attributes, or when you want to generate the markup from product data in one place. Those are maintenance reasons, and they are the right reasons to switch.

Fourth, use one format per page for the same facts. Do not write the price in JSON-LD and also in microdata on the same page. Two copies of the same fact are two chances to disagree, and tools may pick one at random or drop both. Pick one format for a page, and let it carry the whole block.

Test it before you trust it

Two free tools need no signup, and they check different things.

Google's Rich Results Test shows which product fields Google finds on a page, with errors and warnings per field. It reads JSON-LD, microdata, and RDFa, so the same test works whichever format you use. Paste a product address and read what it finds for price, currency, and availability.

The Schema Markup Validator checks your markup against the schema.org vocabulary, which catches misspelled field names the Google tool may miss.

Run both on a few pages after any format change, and compare the result against the visible page. Validators check syntax, not truth. A microdata price that validates but differs from the JSON-LD price on the same page is a conflict no validator will flag. Only a side by side read of the code against the page catches that, which is one more reason to keep a single format and a single copy of each fact.

What the format alone cannot do

The format makes your facts readable. It does not make the facts true, bring crawlers to your pages, keep prices fresh as stock changes, or let an AI tool finish a purchase. Those are separate jobs: honest data, crawler access, monitoring, and checkout. It also does not guarantee a rich result. Google says it does not guarantee that structured data will show up in search results, and the same holds for AI tools: readable facts are a requirement for being quoted with confidence, not a promise of being quoted.

Pick the format your shop can maintain, keep one copy of each fact, and then work through the rest.

Frequently Asked Questions

Which format does Google recommend?

JSON-LD. Google says it is the recommended format because it is usually the easiest to implement and maintain, and because the markup is not mixed in with the visible text. Microdata and RDFa are also supported.

Will switching from microdata to JSON-LD improve my rankings?

No. The format does not change the facts, and Google reads all three formats when they are valid. Switch for maintenance reasons, not for a ranking gain.

Can I use JSON-LD on one page and microdata on another?

You can, but keep one format per page for the same facts. Two copies of the same fact on one page can disagree, and tools may pick one at random or drop both.

My theme already prints microdata. Should I remove it?

No, not if it validates and matches the visible page. Improve it where it has gaps. Only migrate to JSON-LD when the nesting gets painful or design changes keep breaking the attributes.

Does the format affect whether AI tools can read my pages?

What matters most is that the facts are present, valid, and match the visible page. A valid block in any of the three formats is readable. A JSON-LD block that only appears after scripts run can still be invisible to crawlers that never run those scripts, so server rendered markup remains the safer choice where you can manage it.

Verified Sources & Technical Documentation

links marked specific point to the page that supports the claim in this guide. Links marked general docs point to the vendor's general docs section for that topic, not to a page that proves every step. Check the vendor docs for the current path before relying on a menu name or click path in this guide.