DeepSmith

Nov 26 · AEO & AI Visibility

10 min read

JSON-LD vs Microdata: What Is the Difference?

Avinash Saurabh
Avinash Saurabh · CO-Founder & CEO
Two side-by-side panels in monochrome line art showing the same page described by a separate data block and by labels attached to the page.

If you're deciding on a structured data format for a new site, the json-ld vs microdata question usually lands on your desk because a developer or a CMS owner asked you to pick one. You don't need to write any markup to make a good call. You only need to know what each one is, what it costs to maintain, and what Google says about them. The short version is that JSON-LD puts your structured data in a separate block, Microdata puts it in labels on the page's own HTML, and Google supports both. For most new sites, JSON-LD is the easier one to live with.

How the two formats compare

Both formats describe the same things, like an organization, a product, or an event, using the same Schema.org vocabulary. The json-ld vs microdata difference is where that description lives and how it ties to your page.

CriterionJSON-LDMicrodata
What it isA JSON-based way to write linked dataAttributes added to HTML elements
Where it sitsA separate data block in the pageWoven through the visible HTML
VocabularySchema.orgSchema.org
Google supportSupported, and recommended in most casesSupported
Nested or linked entitiesEasier to expressSupported, but tied to the HTML structure
Effect of template changesLess tied to the layoutNeeds care when elements or scopes move
Risk of stale valuesA separate copy can drift from the visible textReused visible values can drift less, but separate metadata can still go stale
Best fitNew sites, evolving templatesExisting sites where it already works

None of this is a ranking factor. The table is about how much work each format creates for the people who maintain your site.

JSON-LD's separate data structure

JSON-LD is a lightweight way to write linked data in JSON. On a web page it usually sits in a script element with the type application/ld+json. The word "script" trips a lot of people up, so it helps to know that this is a block of data, not code the browser runs. Your server or CMS can place it in the page from the start, with no client-side JavaScript involved.

The main strength is separation. The structured data isn't mixed into the attributes of your headings, paragraphs, and images, so your layout can change without the data description having to follow it. Google also points out that nested information, such as a country inside an address inside a venue inside an event, is easier to express this way. And because it's one block, whoever reviews it can read it in one place. You can read more in our explainer on what JSON-LD is.

There are real limits too. A separate block can drift away from what the page says. If an editor changes a price in the visible text and nobody updates the data, the two will disagree. JSON-LD also doesn't check itself, so a template can still leave out a property or serve the wrong values. And it isn't automatically the easiest choice on every platform.

Microdata's HTML annotations

Microdata is part of the HTML standard. It adds labels to the elements you already have, using a handful of attributes. itemscope marks a thing, itemtype says what kind of thing it is, and itemprop names each of its properties. Two more, itemid and itemref, handle identifiers and links to elements outside the item.

The upside is that a label can sit right on the visible content, so the name or price on the page can also be the value in the data. For some values that means one less copy to keep up to date. Microdata also handles nested items, so it isn't limited to flat lists.

The tradeoff is that your data is tied closely to your HTML. When a redesign moves components around, someone has to make sure each property still belongs to the right item. A purely visual change doesn't break anything, but a change to the elements or scopes that carry the labels can. A complex description can also mean following labels across many elements, which is harder to review. Microdata isn't deprecated or obsolete, though. It's supported, and it stays a sensible choice where it already works.

One more point about Microdata that people often miss is that its values don't always come from the visible text. Depending on the element, a value can come from a link, an image source, or a metadata attribute. So the real contrast is a separate data block versus labels attached to HTML, not hidden data versus visible data.

Google support and maintenance

Google's structured data documentation gives a general rule: use the format that is easiest for you to implement and maintain, and in most cases that's JSON-LD. Google also says its supported formats are equally fine when the markup is valid and follows the documentation for the feature you want. Both of those are true at once.

That means the difference is about upkeep, not about a ranking bonus. There's no good evidence that switching formats raises rankings, traffic, or your chances of a rich result. Be careful with anyone who tells you otherwise.

Some things stay the same whichever you pick. Your markup has to describe content that's actually on the page, and it needs every required property for the feature you're after. It also has to stay current. A passing result in the Rich Results Test tells you the markup is valid, but it doesn't promise Google will show a rich result. Our guide to validating schema markup covers what each testing tool does and doesn't tell you.

You also don't have to pick only one. Google has supported combining the two on a page, for example breadcrumbs in JSON-LD that point to a page described in Microdata. That tends to come up when different plugins generate different pieces of markup. It's an advanced case, and it isn't a reason to keep two copies of every fact, since each copy is one more thing that can fall out of date.

The right format for your site

Here is how it usually plays out by situation.

Your situationWhere to leanWhy
Building a new site where you control the outputJSON-LDIt matches Google's general recommendation and stays separate from your layout
Templates will change oftenUsually JSON-LDThe data description doesn't depend on how the page is arranged
Describing several nested or linked thingsUsually JSON-LDNested data is easier to express
Your current Microdata is correct and well maintainedKeep itSupported markup doesn't become a problem because another format is recommended
A platform that outputs reliable Microdata and makes JSON-LD awkwardMicrodata can fitReliable output beats a fragile workaround
Plugins already produce a mix of formatsReview the combined outputMixing is supported, but conflicting values need a check

If you have working Microdata, there's usually no reason to start a migration project. A redesign is a good moment to simplify who owns the markup, but that's a judgment about your own site, not something Google asks for.

If you need a sentence to take to your team, this one works: "We recommend JSON-LD for the new site because it keeps structured data separate from presentation markup and is easier to maintain as templates change. Google supports both formats, so this is a maintenance decision, not a claim about better rankings."

This guide stays with those two formats. If you want to see how they stack up against RDFa, or how format choice relates to AI search, we cover that in our three-way format comparison. For the vocabulary underneath both, start with what Schema.org is, and see the Schema.org getting started page for its own overview. The no-developer schema markup guide walks through adding it on common platforms. Our guide to answer engine optimization shows where structured data fits in a broader plan.

Where DeepSmith fits

Choosing a format is one task among many that sit between an idea and a published page. DeepSmith's Content Studio takes a planned idea through research, drafting, internal and external linking, a cover image, and publish-ready metadata, then publishes to the CMS you already use. It doesn't convert Microdata or generate your structured data, so that decision stays with you and your developer. If handoffs in your publishing process are what slow you down, you can start a free trial and see how it handles one article.

Frequently asked questions

What is the main difference between JSON-LD and Microdata?

JSON-LD describes your page in a separate JSON data block, while Microdata adds labels directly to the HTML elements on the page. They use the same Schema.org vocabulary, so the meaning can be identical. Only the way it's written and attached to the page differs.

Does Google prefer JSON-LD over Microdata?

Google recommends JSON-LD in most cases because it's usually easier to implement and maintain. It also supports Microdata, and valid markup in either format is fine. The preference is about upkeep, not about better rankings.

Should I replace my existing Microdata with JSON-LD?

Not just because JSON-LD is recommended. If your Microdata is correct and your team can maintain it, it can stay. A move makes more sense when the current setup creates repeated maintenance work or when a redesign gives you a natural time to simplify.

Can I use JSON-LD and Microdata on the same page?

Yes, Google has supported the two working together, and some sites end up with both because different plugins produce different markup. It's best treated as an advanced case. Keeping two independent copies of every fact only gives you more chances for the values to disagree.