Skip to content

Choosing a format

Reference

Schema.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 --> Done

Guidance

  • 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, and itemprop. It is a good fit when the structured data should track the visible content closely.
  • RDFa Lite uses vocab, typeof, and property. Choose it when you already use RDFa or need the broader RDFa standard.

Trade offs

FactorJSON-LDMicrodataRDFa Lite
Separation from markupHighLowLow
Ease of templatingHighMediumMedium
Inline with visible contentNoYesYes
Learning curveLowLowMedium

Done when

  • You have selected one syntax for the page.
  • The team can generate and maintain that syntax consistently.