Schema Markup Generator

Generate JSON-LD structured data for articles, FAQs, products, local businesses, events and more, ready to paste into your page.

Article / blog post
FAQ page
How-to
Product
Local business
Organization
Breadcrumbs
Event
Person
Article
Blog Posting
News Article
One per line
Person
Organization

Paste the block into the page's HTML (the head or the body both work), then check it with a structured-data testing tool before publishing.

What schema markup is

Schema markup is structured data that describes a page in a vocabulary search engines understand. It uses the types and properties defined at schema.org, a project founded by Google, Microsoft, Yahoo and Yandex, and tells a machine plainly that a page is a product costing $89.99, a business open until 6 p.m. or an event on 10 April.

Search engines use it to understand pages and, for some types, to show rich results: star ratings, prices, breadcrumbs in place of the URL, event dates and similar enhancements. Structured data makes a page eligible for these features. It does not guarantee them, and it is not a direct ranking factor.

Key takeaways

  • JSON-LD is the format Google recommends: one script block, separate from your visible HTML.
  • Mark up only what is visible on the page. Hidden or misleading structured data breaks search engine guidelines.
  • Valid markup makes a page eligible for rich results; it never guarantees them.
  • Empty fields are left out. A short, accurate block is better than a long one padded with guesses.
  • Test the result before publishing, and again after any template change.

Why JSON-LD

Structured data can be written three ways: JSON-LD, Microdata and RDFa. Microdata and RDFa add attributes to your existing HTML tags, which ties the data to the layout and makes both harder to maintain. JSON-LD lives in its own <script type="application/ld+json"> block, so you can add, change or generate it without touching the visible markup. Google recommends JSON-LD, and it is what this tool produces.

Here is the output for a FAQ page with two questions:

<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "Do you ship to the UK?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Yes. UK orders usually arrive in 2 to 4 business days."
      }
    },
    {
      "@type": "Question",
      "name": "Can I return an item?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "You can return unused items within 30 days."
      }
    }
  ]
}
</script>

The block can go in the <head> or the <body>. Search engines read it in either place.

The types this tool supports

TypeUse it forKey properties
ArticleNews stories, blog posts, guidesheadline, image, author, datePublished, dateModified
FAQPageA page of questions with answers written by the sitemainEntity: Question and acceptedAnswer pairs
HowToStep-by-step instructionsname, step, totalTime, supply, tool
ProductA single product pagename, image, brand, offers (price, priceCurrency, availability), aggregateRating
LocalBusinessA business with a physical locationname, address, telephone, geo, openingHoursSpecification
OrganizationYour company or publisher, usually on the home or about pagename, url, logo, sameAs
BreadcrumbListThe page's position in the site hierarchyitemListElement: position, name, item
EventA concert, class, webinar or other dated eventname, startDate, location, eventStatus, eventAttendanceMode, offers
PersonAn author or profile pagename, jobTitle, worksFor, url, sameAs

Some types are more specific versions of others. The Article type selector offers BlogPosting and NewsArticle, and Local business offers subtypes such as Restaurant, Dentist and Store. Use the most specific type that is accurate.

Search engines change which types earn rich results. In 2023 Google limited FAQ rich results to well-known government and health sites and stopped showing HowTo rich results. The markup is still valid schema.org and still describes the page, but check current search engine documentation before expecting a visual change in results.

Worked examples

A product with a brand and a price. The price is kept as typed, so 89.99 stays 89.99, and availability uses the full schema.org URL:

{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "Trail Running Shoe",
  "brand": {
    "@type": "Brand",
    "name": "Example Outdoors"
  },
  "offers": {
    "@type": "Offer",
    "price": "89.99",
    "priceCurrency": "USD",
    "availability": "https://schema.org/InStock"
  }
}

A breadcrumb trail. The last level is the current page, so its URL may be left out, and the tool numbers the positions for you:

{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://www.example.com/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Guides",
      "item": "https://www.example.com/guides/"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "Wet-weather shoes"
    }
  ]
}

For a local business, type opening hours one line per set of days, such as Mo-Fr 07:00-18:00 and Sa,Su 08:00-16:00. The tool turns each line into an OpeningHoursSpecification with the days written out in full, Monday to Friday and Saturday and Sunday in this case.

How the output is kept valid

  • Empty fields are omitted, including nested objects left with nothing in them, such as an address with no parts filled in.
  • URLs must be absolute. A value such as example.com/logo.png is listed as an error and left out until you add https://.
  • Numbers are checked for price, rating, review count, coordinates and duration.
  • Pairs must be complete. A FAQ question without an answer, or a rating without a review count, is left out with a warning.
  • The JSON is generated, never hand-assembled, so quotes, backslashes and line breaks in your text are escaped correctly.
  • The script block cannot be broken out of. Any </ in your text is written as <\/, which means the same in JSON but cannot close the script element early. A headline of Use </script> safely is output as "Use <\/script> safely".
Only mark up what visitors can see. Reviews you invented, prices that differ from the page, or FAQ answers that are not on the page break search engine guidelines and can lead to a manual action that removes rich results from the whole site.

Testing and maintaining structured data

Paste the finished block into Google's Rich Results Test or the Schema Markup Validator at validator.schema.org before publishing. The first shows which Google rich results the page is eligible for; the second checks the markup against the full schema.org vocabulary. After launch, the enhancement reports in Google Search Console list errors across the site.

Structured data drifts. A price changes on the page but not in the JSON-LD, an event is postponed, a business changes its hours. Where you can, generate the markup from the same data that fills the page, so the two cannot disagree. This tool is best for one-off pages and for working out what a template should produce.

Everything runs in your browser. The markup is built on your device; nothing you type is uploaded or stored.

Frequently Asked Questions

Where do I put the JSON-LD script?

Anywhere in the page's HTML: the head or the body both work. Most sites put it in the head. If your CMS has a field for custom head code or structured data, paste the whole block there.

Will schema markup improve my rankings?

Not directly. Structured data helps search engines understand a page and can make it eligible for rich results, which may improve click-through. It is not a ranking factor in itself, and eligibility does not guarantee a rich result.

Can I use more than one schema type on a page?

Yes. A product page might have Product and BreadcrumbList blocks, and a home page Organization. Generate each type separately and paste each block into the page. Every block should describe content that is actually on that page.

Why are some of my fields missing from the output?

Empty fields are left out on purpose. Fields with invalid values, such as a URL without https:// or a price that is not a number, are also left out and listed in a notice until you fix them.

Why is the price in quotes?

The price is kept exactly as you typed it, so 89.90 does not become 89.9. Schema.org accepts the price as text or a number, and search engines read both. Use a period as the decimal separator and no currency symbol.

What does <\/ in the output mean?

It is a safe way of writing a forward slash after a less-than sign. In JSON, a backslash before a forward slash means the same as the slash alone, but a browser cannot mistake it for the end of the script element. Your text is unchanged when the JSON is read.

Do FAQ and HowTo rich results still show in Google?

In 2023 Google limited FAQ rich results to well-known government and health websites and stopped showing HowTo rich results. Other search engines and tools may still use the markup, and it remains valid schema.org, but do not expect a visual change in Google for most sites.

How do I test the markup?

Paste the code or the page URL into Google's Rich Results Test to see which rich results it qualifies for, or into the Schema Markup Validator to check it against schema.org. Fix any errors before publishing.

Which format should opening hours use?

One line per set of days with a two-letter day code and a 24-hour time range, for example Mo-Fr 09:00-17:00 or Sa,Su 10:00-14:00. Each line becomes an OpeningHoursSpecification. Lines in any other format are listed as errors.

Related Calculators