When Google or Bing crawls your page, it sees HTML text but does not always understand what things are — is that a person? A recipe? A product? Structured data gives search engines explicit information about your content. JSON-LD is the format Google recommends, and it lives right in a script tag in your HTML.
What Is JSON-LD?
JSON-LD stands for JSON for Linking Data. It is a way to describe your content using a standardized vocabulary called Schema.org. You put it in a <script type="application/ld+json"> block in your <head>. Search engines read it and use it to generate rich results like star ratings, recipe cards, and FAQ accordions.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"headline": "How to Learn HTML",
"author": {
"@type": "Person",
"name": "Jane Smith"
},
"datePublished": "2025-01-15"
}
</script>
Common Schema Types
Schema.org defines hundreds of types. The most commonly used ones include Article for blog posts, Product for e-commerce items, LocalBusiness for physical stores, Person for people, and Event for upcoming happenings.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Product",
"name": "Wireless Headphones",
"image": "https://example.com/headphones.jpg",
"description": "Premium noise-cancelling headphones",
"brand": { "@type": "Brand", "name": "AudioTech" },
"offers": {
"@type": "Offer",
"price": "79.99",
"priceCurrency": "USD",
"availability": "https://schema.org/InStock"
}
}
</script>
FAQ Structured Data
One of the easiest ways to get rich results is with FAQ structured data. If your page has questions and answers, mark them up with the FAQPage type. Google may show your questions directly in search results as expandable accordions.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": "What is HTML?",
"acceptedAnswer": {
"@type": "Answer",
"text": "HTML is the standard language for creating web pages."
}
},
{
"@type": "Question",
"name": "Is HTML hard to learn?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No, HTML is one of the easiest languages to learn and a great starting point for web development."
}
}
]
}
</script>
Testing Your Structured Data
After adding structured data to your page, use Google's Rich Results Test tool to verify it works. Paste your URL or HTML source, and it will tell you if there are any errors or warnings. Always validate before publishing.
<!-- Place this in your head for best results -->
<head>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "My Awesome Blog",
"url": "https://myblog.com"
}
</script>
</head>