Aizii Learn · AI Search

[← Back to Learn](https://aizii.ai/learn)

# JSON-LD vs microdata for AI search

JSON-LD and microdata are two ways to write the same thing. The thing is structured data, written in the schema.org vocabulary, which is the shared list of types and properties such as Product, Offer, Review, and Organization. The format is how you write that vocabulary into a page. JSON-LD writes it as a separate script block. Microdata writes it as attributes on the HTML tags that already display the content. A third format, RDFa, also writes it as attributes on HTML tags, and it works the same way for this comparison.

The short answer is to use JSON-LD for anything new. Google says it recommends JSON-LD, and it says all three formats are equally fine for Google as long as the markup is valid and properly implemented. That pair of statements is the whole decision: JSON-LD is the recommended default, microdata is not broken, and the choice is about maintenance, not about unlocking a result that one format can reach and the other cannot.

For the full Product block in JSON-LD, see our [product schema guide](https://aizii.ai/learn/ai-search/how-to-add-product-schema-markup-for-ai-search). This guide covers the format choice only, not the fields inside the block.

## What each format looks like

Here is the same product, a hand trowel from a garden supply store, written both ways. In the examples, \[yourdomain.com\] is a placeholder, replacing yourdomain.com with your actual domain. The store and the product are fictional, and the values are teaching samples for your own store.

JSON-LD sits apart from the visible page, inside a script tag. The page a shopper sees is untouched.

```
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Fern and Fork Hand Trowel",
  "image": "https://[yourdomain.com]/images/fern-fork-trowel.jpg",
  "description": "Stainless steel hand trowel with a beechwood handle, for potting and beds.",
  "sku": "FF-TROWEL-01",
  "brand": {
    "@type": "Brand",
    "name": "Fern and Fork"
  },
  "offers": {
    "@type": "Offer",
    "url": "https://[yourdomain.com]/products/fern-fork-hand-trowel",
    "price": "24.00",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock",
    "itemCondition": "https://schema.org/NewCondition"
  }
}
</script>
```

Microdata sits on the visible page itself. The same facts are written as attributes on the tags that display the product name, the price, and the stock status.

```
<div itemscope itemtype="https://schema.org/Product">
  <h1 itemprop="name">Fern and Fork Hand Trowel</h1>
  <img itemprop="image" src="https://[yourdomain.com]/images/fern-fork-trowel.jpg" alt="Fern and Fork Hand Trowel">
  <p itemprop="description">Stainless steel hand trowel with a beechwood handle, for potting and beds.</p>
  <span itemprop="brand" itemscope itemtype="https://schema.org/Brand">
    <span itemprop="name">Fern and Fork</span>
  </span>
  <div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
    <link itemprop="url" href="https://[yourdomain.com]/products/fern-fork-hand-trowel">
    <meta itemprop="priceCurrency" content="USD">
    <span itemprop="price" content="24.00">$24.00</span>
    <link itemprop="availability" href="https://schema.org/InStock">
    <link itemprop="itemCondition" href="https://schema.org/NewCondition">
  </div>
</div>
```

Both blocks describe the same Product, with the same name, the same price, the same currency, and the same availability. A system that parses one can read the same facts from the other. The vocabulary is identical. Only the placement differs.

## Why Google recommends JSON-LD

Google gives the reason in its introduction to structured data. JSON-LD is a script block that is not interleaved with the visible text, which makes nested data easier to express, and it is the format that is easiest to implement and maintain at scale. The practical meaning is simple: a developer can add, update, or remove the block without touching the layout, and a redesign can proceed without touching the block. Microdata ties the two together, so a template change that moves a price tag can silently drop a property, and a markup change that renames a property can break the layout.

JSON-LD also maps cleanly onto the data your server already holds. The product object that renders the page can render the JSON-LD block from the same fields, in the same step. That single generation step is what keeps the markup and the page in agreement, which is the rule Google states in its general guidelines: structured data must be a true representation of the page content, and it must not describe content that is not visible to readers of the page.

Google also says it can read JSON-LD data when it is dynamically injected into the page, such as by JavaScript code or by embedded widgets in a content management system. That statement is about Google Search. Do not read it as a promise about every AI crawler. Many AI crawlers do not run JavaScript, so markup that only appears after your scripts run is invisible to them. For AI search, the JSON-LD block still needs to be in the initial HTML the server sends, not injected by a script after the page loads. The format does not fix a rendering problem. Server-rendered markup does.

## The case for keeping microdata

Microdata is not deprecated, and Google has not signaled an intention to stop reading it. It is a supported format in Google's general guidelines, alongside JSON-LD and RDFa, and the schema.org documentation lists it as a supported way to write the vocabulary. A site with microdata that validates, matches the visible page, and stays current has working markup, and there is no search result it is locked out of for that reason alone.

Microdata has one real strength that JSON-LD does not. Because the annotations sit on the elements that display the content, the markup and the visible content cannot drift apart in the way a separate block can. A price in a JSON-LD block can say one number while the page renders another, and the page will still look fine to a shopper. A price in microdata is the price on the page, because it is written on the price element itself. That is a genuine protection against the most common structured data failure, which is a mismatch between markup and page.

RDFa is in the same position. It is a supported format, it annotates the visible HTML, and it is the right choice when a site already uses it for a broader linked-data purpose beyond search. For a store starting fresh, it has no advantage over JSON-LD for AI search.

## What the format does not decide

The format does not decide whether a product appears in a rich result, or whether an AI system cites it. Google says all three formats are equally fine for Google as long as the markup is valid, which means a valid microdata block and a valid JSON-LD block with the same facts are eligible for the same display. What decides eligibility is the content: the required properties are present, the values match the visible page, the reviews are real and visible, and the page is not blocked from crawling. A perfect format with a wrong price is still wrong. A plain format with true facts is still eligible.

The format also does not decide whether an AI system reads the markup at all. Google says structured data is not required for its generative AI features, and that there is no special schema markup you need to add to appear in AI Overviews or AI Mode. Structured data helps a system extract facts accurately from a page it already reads. It is a clarity aid, not a requirement and not a promise of a citation. The same applies to FAQPage, which is still valid schema.org markup and still the clearest shape for question-and-answer extraction, even though Google has removed the FAQ rich result feature. Frame it as an extraction aid, not as a rich-result play, and link schema.org for the type, since there is no Google FAQPage documentation page to link to.

## How to choose

**New site, or a template rebuild.** Use JSON-LD, generated server-side from the same objects that render the page. Nothing else needs considering. One block per page, in the initial HTML, with the fields from our product schema guide.

**Existing microdata that validates.** Leave it. Add JSON-LD only for entities the microdata does not already cover, and do not describe the same entity twice in two formats. Two live descriptions of one product, with values that can drift apart, is the conflict our guide to fixing conflicting product data covers. If you migrate, do it as one change: write the JSON-LD, validate it, confirm it produces the same entities, and then remove the microdata for those entities.

**A platform that makes injecting a head block hard.** This is the one case where microdata can be the practical choice, because the annotations live on tags the platform already renders. If that is your situation, keep the microdata, keep it validating, and keep it matching the page. Do not add a partial JSON-LD block alongside it for the same product.

**A redesign in progress.** This is the moment microdata breaks most often, because template changes drop attributes silently. If you are redesigning, move to JSON-LD as part of the rebuild, so the markup survives the redesign as one block that carries over unchanged.

## Validate before you ship

Two free tools, no signup, and they check different things:

1.  Google's Rich Results Test: paste a page URL and it shows which structured data Google detects, with errors and warnings per field. It reads all three formats, so it works for a microdata page and a JSON-LD page alike.
2.  The Schema Markup Validator: checks the markup against the schema.org vocabulary itself, which catches typos in property names and wrong types that Google's tool may not flag.

Run both after any format change, and then read the page yourself. The validators cannot tell you the JSON-LD price drifted from the visible price, or that a redesign dropped a microdata attribute from a price tag. Only a side-by-side read of the markup and the page can do that. Check that every fact in the markup appears on the page, and that every fact on the page that the markup claims to describe matches the markup value.

### Say you run a garden supply store on microdata

Say you run a small garden supply store, and your theme has marked up products with microdata for years. The markup validates, the prices match the page, and the trowel page carries the same price in the tag and in the text a shopper reads. There is no reason to rip that out. The format is supported, the facts are true, and a migration would add risk without adding eligibility.

Then you rebuild the theme. The new templates drop the microdata attributes from half the product pages, because no one carried them over. The prices are still right on the page, but the markup is gone from those pages, and the next AI answer about those products has no labeled price to quote. The fix at that point is not to restore microdata tag by tag. It is to move to JSON-LD in the rebuild, generated from the same product data as the page, so the next redesign cannot drop it silently.

## Common mistakes

**Describing the same product in both formats.** JSON-LD says one price, microdata says another, and a system reading the page has two competing facts. Pick one format per entity and stick to it.

**Migrating by adding JSON-LD and leaving the microdata in place.** The migration is not done until the old format is removed for the entities the new block covers. An overlap is a duplicate, and a duplicate is a conflict waiting for a price change.

**Injecting JSON-LD with client-side JavaScript and assuming every crawler sees it.** Google can read dynamically injected JSON-LD. Many AI crawlers do not run JavaScript. Put the block in the server-rendered HTML.

**Assuming the recommended format fixes bad data.** JSON-LD is easier to maintain, but a JSON-LD block generated from a stale feed is still stale. The source of truth matters more than the format.

**Treating RDFa as a third option to evaluate from scratch.** If you do not already use RDFa, you do not need it for AI search. JSON-LD is the default, microdata is the legacy format worth keeping when it works, and RDFa is the format for a linked-data purpose beyond search.

## What this guide does not cover

This guide covers the choice between JSON-LD, microdata, and RDFa. It does not cover the fields inside a Product block, which is our product schema guide, or the price and availability fields, which is our guide to marking up prices and availability, or variants, which is our guide to marking up product variants, or reviews, which is our guide to review schema. It also does not cover fixing a page where two sources disagree, which is our guide to fixing conflicting product data, or keeping markup accurate over time, which is monitoring work.

## Check your own brand now

Run the free scan. It takes seconds, no signup, and shows whether AI crawlers can read your product pages today: aizii.ai/aeo-scan

[Run the free scan](https://aizii.ai/aeo-audit)

## Sources

-   Google Search Central, Introduction to structured data markup (specific): [https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data)
-   Google Search Central, General structured data guidelines (specific): [https://developers.google.com/search/docs/guides/sd-policies](https://developers.google.com/search/docs/guides/sd-policies)
-   Google Search Central, Optimizing your website for generative AI features on Google Search (specific): [https://developers.google.com/search/docs/fundamentals/ai-optimization-guide](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide)
-   Schema.org, FAQPage type (specific): [https://schema.org/FAQPage](https://schema.org/FAQPage)
-   Schema.org, Product type (general standard): [https://schema.org/Product](https://schema.org/Product)
-   Google Rich Results Test (general docs): [https://search.google.com/test/rich-results](https://search.google.com/test/rich-results)
-   Schema Markup Validator (general docs): [https://validator.schema.org/](https://validator.schema.org/)

Note: 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.
