Help readers find the right section
Table of Contents Generator
Turn an article's headings into a useful contents list. Keep the page layout intact, choose what belongs in the list, and give readers a clear way to move through a long page.
Customize and preview free. Code export: $11.99 once for personal use. Compare packs and commercial licenses.
Choose the content to include.
Use main, article, or a single class or ID such as .blog-item-content-wrapper or #article. The selector must match exactly one content area on your published page. Inspect your page to choose the right target; template markup varies.
The list appears only when it finds at least two eligible headings. It excludes headers, footers, navigation, sidebars, hidden content, and headings with duplicate existing IDs. Existing unique IDs stay in place; headings without an ID receive one for linking.
Set the appearance and reading controls.
Sticky positioning depends on the surrounding container. It becomes inline on narrow screens. This export does not create a sidebar or move content. The header offset applies when a reader follows a link in this contents list.
Use six-digit hex colors. Text switches to black or white for contrast.
Instant scrolling is the default. Optional smooth scrolling respects reduced-motion preferences and applies only to links in this list. Following a link also moves keyboard focus to its heading.
Preview with example headings
Start each line with ## for H2, ### for H3, or #### for H4. Up to 30 matching headings appear here. These examples are not included in the export; the installed list reads your live page.
Click a preview link to select an example. This preview stays inline and does not scroll your page. Your settings remain in this open tab and are not saved to an account.
Selected example: Overview
Your next step
Like the result? Put it on your site.
Checking your tool access...
Install in the page and inspect the result.
This automatic list requires JavaScript in Code blocks, currently available on Squarespace Core, Plus, and Advanced. Check legacy-plan support before buying. Read the Code block requirements.
- Use real H2, H3, and H4 headings in the article. Confirm that your selected content area matches exactly one element and contains at least two eligible headings.
- Add an HTML Code block where the contents list should appear, turn Display Source off, and paste the complete export. Replace any older copy. Do not install this version in site-wide footer injection.
- Save and inspect the published page while signed out. Follow every link, confirm the destination and header clearance, and navigate with the keyboard.
- Try the disclosure, current-section highlight, narrow-screen layout, and reduced-motion preference. If using sticky layout, inspect its behavior within the actual page section.
- Check page changes and Back/Forward navigation. The export watches for heading and content changes. Without JavaScript, the extra contents list stays hidden and the original article remains readable.
If the list is missing, check for an absent or ambiguous content selector, too few matching headings, or duplicate IDs. For stable links shared outside this page, define and maintain your own unique anchors. Generated heading IDs are a convenience, not a permanent URL policy.
A contents click is navigation, not a purchase or inquiry. Read the complete native and custom contents guide.