Microdata to JSON-LD Converter
Convert legacy HTML microdata to JSON-LD: paste markup with itemscope and itemprop attributes and get the equivalent nested structured data.
Converted JSON-LD
Paste HTML that carries itemscope, itemtype and itemprop attributes and the equivalent JSON-LD appears here.
Values are read the way the HTML microdata specification defines them: content on meta, src on img and video, href on a and link, data on object, value on data and meter, datetime on time, and the visible text everywhere else. Nested itemscope elements become nested objects, itemref pulls in properties from elsewhere in the document, a repeated itemprop becomes an array, and runs of whitespace in text values are collapsed to single spaces.
What is the Microdata to JSON-LD Converter?
The Microdata to JSON-LD Converter migrates legacy structured data. Paste HTML that carries itemscope, itemtype and itemprop attributes and it walks the markup the way the HTML microdata specification defines, producing the equivalent JSON-LD with @context, @type and nested objects.
- Follows the HTML microdata value rules for meta, img, a, link, object, data, meter and time
- Nested itemscope elements become nested JSON-LD objects
- itemref resolved, with a warning when the target id is missing
- Repeated properties collected into arrays automatically
- Optional base URL resolves relative src and href values
- Copy as a script block or download the raw JSON
How to use the Microdata to JSON-LD Converter
- 1
Paste your HTML with microdata attributes into the box, or press Load example to see the format.
- 2
Optionally enter a base URL so relative image and link values become absolute.
- 3
Read the counters for how many top-level items and properties were found.
- 4
Check any warnings about missing itemref targets or items without an itemtype.
- 5
Copy the JSON-LD script block, or tick the raw JSON option and download the file.
About the Microdata to JSON-LD Converter
The Microdata to JSON-LD Converter migrates legacy structured data. Paste HTML that carries itemscope, itemtype and itemprop attributes and it walks the markup the way the HTML microdata specification defines, producing the equivalent JSON-LD with @context, @type and nested objects.
Values are read by element type, exactly as the spec says: content on meta, src on img and video, href on a and link, data on object, value on data and meter, datetime on time, and the visible text everywhere else. Nested itemscope elements become nested objects, itemref pulls in properties from elsewhere in the document, and a repeated itemprop becomes an array.
Parsing happens entirely in your browser using the built-in HTML parser, so no page source is uploaded. An optional base URL turns relative src and href values into absolute URLs, and warnings flag missing itemref targets, missing itemtypes and non-schema.org vocabularies.
Frequently asked questions
Should I switch from microdata to JSON-LD?
Google recommends JSON-LD for structured data because it sits in one block in the head rather than being woven through your HTML, which makes it far easier to maintain and much harder to break during a redesign. Microdata is still supported, so a migration is an improvement rather than a rescue.
Does converting microdata to JSON-LD change my rich results?
It should not, as long as the same properties and values come across. The formats are two syntaxes for the same schema.org vocabulary, so a faithful conversion describes exactly the same thing — check the output against your original markup before you swap them.
Can I remove the microdata attributes after converting?
Yes, once the JSON-LD is live and validated you can strip the itemscope, itemtype and itemprop attributes. Do not leave both in place describing different values, because contradictory markup on one page is worse than either format alone.
What happens to itemref in the conversion?
itemref is resolved: the elements it names are pulled in as properties of the item, just as a browser would. If the id it points at is not in the HTML you pasted, the converter warns you rather than silently dropping the property.
Why does my output have no @type?
Because the itemscope element has no itemtype attribute, so there is nothing to convert into a type. Add an itemtype such as https://schema.org/Product to the source markup and the @type and @context appear.
Related tools
JSON-LD Generator
Generate Schema.org JSON-LD structured data for WebSite, WebPage, LocalBusiness, Person, Event and Recipe types with a simple guided form.
Dataset Schema Generator
Build Dataset JSON-LD for Google Dataset Search with licence, DOI, creator, temporal and spatial coverage, variables measured and DataDownload files.
Speakable Schema Generator
Attach a speakable SpeakableSpecification to a WebPage or Article using CSS selectors or XPath, with duplicate and selector-type validation.
Article Schema Generator
Free article schema generator: build Article, NewsArticle or BlogPosting JSON-LD with headline, author, publisher, dates and image, ready to copy.
Product Schema Generator
Free product schema generator: build Product JSON-LD with brand, SKU, price, currency and availability, plus optional ratings for rich snippets with stars.