Microdata to JSON-LD Converter

Paste HTML containing schema.org itemscope/itemtype/itemprop microdata and get equivalent <script type="application/ld+json"> output in one click. Handles nested items (e.g. a Person with an address), repeated itemprop values (converted to arrays), and all five value sources: meta[content], a/link[href], img[src], time[datetime], and element text content.

How to use the Microdata to JSON-LD Converter

Paste any HTML that uses schema.org microdata attributes and click Convert to JSON-LD. The tool:

  1. Parses the HTML with DOMParser (safe — nothing executes).
  2. Finds every top-level [itemscope] element (those not nested inside another itemscope).
  3. Extracts the @type from the itemtype URL (last path segment, e.g. https://schema.org/Product"Product").
  4. Iterates over each direct [itemprop] child (not inside a closer itemscope) and extracts its value based on element type: <meta>→content, <a>/<link>→href, <img>→src, <time>→datetime, otherwise textContent.
  5. Nested [itemscope] elements inside an itemprop become nested JSON-LD objects.
  6. Multiple [itemprop] elements with the same name become JSON arrays.

The output is a complete <script type="application/ld+json"> block, pretty-printed. Copy it and insert it into your <head>. You can then remove the microdata attributes from your HTML, keeping the markup cleaner.

Microdata vs JSON-LD: why migrate?

Schema.org structured data can be expressed in three formats: Microdata, RDFa, and JSON-LD. Microdata uses HTML attributes (itemscope, itemtype, itemprop) directly on the content elements. JSON-LD is a JavaScript object embedded in a <script> tag, decoupled from the visual HTML. Google officially recommends JSON-LD for all new structured data implementations, and for good reasons: the data doesn't need to be interleaved with visible content (so you can express properties that aren't shown to users), it's easier to read and validate, it can be maintained without touching the template HTML, and it can be dynamically injected by a CMS or server-side script.

Migrating legacy microdata to JSON-LD is a common task when updating older WordPress themes, Drupal modules, or hand-coded templates that pre-date Google's JSON-LD preference (announced around 2016). The migration doesn't change which data Google ingests — both formats are parsed by the same structured data extractor — but it reduces ongoing maintenance cost and allows structured data that doesn't correspond to visible content (e.g. a canonical URL, or additional offer details).

The microdata model is hierarchical: a top-level [itemscope] is an item of a given type; any element inside it with itemprop contributes a property; if that element also has itemscope, it is a nested item. The JSON-LD model maps directly: top-level items become objects with @type; itemprop names become keys; nested items become nested objects. Repeated itemprop values become arrays. This tool implements that mapping faithfully, including edge cases like <meta itemprop="ratingValue" content="4.8"> (value from content attribute) and <time itemprop="datePublished" datetime="2025-01-15"> (value from datetime attribute).

Common use cases

  • Theme modernisation — convert microdata in old WordPress or Drupal themes to JSON-LD as part of a structured data overhaul without manually re-authoring every property.
  • Schema migration audit — quickly visualise what structured data a legacy page is currently declaring, then decide which properties to keep in the new JSON-LD implementation.
  • Debugging — paste a page\'s HTML to see exactly what schema.org data Google would extract, without having to submit to the Rich Results Test.
  • Template development — write microdata in a CMS template for easy copy-editing, then use this tool to generate the equivalent JSON-LD for the <head>.
  • E-commerce product pages — convert legacy Product + Offer + AggregateRating microdata to JSON-LD to qualify for Google Shopping and rich results in product SERPs.

Frequently asked questions

Does Google still support microdata?

Yes — Google continues to parse microdata, RDFa, and JSON-LD. Microdata is not deprecated by Google, but JSON-LD is the recommended format for new implementations and is significantly easier to maintain. Existing microdata will continue to work; migration is recommended but not urgent.

What happens to itemprop values that aren't visible (meta tags)?

The tool correctly reads the content attribute of elements, which is the standard microdata pattern for machine-readable data not intended for display (e.g. an ISO 8601 date, a price without currency symbol, a rating value).

Can the tool handle multiple top-level items on one page?

Yes — each top-level [itemscope] element (not nested inside another) generates a separate JSON-LD object. If there are multiple, they are wrapped in a JSON array inside a single