How to use it
- Type each question and its answer as they appear on your page.
- Add more pairs, move them up or down, or remove ones you do not need. Incomplete pairs are left out and flagged.
- Copy the script and paste it into the page's HTML, in the head or the body.
- Test the page with a structured data validator to confirm the markup is read correctly.
How it works
The generator builds a schema.org FAQPage object with one Question per pair, each with an acceptedAnswer of type Answer. The JSON is produced with a real JSON serializer, so quotes, backslashes and line breaks in your text are escaped correctly. In addition, every “<”, “>” and “&” is written as a \u escape. That prevents text such as “</script>” or “<!--” in an answer from ending the script element early and breaking the page, while JSON parsers still read the original characters.
About rich results: in August 2023 Google limited FAQ rich results to well-known, authoritative government and health websites. For most other sites, FAQPage markup no longer produces the expandable questions in Google Search. It remains valid structured data that describes the page, and other consumers of schema.org data may use it.
Rules worth following: the questions and answers in the markup must also be visible on the page; each question should have a single answer written by the site (for pages where users submit answers, QAPage is the right type); and markup should not be used for advertising. Answers may contain simple HTML such as links and lists, which Google's guidelines allow in the answer text.
Examples
Product support page
Three questions about delivery, returns and warranty become a FAQPage with three Question items. Paste the script once on the support page that shows those questions.
An answer containing code
An answer that mentions “</script>” is output as \u003c/script\u003e inside the JSON, so the page's script tag stays intact and the visible text is unaffected.
Frequently asked questions
Will FAQ markup give my page rich results in Google?
Probably not, unless it is a well-known, authoritative government or health site. Google restricted FAQ rich results to those sites in 2023. The markup is still valid and can be read by other services.
Where should I put the JSON-LD script?
Anywhere in the HTML, in the head or the body. It does not display anything. Add it only to the page that actually shows these questions and answers.
Can I include links in answers?
Yes. Google's FAQ guidelines allow a limited set of HTML tags in the answer text, such as links, lists and paragraphs. Type the HTML in the answer; it is escaped safely for the script.
Why are \u003c sequences in the output?
They are the JSON escape for “<”. Writing it this way keeps the script tag from being closed by text inside your answers. Any JSON-LD reader decodes it back to “<”.
Privacy
The markup is generated in your browser. Your questions and answers are not sent anywhere or stored.