1. Home
  2. Writing & text tools
  3. HTML Accordion Generator (No JavaScript)

HTML Accordion Generator (No JavaScript)

Add an FAQ or collapsible sections to any web page, email template or CMS without a script or a plugin, using the HTML elements browsers already understand.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use HTML Accordion Generator (No JavaScript)

  1. Write questions as ## headings or Q:/A: pairs.
  2. Choose the options: CSS, exclusive, first open, JSON-LD.
  3. Copy the HTML into your page.

Features

  • details and summary: keyboard and screen-reader friendly by default
  • Answers in Markdown (bold, links, lists)
  • Exclusive mode with the name attribute
  • Optional CSS with +/− markers and dark mode
  • Optional FAQPage structured data

Supported formats

Input

  • Typed or pasted text

You get

  • HTML

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the HTML Accordion Generator (No JavaScript) is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Guide

Accessible accordions with details and summary

FAQs, product details and help articles often use accordions: a list of headings that expand to show more. Many sites build them with JavaScript libraries, but HTML has had a native accordion for years — the details element with a summary inside. It needs no script, works with a keyboard and screen readers out of the box, and is supported by every current browser. This generator turns a list of questions and answers into ready-to-paste markup.

Writing the items

Type each question as a ## heading with its answer underneath, or as Q: and A: pairs, or as blocks separated by a blank line where the first line is the question. With Markdown answers on, the answers may use bold, links and lists, and they are sanitised so nothing unsafe is produced. Turn it off to treat answers as plain text paragraphs.

Why details and summary

The browser handles everything: clicking or pressing Enter or Space on the summary toggles the item, screen readers announce it as expandable and say whether it is open, and Ctrl+F finds text inside closed items and opens them. Because there is no script, the accordion works in pages with strict security policies, in CMS blocks that strip scripts, and before any JavaScript has loaded.

One open at a time

Give several details elements the same name attribute and the browser closes the others when one opens, like a classic exclusive accordion. It is supported in Chrome and Edge 120 and later, Safari 17.2 and Firefox 130; older browsers ignore the attribute and simply allow several open at once, which is a harmless fallback. You can also start with the first item open.

Styling

The optional CSS gives each item a border and padding, replaces the default triangle with a plus that becomes a minus when open, adds a visible focus ring for keyboard users, and switches to dark colours when the visitor’s system uses dark mode. Change the class name to avoid clashes with your site’s styles, or leave the CSS out and style it yourself.

FAQ structured data

Switch on FAQPage structured data and a JSON-LD script describing each question and answer is added. Since 2023, Google shows FAQ rich results only for well-known government and health sites, so most sites will not see a visual change in search. The markup is still valid, other search engines and assistants can read it, and it must match questions that are visible on the page.

A worked example

The sample is a three-question shop FAQ. It produces three details elements, and the delivery answer keeps “2 working days” in bold. Switching on exclusive mode adds name="faq" to each, and the structured-data option appends a FAQPage script.

Where to paste it

Use a Custom HTML block in WordPress, an HTML embed in Webflow or Squarespace, a raw HTML section in a static site, or directly in a template. Many email clients do not support details, so for email keep answers visible instead.

Convert longer answers with Markdown to HTML, put a pricing table above the FAQ with the Comparison Table Maker, escape code examples with the HTML Encoder, or build a contents list with the Markdown TOC Generator.

Checked against the current version of the HTML Accordion Generator (No JavaScript) on .

Frequently asked questions

Can I animate the opening and closing?

Modern Chrome and Edge can animate details with the CSS interpolate-size property and the ::details-content pseudo-element; other browsers simply open instantly. The generated CSS leaves animation out so it behaves the same everywhere.

Does hidden accordion text count for SEO?

Search engines index the text inside closed details elements, and Google has said content hidden for usability on mobile is treated normally. Keep the most important information visible anyway, because many visitors never open an item.

Why is the JSON-LD script escaped?

Any less-than sign in your answers is written as \u003c inside the structured data. That stops text such as a closing script tag in an answer from ending the script element early, which would break the page or open it to injection.

Do details and summary work in every browser?

Yes, in all current browsers. The newer name attribute, which lets only one item stay open, works in Chrome and Edge 120+, Safari 17.2+ and Firefox 130+; older browsers simply allow several open at once.

Will FAQ schema give me rich results?

Google limited FAQ rich results to well-known government and health sites in 2023, so most sites will not see them. The markup is still valid, and it must describe questions that are visible on the page.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.