Core writing

JSON-LD vs Microdata: Which Is Better?

Google accepts JSON-LD, Microdata, and RDFa. This guide compares where each one lives in the page, how it breaks, and which one to maintain.

On this page
  1. Where the three formats sit
  2. Why JSON-LD is the default for a page you edit
  3. Microdata is still a supported format
  4. How each format actually breaks
  5. The same organization, both ways
  6. Duplicate graphs that disagree
  7. Checklist

Google accepts JSON-LD, Microdata, and RDFa. For a page you maintain by hand, or for markup a tool generates, JSON-LD is the better default. The visible HTML stays readable, and the data sits in one script tag instead of being threaded through every element the visitor sees.

That is a maintenance choice, not a validity ranking. Microdata is not invalid. RDFa is not invalid. Google's own introduction to structured data says all three formats are fine when the markup is valid and matches the feature you are implementing. The same page says Google recommends JSON-LD in most cases because it is easier to keep correct. The introduction is here: Intro to structured data.

This guide is about where each format lives, how a redesign breaks it, and why this site emits JSON-LD. One syntax does not rank higher than another. The fields still have to match what a reader can see.

Where the three formats sit

JSON-LD is a script element with type="application/ld+json". It can go in the head or the body. Browsers do not run it as JavaScript. Inside, you put one JSON object: a @context of https://schema.org, a @type, and the properties for that type. Nested facts are nested objects. Several types can share one script with @graph.

Microdata is attributes on the HTML elements that already display the page. itemscope marks an element as an item. itemtype is the type URL, such as https://schema.org/Organization. itemprop is the property name on a child. By default the value is the text inside that child, or the URL on a link. A nested type is a new itemscope on the element that carries the property. There is no separate data block. The paragraph, the heading, and the link are the data.

RDFa uses different attribute names, typeof and property, on the same kind of elements. Google lists it beside the other two. The practical cost matches Microdata: the facts live in tags a redesign will touch. The pair below is JSON-LD and Microdata, which is the choice most pages are actually making. data-vocabulary.org is not a fourth option. That older vocabulary is no longer eligible for Google rich results. Replace it with schema.org.

Why JSON-LD is the default for a page you edit

The visible page and the structured data drift apart for boring reasons. A heading gets rewritten in the CMS. A price is updated in a product field. A template partial is swapped. With Microdata, the property moves only if the attribute happens to be on the element you edited. With JSON-LD, the script is a unit. You either update that unit or you can see that you forgot, because the whole fact list is in one place.

Readable HTML is the other half. A title wrapped in attributes is hard to proofread. The same facts in a script are a short list: name, url, price, currency. Someone who does not write parsers can still see a wrong name. That matters when one person writes the page and the markup, and when a generator prints the script.

SchemaDesk emits JSON-LD. Open the organization generator, set the name and the URL a visitor can see, and copy one script. Paste it once and keep the body as ordinary HTML. Google reads that script from the fetched page. How the fetch and the render work is in How Google Parses JSON-LD. You do not pick JSON-LD because Microdata is invisible to Google. You pick it because the page stays easier to keep honest.

Microdata is still a supported format

Do not delete working Microdata just to change syntax. If the attributes are on the elements that show the right text, Google can use that graph. A migration is worth it when you are already editing the template, when the attributes have drifted, or when you want one generated script instead of attributes spread across a theme. A migration is not worth it as a cleanup ritual on pages that already match.

There is a case where Microdata is the format that survives. Some hosted editors strip every script tag, including a script whose type is application/ld+json, because their sanitizer treats script as executable. If you cannot place a script and you can edit body HTML, attributes on the visible elements are a reasonable path. That is a constraint of the host. It is not evidence that Microdata is the better default when a script is allowed.

Watch the content attribute. Microdata lets a meta element carry itemprop and content so the value is not the visible text. That is how a price or a rating ends up in the graph and nowhere on the page. A hidden value has the same problem as a JSON-LD field you invented. Prefer the text the visitor reads. A separate machine value is fair only when it is the same fact, such as an ISO duration next to "15 minutes" already on the recipe.

How each format actually breaks

A theme update that strips a script is the JSON-LD failure to look for first. Security plugins and "optimize head" options sometimes remove script elements they do not recognize. The page looks unchanged. View source on the live URL, not the CMS preview, and search for application/ld+json. If the block is gone, the theme removed it. The head and the body are both allowed. If a head filter is the cause, try the body, then confirm the live HTML again.

Invalid JSON fails as a whole script. A trailing comma, a curly quote, or a raw line break inside a string drops the block. Microdata does not fail that way. Its failure is a property left on the wrong element. Check the script with a JSON parser before you blame Google. The order of checks is in How to Validate JSON-LD Before You Publish.

Microdata breaks when a redesign moves itemprop off the visible text. The old template put itemprop="name" on the heading that reads "Field Note Studio". The new template leaves the attribute on a span that reads "Brand", or on an empty element, and styles the real name somewhere else. The graph now says the organization is called Brand, or that the name is empty. The same split hits a price when the property stays on the crossed-out number and the sale price is unmarked.

JSON-LD does not move when a heading class changes. It breaks when the script is edited, when a generator still has the old name, or when the template stops printing the script. Those show up in a diff. They are still failures. Yesterday's price is wrong in either format.

BreakJSON-LDMicrodata
Theme or sanitizerThe script tag is removed. The page looks the same.Attributes usually survive a script filter, and die in a markup rewrite.
RedesignThe script is untouched unless the partial that prints it is dropped.itemprop stays on the old element after the visible text moves.
SyntaxOne bad token drops the whole script.A missing attribute drops that property and leaves the rest.
Two sourcesA plugin script and a hand-written script can disagree.Attributes and a script can disagree about the same fact.

The same organization, both ways

These two blocks describe one fictional studio. The name is Field Note Studio and the URL is https://example.com/. They are the same fact, not two businesses. On a real page you would publish one of them, and the name and URL would be visible in the header or the footer without any need for the markup to be the only copy.

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Field Note Studio",
  "url": "https://example.com/"
}
<div itemscope itemtype="https://schema.org/Organization">
  <p itemprop="name">Field Note Studio</p>
  <a itemprop="url" href="https://example.com/">Field Note Studio</a>
</div>

The JSON-LD version does not change how the header is written. The Microdata version has to sit on the elements that show the name and the link. If the link text and the itemprop="name" text ever diverge, stop and make them the same words. Do not publish both blocks. Two graphs for one studio are the next failure.

Duplicate graphs that disagree

Sites collect markup from a theme, an SEO plugin, a tag manager, and a block someone pasted. Each source can emit a full Organization, or a full Product, without knowing the others exist. Google then sees two names, two URLs, or two prices. There is no rule that merges them into a careful average. Conflicting values make the entity ambiguous, and the rich result you wanted can simply not appear.

Pick one source per page. If you maintain the generator output, remove the plugin's copy of that type. Mixing formats does not add confidence. A Microdata name of "Field Note Studio" plus a JSON-LD name of "Field Note" is a conflict, not a translation. Different types are fine: Article and Breadcrumb can share one @graph. A conflict is two nodes that claim the same item and disagree. Read the rendered HTML and list every script and every itemscope before you add another.

Checklist

  • Treat JSON-LD, Microdata, and RDFa as accepted formats. Do not call Microdata invalid.
  • Prefer JSON-LD when you edit the page yourself or when a tool generates the markup. One script keeps the visible HTML readable.
  • Put the script in the head or the body. Use type="application/ld+json". Confirm the live HTML still contains it after a theme update.
  • If your host strips every script, Microdata on the visible elements is a valid fallback. Do not hide a different value in a content attribute.
  • After a redesign, check that each itemprop still sits on the text a reader sees. A property left on a label is a wrong value.
  • Reject invalid JSON before you test rich results. A trailing comma drops the whole script.
  • Publish one graph for the organization, not a plugin copy plus a pasted copy. Disagreement is not redundancy.
  • Generate the script from the organization generator, then validate it with the checks in How to Validate JSON-LD Before You Publish.