FAQ schema generator — FAQPage JSON-LD from plain Q and A text

Paste your questions and answers as simple "Q:" and "A:" lines, and the tool turns them into schema.org FAQPage structured data (JSON-LD), ready to drop into your page as a script tag or to use as plain JSON.

Live demo · real result from this tool
Output

3 questions

<script type="application/ld+json">{  "@context": "https://schema.org",  "@type": "FAQPage",  "mainEntity": [    {      "@type": "Question",      "name": "How long does delivery take?",      "acceptedAnswer": {        "@type": "Answer",        "text": "Most orders arrive within 3–5 business days."      }    },    {      "@type": "Question",      "name": "Can I return an item?",      "acceptedAnswer": {        "@type": "Answer",        "text": "Yes. You can return unused items within 30 days for a full refund."      }    },
    {
      "@type": "Question",
      "name": "Do you ship internationally?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "We ship to the UK and the EU."
      }
    }
  ]
}
</script>

The questions and answers must also be visible on the page. Since August 2023 Google shows FAQ rich results only for well-known, authoritative government and health websites, but the markup remains valid schema.org data that other services can read. Test it with Google's Rich Results Test or the Schema Markup Validator.

Processed on your device — nothing is uploaded.

How to use the FAQ schema generator

  1. Paste your FAQ into Questions and answers (Q: … / A: …): a line starting “Q:” with the question, then a line starting “A:” with the answer.
  2. Leave a blank line between pairs if you like; it is optional.
  3. Choose the Output: <script> tag to paste into HTML, or JSON only for tools that want raw JSON.
  4. Read any warnings about questions without answers.
  5. Copy the code or download faq-schema.html or faq-schema.json.

What it does and when to use it

FAQPage markup tells search engines and other software, in a standard format, which questions a page answers. Writing the JSON by hand is error-prone: one missing comma or quote breaks it. This tool builds it for you from plain text, so you can keep the source in a document and regenerate whenever the FAQ changes.

For other kinds of structured data, such as Organization, Product or Article, use the schema JSON-LD generator. For the title and description tags of the same page, try the meta tag generator. To check other JSON against a schema, use the JSON Schema validator.

How it works

The tool reads your text line by line. A question line starts a new pair and closes the previous one. Answer lines are collected until the next question. Pairs with no answer are skipped and listed in a warning, as are answers that appear before any question.

Each pair becomes a Question with a name and an acceptedAnswer of type Answer whose text is your answer. They sit inside one object with "@context": "https://schema.org" and "@type": "FAQPage", printed with two-space indentation. In the script version, every < is written as \u003c. That stops an answer containing “</script>” from ending the script early, and JSON readers still see the same text. Nothing is sent to a server.

Worked examples

Default delivery FAQ. Three pairs about delivery, returns and shipping give a script tag with three questions. The first is "name": "How long does delivery take?" with the answer “Most orders arrive within 3–5 business days.”

Mixed formats and a missing answer. “Question: Do you deliver on Sundays?”, “Answer - No, Monday to Saturday only.” and “Q: Is there a warranty?” with JSON output. One question is produced, and the warning says “Is there a warranty?” has no answer.

Unsafe characters. An answer “Yes </script> really” becomes "text": "Yes \u003c/script> really" in the script tag.

No questions at all. Text with only “A: orphan answer” returns “No question-and-answer pairs found.” with a hint about the format.

Limits and tips

  • Answers are stored as plain text, exactly as typed. Keep them short and factual.
  • Only mark up questions that you answer yourself, not questions from users with many answers; schema.org has QAPage for that.
  • The JSON-only output does not escape <. Use the script tag version when pasting straight into HTML.

Frequently asked questions

Will FAQ schema give my page FAQ rich results in Google?
Probably not. Since August 2023 Google shows FAQ rich results only for well-known, authoritative government and health websites. The markup is still valid schema.org data that other search engines and tools can read, but do not expect the expandable questions in Google results.
Do the questions have to be visible on the page?
Yes. Structured data should describe content that people can see. Put the same questions and answers on the page, for example in an FAQ section, and keep the two in sync when you edit.
Which line formats does the tool understand?
Lines starting with Q or Question, and A or Answer, followed by a colon, full stop, closing bracket or dash, in any letter case. An answer can run over several lines; extra lines after a question are added to the question.
Where do I paste the script tag?
Anywhere in the page's HTML, in the head or the body. Many site builders have a "custom code" or "header scripts" box for this. Test the page afterwards with Google's Rich Results Test or the Schema Markup Validator.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close