Schema.org vocabulary can be written in three different formats: JSON-LD, Microdata and RDFa. They describe the same information, but they place it in the page in very different ways. This article compares them so you can choose the right one for your site.
JSON-LD
JSON-LD is a separate block of data, written in a script tag, that does not touch the visible HTML. You can add it to the head of a page without editing the layout, and update it in one place. It is the format Google recommends, and the one our generators produce.
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Person", "name": "Jane Example" }
</script>
Microdata
Microdata adds attributes directly to the HTML elements that already show the information. The markup is mixed with the content, so it stays in sync with the visible text, but it is harder to write and to maintain, especially when a design changes.
<div itemscope itemtype="https://schema.org/Person">
<span itemprop="name">Jane Example</span>
</div>
RDFa
RDFa also uses attributes inside the HTML, in a way that comes from the semantic web standards. It is flexible and can express complex relationships, but it is the least common of the three on ordinary websites and the least convenient for beginners.
Quick comparison
- Placement: JSON-LD lives in a script block, while Microdata and RDFa live inside the visible HTML.
- Maintenance: JSON-LD is changed in one block, the others require editing templates.
- Risk of mismatch: JSON-LD can drift from the visible text if you forget to update it, so keep both in line.
- Support: Google reads all three, but recommends JSON-LD.
Which one should you use
For most websites the answer is JSON-LD. It is easier to generate, easier to test with the schema markup validator and easier to link between entities, as shown in our guide to what schema markup is. If you want to try it, the Person generator and the Organization generator create valid JSON-LD from a simple form.