---
title: "JSON-LD vs microdata vs RDFa: Agent Ready HTML"
description: "Which schema.org format stays separate from page HTML? Microdata and RDFa use element attributes, while JSON-LD sits in its own script element."
canonical: https://agentreadyhtml.com/guides/json-ld-microdata-rdfa-for-agents/
site: "Agent Ready HTML"
last_updated: 2026-11-18
date: 2026-11-18
section: "Guides"
---

# JSON-LD vs microdata vs RDFa: Agent Ready HTML

> Which schema.org format stays separate from page HTML? Microdata and RDFa use element attributes, while JSON-LD sits in its own script element.

Source: https://agentreadyhtml.com/guides/json-ld-microdata-rdfa-for-agents/
Site: Agent Ready HTML
Last reviewed: 2026-11-18

# Only JSON-LD keeps schema.org data apart from visible HTML

In short

Microdata and RDFa write schema.org properties as attributes on page elements, while JSON-LD sits in a separate script element. Google calls all three equally fine when the markup is valid. Cloudflare's Markdown for Agents converter keeps JSON-LD blocks and strips other script content.

Published 18 November 2026

Picking a syntax does not mean picking a vocabulary. schema.org states that you use its vocabulary with the Microdata, RDFa or JSON-LD formats to add information to web content ([schema.org's guide](https://schema.org/docs/gs.html)). That guide teaches Microdata, yet most examples on the schema.org site also show RDFa and JSON-LD, and the guide says its basic ideas of types and properties are relevant beyond Microdata.

Related: [schema.org](https://agentreadyhtml.com/glossary/schema-org/)

## Where each syntax puts the data

JSON-LD is defined by the W3C as "a JSON-based format to serialize Linked Data" ([JSON-LD 1.1](https://www.w3.org/TR/json-ld11/)). Google describes it as a JavaScript notation embedded in a `<script>` tag in the `<head>` and `<body>` elements of a page, and its sample recipe page places the block in the head ([Google's introduction](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en)):

```html
<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "Recipe",
  "name": "Non-Alcoholic Piña Colada"
}
</script>
```

This markup is not interleaved with the user-visible text, which Google says makes nested data items easier to express.

Related: [JSON-LD](https://agentreadyhtml.com/glossary/json-ld/)

Microdata works through attributes on the elements a reader already sees. The WHATWG standard represents items and properties with regular elements: the itemscope attribute creates an item, and itemprop on one of that item's descendants adds a property ([WHATWG Microdata](https://html.spec.whatwg.org/multipage/microdata.html)). An itemtype value, if specified, must consist of tokens that are each a valid absolute URL, all defined to use the same vocabulary. MDN describes microdata as a way to nest metadata within existing content on web pages ([MDN's microdata guide](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Microdata)). schema.org's guide marks up a movie page with these attributes, giving the item type as a URL ([schema.org's guide](https://schema.org/docs/gs.html)):

```html
<div itemscope itemtype="https://schema.org/Movie">
  <h1 itemprop="name">Avatar</h1>
  <span itemprop="genre">Science fiction</span>
</div>
```

Google says microdata is typically used in the `<body>` element but can be used in the `<head>`.

RDFa is attribute-based too, with a different attribute set. The RDFa Primer says some HTML attributes, such as href and src, are re-used while other RDFa attributes are new, and that none of the RDFa-specific attributes have any effect on the visual display of the HTML ([RDFa Primer](https://www.w3.org/TR/rdfa-primer/)). In RDFa Core, @about generally indicates the subject, one of @property, @rel or @rev represents a predicate, @typeof lists the RDF types for a subject, and @vocab defines the mapping used when a term appears in an attribute value ([RDFa Core 1.1](https://www.w3.org/TR/rdfa-core/)). Google describes RDFa as commonly used in both the `<head>` and `<body>` sections of a page.

## Who maintains each specification

-   **JSON-LD.** The JSON-LD Working Group published JSON-LD 1.1 as a W3C Recommendation, intended to supersede JSON-LD 1.0 ([JSON-LD 1.1](https://www.w3.org/TR/json-ld11/)).
-   **Microdata.** MDN states that microdata is part of the WHATWG HTML Standard ([MDN's microdata guide](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Microdata)).
-   **RDFa.** RDFa Core 1.1 is an Editorial Revision of the W3C Recommendation published on 22 August 2013, and it specifies only a syntax, relying on vocabularies that others define ([RDFa Core 1.1](https://www.w3.org/TR/rdfa-core/)). The RDFa Working Group published the Primer as a Working Group Note ([RDFa Primer](https://www.w3.org/TR/rdfa-primer/)).

## What survives Cloudflare's Markdown conversion

A client that adds an Accept header with text/markdown, on a zone with Markdown for Agents enabled, gets Markdown back: Cloudflare fetches the original HTML from the origin and converts it before serving it ([Cloudflare's documentation](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/)). Cloudflare Markdown for Agents keeps JSON-LD blocks and appends them in a fenced json block. That block is emitted only when the source HTML contains JSON-LD, and several JSON-LD scripts on one page are concatenated within the same block, each on its own line. JSON-LD is the only `<script>` content preserved in the output. Pre-processing strips other script and style content along with non-content elements such as headers, footers and navigation.

Related: [How to add JSON-LD agents use](https://agentreadyhtml.com/guides/add-json-ld-agents-use/)

## How to choose

For Google Search, the format question is mostly settled by maintenance. Google recommends a format that is easiest for you to implement and maintain, which in most cases is JSON-LD, and says all three formats are equally fine for Google as long as the markup is valid and properly implemented per the feature's documentation ([Google's introduction](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en)). Google can also read JSON-LD that is dynamically injected into a page, such as by JavaScript code or embedded widgets in a content management system.

Whichever syntax you use, mark up only what the page shows. Google's guidelines list JSON-LD, Microdata and RDFa as the formats for rich-result eligibility and tell you not to mark up content that is not visible to readers: if the JSON-LD describes a performer, the HTML body must describe that same performer ([Google's guidelines](https://developers.google.com/search/docs/appearance/structured-data/sd-policies?hl=en)). schema.org's guide gives the same general rule, excluding content in hidden divs and other hidden page elements ([schema.org's guide](https://schema.org/docs/gs.html)).

Related: [How to add JSON-LD agents use](https://agentreadyhtml.com/guides/add-json-ld-agents-use/)

Check the result with Google's Rich Results Test during development and the Rich result status reports after deployment; Google warns that pages might break after deployment due to templating or serving issues ([Google's introduction](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en)).

## Sources

1.  [schema.org: Getting started with schema.org using Microdata](https://schema.org/docs/gs.html) https://schema.org/docs/gs.html, read 18 November 2026
2.  [W3C: JSON-LD 1.1](https://www.w3.org/TR/json-ld11/) https://www.w3.org/TR/json-ld11/, read 18 November 2026
3.  [WHATWG: HTML Standard: Microdata](https://html.spec.whatwg.org/multipage/microdata.html) https://html.spec.whatwg.org/multipage/microdata.html, read 18 November 2026
4.  [MDN: Microdata](https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Microdata) https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Microdata, read 18 November 2026
5.  [W3C: RDFa 1.1 Primer](https://www.w3.org/TR/rdfa-primer/) https://www.w3.org/TR/rdfa-primer/, read 18 November 2026
6.  [W3C: RDFa Core 1.1](https://www.w3.org/TR/rdfa-core/) https://www.w3.org/TR/rdfa-core/, read 18 November 2026
7.  [Google Search Central: Intro to how structured data markup works](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en) https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data?hl=en, read 18 November 2026
8.  [Google Search Central: General structured data guidelines](https://developers.google.com/search/docs/appearance/structured-data/sd-policies?hl=en) https://developers.google.com/search/docs/appearance/structured-data/sd-policies?hl=en, read 18 November 2026
9.  [Cloudflare: Markdown for Agents](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/) https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/, read 18 November 2026

Last reviewed 18 November 2026

Edition

Crawl

2026-11-04

Page updated

2026-11-18

Method

How the viewer reads a page, how a file is graded and how a platform is scored: [the method page](https://agentreadyhtml.com/method/).
