Appearance
Choosing a format
ReferenceSchema.org supports three syntaxes: Microdata, RDFa, and JSON-LD. All three express the same vocabulary. The right choice depends on your stack and how your content is generated.
Decision diagram
flowchart TD
Start[Need to add structured data] --> Q1{Can you inject a script block in the head or body?}
Q1 -->|Yes| JSONLD[Use JSON-LD]
Q1 -->|No| Q2{Is the data tightly coupled to visible HTML?}
Q2 -->|Yes, and you know RDFa| RDFa[Use RDFa Lite]
Q2 -->|Yes, simpler is better| Micro[Use Microdata]
JSONLD --> Done[Validate and publish]
RDFa --> Done
Micro --> DoneGuidance
- JSON-LD is recommended for most modern sites. It keeps structured data in a single block, separate from presentation markup, which makes it easy to generate from a template or a content management system.
- Microdata attaches meaning to existing HTML using
itemscope,itemtype, anditemprop. It is a good fit when the structured data should track the visible content closely. - RDFa Lite uses
vocab,typeof, andproperty. Choose it when you already use RDFa or need the broader RDFa standard.
Trade offs
| Factor | JSON-LD | Microdata | RDFa Lite |
|---|---|---|---|
| Separation from markup | High | Low | Low |
| Ease of templating | High | Medium | Medium |
| Inline with visible content | No | Yes | Yes |
| Learning curve | Low | Low | Medium |
Done when
- You have selected one syntax for the page.
- The team can generate and maintain that syntax consistently.