Free auditStart free
GlossaryGlossary · Structured data

JSON-LD

JSON-LD is a JSON-based format for linked data, and Google's recommended way to add structured data. Syntax, @context, @type, and a working example.

3 min
read
4
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

JSON-LD is a JSON-based format to serialize Linked Data and a W3C Recommendation since July 2020. In SEO you place it in a script tag with type application/ld+json, so the visible HTML stays untouched. Google lists it as its recommended structured data format and can read it even when it is injected dynamically.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Check it

What the syntax looks like

Every JSON-LD document is valid JSON. Three keywords do most of the work: @context maps short terms to full IRIs, @type says what kind of thing a node is, and @id gives a node an identifier you can reference.
JSON-LD in a script tag
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://example.com/#org",
  "name": "Example Co",
  "url": "https://example.com"
}
</script>
02Explained

Embedding in HTML

The spec allows JSON-LD inside a <script> element with type="application/ld+json", and multiple script elements per document are supported.

Because it is separate from the content, templates and tag managers can output it, and Google reads it when it is injected dynamically.

JSON-LD also doubles as RDF, which is why the same data can feed other linked data tools. For SEO you rarely need that detail. What matters is that a parser reads your block as a graph of nodes, each with a type and properties, and that every node follows the vocabulary you named in @context.

03Explained

Why SEO uses it

Google lists JSON-LD as the recommended format, but also says to use whichever format is easiest for you to implement and maintain. Microdata and RDFa use HTML tag attributes, while JSON-LD is not interleaved with the user-visible text.

04Worth knowing

Tips most guides miss

Head or body, both fine

Google says JSON-LD is embedded in a <script> tag in the <head> and <body> elements.

Injected is fine

Google reads it when dynamically injected by JavaScript or embedded widgets. Verify with the Rich Results Test URL input, which Google recommends over pasted code.

Keep it true to the page

Don't mark up content that is not visible to readers.

05Check it

Using @id and @graph

Use @id to name a node so other nodes can point to it. The W3C spec says @id is used to "uniquely identify node objects that are being described in the document with IRIs or blank node identifiers". A node that contains only @id is a reference to a node described elsewhere in the document. To put several top-level nodes in one script, wrap them in an object with a @graph key whose value is an array of the nodes.

Test a combined @graph block in the Rich Results Test before relying on it. Separate script elements also work, and that is the simpler choice if a graph isn't needed.

Two nodes linked by @id
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "Organization",
      "@id": "https://example.com/#org",
      "name": "Example Co"
    },
    {
      "@type": "Article",
      "headline": "What is JSON-LD?",
      "publisher": { "@id": "https://example.com/#org" }
    }
  ]
}
06Checklist

Common mistakes

First2
Invalid JSON, such as trailing commas or curly quotes
A missing @context, so terms don't map to schema.org
Next2
Describing content that isn't visible on the page
Wrong script type, such as application/json
Then1
Property names that don't exist in the vocabulary

Test the page URL in the Rich Results Test to confirm Google can read the markup, and fix whatever it flags.

When you generate markup from a template, escape quotes and line breaks in titles and descriptions. One unescaped quote in a product name is enough to break the whole block.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • w3.org
  • google.com
  1. 01JSON-LD 1.1w3.org · checked 2026-10-24
  2. 02Introduction to structured data markup in Google Searchdevelopers.google.com · checked 2026-10-24
  3. 03General structured data guidelinesdevelopers.google.com · checked 2026-10-24
  4. 04Generate structured data with JavaScriptdevelopers.google.com · checked 2026-10-24
Questions

Asked a lot.

4 questions people ask next, answered from the sources on this page.

01What does JSON-LD stand for?

JSON for Linked Data. The W3C describes it as a JSON-based format to serialize Linked Data.

02Is JSON-LD only for SEO?

No. It is a general W3C format for linked data on the web. SEO is one common use.

03Can a page have more than one JSON-LD block?

Yes. The spec supports multiple script elements in a document.

04Where should the script go?

Google says JSON-LD can sit in a <script> tag in either the <head> or the <body>. Use whichever suits your templates.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly