✨ Get 25% OFFon any plan. Use the coupon:

What JSON-LD is and how to use it in structured data

By Tiago CostaUpdated on July 2, 2026

Illustration of a JSON-LD code block linking a web page to a search result enriched with stars and image.
Definition

JSON-LD (JavaScript Object Notation for Linked Data) is the recommended way to write structured data. In practice, it:

  • lives in a separate script block, without cluttering the visible HTML;
  • uses the Schema.org vocabulary to label each piece of information;
  • tells Google whether a snippet is an author, a price, a rating or a date;
  • enables rich results (stars, FAQ, image) on the results page.

What JSON-LD is

JSON-LD stands for JavaScript Object Notation for Linked Data, a format for describing data in a way that both humans and machines can read. In the SEO context, it plays a very specific role: it is the recommended way to add structured data to a page, inside a script block.

The core idea is to give explicit meaning to the content. For a person, the phrase "article written by Ana Silva on May 12" is clear. For the search engine, it is just text. With JSON-LD, you label "Ana Silva" as the author (author) and the date as datePublished, and Google starts to understand it as trustworthy metadata, and can show the author and the date in the result.

It helps to separate two meanings. For developers, JSON-LD is a W3C standard used in any exchange of linked data. For SEO, it is above all the vehicle for schema markup: the envelope where the Schema.org vocabulary is written to generate rich results.

How JSON-LD works

A JSON-LD for SEO lives inside a <script type="application/ld+json"> tag, usually in the head or at the end of the page body. Because it stays isolated from the visible HTML, it does not interfere with the layout and is easy to maintain, which is exactly why Google prefers it.

Every block starts with two required keys. The @context property points to the vocabulary used (almost always Schema.org), and the @type property defines what the page is (an Article, a Product, a FAQPage). From there, you fill in the properties of that type, such as name, author, price or datePublished.

The flow is straightforward: the crawler reads the page, finds the JSON-LD block, interprets each property and, if the content is eligible, shows an enhanced feature in the result. The same data also helps feed the knowledge graph, connecting entities such as people, brands and products.

Infographic of the anatomy of a JSON-LD block, from the script with context and properties to the rich result in search.
Anatomy of a JSON-LD block: from the script with @context and @type to the rich result in search.

JSON-LD, Microdata and RDFa: why Google prefers JSON-LD

The Schema.org vocabulary can be written in three different syntaxes. Understanding the differences helps you pick the one with the least effort and the fewest errors.

FormatWhere it sitsMaintenance
JSON-LDIn a script block separate from the content.Easy, does not depend on the visible HTML.
MicrodataIn attributes scattered across the HTML tags.Laborious, breaks with layout changes.
RDFaIn attributes inside the tags, like Microdata.Laborious and more verbose.

Google officially recommends JSON-LD precisely because it keeps the markup separate from the content, as the Google Search Central documentation explains. And the market followed that path: according to the 2024 Web Almanac, by HTTP Archive, JSON-LD already appears on 41% of the pages analyzed (up from 34% in 2022) and is the fastest growing format.

A practical JSON-LD example

Nothing explains it better than seeing the code. Below, a minimal example of marking up a blog article with JSON-LD:

  • @context: "https://schema.org", the vocabulary used.
  • @type: "Article", saying the page is an article.
  • headline: the title of the article.
  • author: an object of type Person with the name of whoever wrote it.
  • datePublished: the publication date in ISO format (for example 2026-05-12).

In practice, this block goes inside a script tag in the HTML. Each Schema.org type has required and recommended properties, and filling in the recommended ones too, not just the minimum, greatly increases the chance of the rich result being displayed. The same type of page usually reuses the same markup template, changing only the values.

Illustration comparing the JSON-LD, Microdata and RDFa formats, with JSON-LD highlighted as the one preferred by Google.

How to create and validate your JSON-LD step by step

You do not need to write everything by hand. A routine that works for most sites:

  • Choose the right type: identify what the page represents (an article, a product, a FAQ) and select the matching type on Schema.org.
  • Generate the block: use a JSON-LD generator or an SEO plugin. On platforms like WordPress, extensions insert the markup automatically.
  • Fill it with real data: never mark up a review or a price that does not exist on the page, because that violates the guidelines and can trigger a penalty.
  • Validate before publishing: run the block through Google's Rich Results Test and the Schema.org validator to catch errors and warnings.
  • Monitor in Search Console: follow the enhancements report to see which pages are eligible and fix issues.

Once published, the search engine needs to crawl the page again to recognize the markup, so rich results can take a few days to appear.

JSON-LD, SEO and AI visibility

JSON-LD is not a direct ranking factor, but it works in favor of SEO in two ways. First, it enables rich results, which take up more space, draw more attention and tend to get more clicks. Second, it makes the content clearer to the machine, reducing the chance of the search engine reading the page wrong.

There is also a more recent gain. Generative search engines and AI assistants use the semantic structure to understand and cite content with more confidence. A page well marked up with JSON-LD tends to be easier to summarize and reference inside AI Overviews, adding traditional SEO value to AI optimization. Because it is lightweight, standardized and recommended by Google, JSON-LD has become the technical foundation of any serious technical SEO strategy.

FAQ

Frequently asked questions

What is JSON-LD used for?

JSON-LD is used to add structured data to a page, explicitly describing what each piece of information means (author, price, rating, date). With that, Google understands the content better and can display rich results, such as review stars, frequently asked questions and the publication date in search.

What is the difference between JSON and JSON-LD?

JSON is just a generic data exchange format, made of key and value pairs. JSON-LD is an extension of JSON designed for linked data: it adds the @context and @type properties, which give semantic meaning to the information and link it to a vocabulary such as Schema.org. Every JSON-LD is a JSON, but not every JSON is a JSON-LD.

Is JSON-LD necessary?

No. JSON-LD is not mandatory and most pages rank without it. However, without structured data a page loses eligibility for rich results, which increase visibility and click-through rate. For content that can gain visual features in search, such as products, recipes and articles, it is highly recommended.

Is JSON-LD valid JSON?

Yes. Every JSON-LD block is, technically, valid JSON, and can be read by any JSON parser. The difference is that JSON-LD adds reserved keys, such as @context and @id, which give it the meaning of linked data, without breaking the JSON syntax.

Where should the JSON-LD code go on the page?

The code goes in a script block with the type attribute set to application/ld+json. It can sit in the head or at the end of the page body, and Google recognizes both positions. What matters is that the block is rendered in the HTML the search engine crawls.

Structured data on autopilot

Automarticles writes and optimizes your blog articles on its own, already with the JSON-LD and markup Google needs to feature your content.

Start free trial
Keep learning

Related concepts

Structured dataStructured data is a standardized code format that describes the content of a page for search engines, explicitly telling them what each element means (a price, a rating, a recipe, an event). Written with the Schema.org vocabulary, it helps Google interpret the page accurately and display rich results, such as review stars, frequently asked questions and images directly on the results page.Schema markupSchema markup is the markup code you add to a page's HTML using the Schema.org vocabulary to explicitly describe what each element means (a product, a review, a frequently asked question, an event). It does not change what the visitor sees, but it helps Google understand the content accurately and display rich results, such as stars, prices and questions directly on the results page.Schema.orgSchema.org is the standardized structured data vocabulary created jointly by Google, Microsoft, Yahoo and Yandex to describe page content in a way machines understand. It defines types (such as Product, Article, Event) and properties (such as name, price, author) that search engines recognize. It is not a piece of code you install, but the shared dictionary you use when marking up a page with structured data.Technical SEOTechnical SEO is the set of optimizations made to a site's infrastructure so that search engines can crawl, understand, index and display its pages efficiently. While content takes care of what the page says, technical SEO takes care of the invisible foundation that supports everything: loading speed, URL structure, internal link architecture, mobile version, security, structured data, indexing and status codes. Without that foundation in order, even the best content may never appear in search.