Structured data comes in more than one format, and the choice confuses people out of proportion to its importance. JSON-LD and microdata are the two you will meet most often. They describe the same things, using the same schema.org vocabulary, and a search engine reads both. What differs is where the data sits on the page and how you produce and maintain it.
This guide compares the two formats on those practical points. It then builds the JSON-LD version with the free Schema Markup Generator on Ovatly. The tool runs in your browser. If you only remember one sentence, make it this one. The format is plumbing. The rule that matters is that the markup must describe content the page actually shows.
Contents
- Quick answer
- One vocabulary, two ways to write it
- The differences that matter in practice
- How to build the JSON-LD version, step by step
- Worked example: one question, two formats
- Limitations and honest trade-offs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
Pick JSON-LD if you want the data in one self-contained block. You can generate it, paste it in and replace it as a unit. Pick microdata if your templates already label the visible content in place. Pick it if you are comfortable maintaining attributes inside the HTML. If you use the Schema Markup Generator, the decision is made for you. It builds JSON-LD for six types (Article, FAQPage, HowTo, Product, LocalBusiness and BreadcrumbList) from guided fields. It validates the output. It also flags recommended properties you left empty. Neither format outranks the other. Neither guarantees a rich result. Both make a page eligible. Both fail the same way if they describe content that is not on the page.
One vocabulary, two ways to write it
Schema.org defines the types and properties. A FAQPage has a mainEntity array of Questions, each with an acceptedAnswer. A Product has a name. When the page supports it, a Product has a rating too. The vocabulary says what can be described. The format only decides how those descriptions are written into the page.
JSON-LD writes them as JSON inside a single script block, separate from the visible HTML. The block sits in the page's <head> or just before the closing </body> tag, and you keep one block per type per page.
Microdata writes them as attributes on the HTML elements themselves. An itemscope attribute marks an element as an item. itemtype names its schema.org type. itemprop labels each property on the element that displays it. There is no separate block: the labels are woven through the markup around the words the visitor already reads.
The differences that matter in practice
Where the data lives. A JSON-LD block is a copy of the page's key facts in one place. That makes it easy to find, review and replace. It also makes it just as easy to forget. Edit the answer on the page, and the block still says the old words until you update it too. Microdata has no copy to drift, because the properties sit on the content itself. But the data is spread across your templates. Reviewing it means reading the page's HTML rather than one block.
How it gets written. JSON-LD can be generated from form fields, which is what the Ovatly tool does. You fill in guided fields based on what is actually on the page. It outputs a validated block. Microdata is written by hand into templates or emitted by a CMS, element by element. The generator does not produce microdata, and it cannot convert one format into the other.
How it breaks. JSON-LD is JSON, so a missing comma or bracket invalidates the whole block. The generator guards against this in two ways. It validates that the output is well-formed JSON. It also escapes closing script tags inside your text, so the block cannot break the page. Microdata has no JSON syntax to break, but a mistyped attribute or property name simply goes unrecognised, which is quieter and easier to miss.
How it is tested. Identically. Whichever format you ship, you test the live URL with Google's Rich Results Test or the Schema.org validator. Only the live tests see your real page. That includes markup your theme or plugins added without telling you.
How to build the JSON-LD version, step by step
- Open the Schema Markup Generator and choose the schema type that matches the page.
- Fill in the fields with the page's real information.
- For FAQ, HowTo and Breadcrumb types, add as many entries as the page contains.
- Copy the generated script block into the page, and check the guidance note for missing recommended properties. Fill a field only when the page genuinely has that content.
- Test the live URL with Google's Rich Results Test or the Schema.org validator.
Worked example: one question, two formats
Take the pair from the generator's own example. A coffee guide visibly asks, "Is pour over coffee strong?", and answers, "It depends on the coffee to water ratio." In the generator you choose FAQPage and enter that pair. The JSON-LD output is:
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "Is pour over coffee strong?",
"acceptedAnswer": {
"@type": "Answer",
"text": "It depends on the coffee to water ratio."
}
}
]
}
The same pair in microdata labels the visible elements instead of repeating the words in a block:
<div itemscope itemtype="https://schema.org/FAQPage">
<div itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
<h3 itemprop="name">Is pour over coffee strong?</h3>
<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
<p itemprop="text">It depends on the coffee to water ratio.</p>
</div>
</div>
</div>
Same type, same properties, same words. The JSON-LD version took under a minute in the generator and can be swapped out in one edit. The microdata version lives where the content lives, so it is edited in the template, alongside the question itself.
Limitations and honest trade-offs
The generator outputs JSON-LD only, for its six types. If your site already emits microdata from its templates, nothing here replaces it. The same rules apply to that markup too. Those rules cover matching the visible page and testing the live URL.
The "missing properties" note is guidance based on schema.org's required and recommended properties for the type. It is not a promise that Google will show a rich result, in either format. Schema makes a page eligible for rich results. Google decides whether to show them. It bases that on quality, relevance and its current feature set. FAQ rich results are now limited to certain authoritative sites. A page with flawless markup in either format can still show a plain result.
Finally, the generator validates the block in isolation. It cannot see the rest of your page, so the live test is part of the process, not an optional extra.
Common mistakes
- Treating the format as a ranking lever. The choice between JSON-LD and microdata does not earn display on its own; matching, honest content does the work either format can do.
- Describing the same content twice, in both formats, with different values. The page then contradicts itself, and at least one version is wrong.
- Hand-writing JSON-LD without validating it. One missing comma invalidates the block, silently.
- Letting a JSON-LD block go stale. The page gets edited, the block does not, and the markup stops matching the content it describes.
- Marking up content that is not on the page. A FAQ block for questions the page never asks leads to manual actions or ignored markup, in any format.
FAQs
Which format does the Schema Markup Generator output? JSON-LD. You choose one of six types (Article, FAQPage, HowTo, Product, LocalBusiness or BreadcrumbList). You fill in guided fields based on what is actually on the page. The tool outputs a validated JSON-LD block. It also adds a note about which recommended properties are still empty.
Does adding schema guarantee rich results? No. Schema makes a page eligible for rich results; Google decides whether to show them based on quality, relevance and its current feature set. FAQ rich results, for example, are now limited to certain authoritative sites.
Where do I paste the JSON-LD block?
Inside the <head> of the page, or just before the closing </body> tag. Both placements are accepted; keep one block per type per page.
Can I mark up content that is not on the page? No. The markup must match the visible page. A FAQ block for questions the page never asks is exactly the kind of mismatch that leads to manual actions or ignored markup.
How do I test the markup after adding it? Use Google's Rich Results Test or the Schema.org validator on the live URL. This tool verifies the JSON is valid and complete against its field guidance, but only the live tests see your real page.
Conclusion
JSON-LD and microdata are two ways of writing the same vocabulary. One is a block you can generate and replace as a unit. The other is attributes woven through the HTML you already maintain. For most pages the generated route is less work. Choose the type in the Schema Markup Generator. Fill the fields from the page in front of you. Paste the block. Then test the live URL. The rating side of the same tool needs extra care, and the companion guide on How to Add Review and Rating Schema Without Breaking the Rules covers it. The SEO Tools guides collect the rest of this cluster.
References
- Schema.org, the vocabulary, its types and how the data model works: https://schema.org/docs/gs.html
- Google Search Central, on structured data and how it is used: https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data