OnlineTextLab
Esc

Structured Data Validator

Paste JSON-LD before you publish.

Checks as you type, in your browser. Your code is not sent anywhere.

Runs on your device. Your files and text are not uploaded.

About Structured Data Validator

JSON-LD fails quietly. Nothing on the page breaks when a block has a typo, so the error can sit in production for months. This validator is for the moment before that: you have code in front of you, from a developer, a CMS field or your own editor, and you want to know whether it is right.

It works in two stages, the way a compiler does. First comes syntax, because a parser that hits one bad comma gives up on the whole block. You get the line and column, the surrounding lines with a marker on the exact character, and an explanation written for a person. Once the JSON is sound, each item is laid out property by property against what Google documents for that type.

No URL is involved and nothing leaves your browser, so unreleased code and client work are safe to paste. Want to look at a page that is already live? The schema markup checker starts from an address instead.

How it works

Browsers word JSON.parse errors differently, and some report no position at all, so the first error is found by a small parser of our own. Because it walks the text itself, it can recognise the mistakes people really make and name them: a trailing comma, curly quotes from a word processor, single quotes, a comment, an unquoted key, a line break inside a string, two objects with no array around them.

Repair and re-check appears when the problem is one of the safe kinds. It removes trailing commas and comments, straightens curly quotes and escapes raw line breaks, then keeps the result only if it now parses. It never guesses at a missing bracket or value.

Valid items, including each entry of an array or @graph, are compared with a table drawn from Google's documentation. Required means Google lists it as needed for that feature. Article, for instance, has no required properties at all, which surprises people used to older checklists. Typed items nested inside, such as an AggregateRating in a Product, get the same treatment, and date fields are checked for ISO 8601.

How to use Structured Data Validator

  1. Paste into the box labelled Paste JSON-LD or a script tag. Checking starts as you type, and a whole page's HTML also works.
  2. Or press Try a broken example or Try a Product example to see each kind of result.
  3. If the headline names a line and column, fix that spot or press Repair and re-check when it is offered.
  4. When the JSON is valid, read What to fix, then the table under Property by property.
  5. Press Format to tidy your code, or Copy formatted JSON to take the clean version.

A Recipe with a trailing comma

Input
{
  "@context": "https://schema.org",
  "@type": "Recipe",
  "name": "Brown butter banana bread",
  "image": "https://example.com/banana-bread.jpg",
  "recipeYield": "1 loaf",
}
Output
Line 6, column 26: A trailing comma before the closing }.
Delete this comma. JSON does not allow a comma after the last property.

After Repair and re-check:
Valid, and Recipe has what Google requires

The comma is legal in JavaScript, which is why this slips past developers. Once repaired, the Recipe qualifies because Google requires only name and image, and the remaining properties appear as recommended rather than as errors.

When it helps

  • Reviewing JSON-LD a developer hands you before it ships.
  • Debugging a CMS template, where a field containing a line break or a quotation mark breaks the block on only some pages.
  • Pasting one block flagged as broken by the schema markup checker to find the exact error.

Tips for a better result

  • If only some pages break, suspect the values rather than the template. Text with a double quote or a paragraph break, fed in unescaped, is the usual cause.
  • Fix one error at a time and watch the headline. A parser stops at the first problem, so the next one appears only once this one is gone.
  • Treat recommended properties as worth having when you hold the data. Inventing a value to fill a row can break Google's rules on matching visible content.

Good to know

  • Only JSON-LD is validated. Microdata and RDFa in pasted HTML are ignored.
  • The rules cover common types and Google's documented requirements. A type outside the table has its properties listed without any judgement, and that does not make it wrong.
  • It cannot compare your markup with a page, because no page is involved. Whether the values match what readers see is for you to check, or for the schema markup checker on a live URL.
  • Passing here is not a verdict from Google. Google's Rich Results Test remains the reference for features it supports, and it can apply policies no static check can see.

Questions people ask

What is the difference between this and the schema markup checker?

This one starts from code you paste, and its job is correctness: syntax first, then each property. The checker starts from a live URL, and its job is inventory: everything on the page, in any format, with what each type can earn and whether its name appears in the page text.

Why does my Article pass with almost nothing in it?

Google says Article has no required properties and recommends adding the ones that apply, such as headline, image, datePublished and author. Older tools marked those as required. They appear here as recommended, and filling them in is still worthwhile because they help Google present the page.

Does valid here mean I will get a rich result?

No. It means the code parses and has what Google documents as required. Google states that it does not guarantee your structured data will show up, even when a test passes, and decides based on the query, the page and its quality.

What to use next

Learn more

Last reviewed . Read our editorial policy.