How to Add or Fix a Table of Contents in an EPUB (Calibre and Sigil)
A working table of contents is essential for EPUB distribution — KDP, Kobo Writing Life, and Apple Books all require a navigable TOC. If your EPUB has a missing or broken TOC, here's how to fix it in under 10 minutes.
How EPUB Tables of Contents Work
EPUB 3 uses two TOC components:
- NCX file (toc.ncx): The EPUB 2 navigation document — still required by some older readers and some publishing validators
- NAV document (nav.xhtml): The EPUB 3 navigation document — required for EPUB 3 compliance and used by modern readers
Both are generated automatically from heading tags (H1, H2, H3) in your chapter HTML files. No heading tags → no TOC entries. This is why PDFs converted without heading detection produce EPUBs with empty TOCs.
Method 1: Rebuild TOC in Calibre
- Open Calibre. Add your .epub file.
- Right-click → Edit book (opens Calibre's built-in editor).
- In the editor, go to Tools → Table of Contents → Edit Table of Contents.
- Calibre shows the current TOC. Click Generate TOC from major headings to rebuild from H1/H2/H3 tags automatically.
- Review the generated entries — add, remove, or reorder as needed.
- Click OK, then File → Save.
This regenerates both the NCX and the NAV document. If your chapter files don't have heading tags, the TOC will still be empty — you'll need to add headings first (see below).
Method 2: Build TOC in Sigil
- Open Sigil (free, sigil-ebook.com). Open your .epub.
- Go to Tools → Generate Table of Contents.
- The TOC editor shows detected headings. Drag to reorder, check/uncheck to include or exclude entries.
- Click OK. Sigil writes the NCX and NAV files.
- Save the EPUB (Ctrl+S).
Adding Heading Tags to Chapter Files
If your EPUB has no headings (common in PDFs converted without layout analysis), you'll need to add them before generating a TOC:
- In Calibre's editor or Sigil, open each chapter HTML file in Code View.
- Find the chapter title text (currently a
<p>tag) and change it to<h1>(main chapters) or<h2>(sub-sections). - After adding headings to all chapters, regenerate the TOC using the steps above.
TOC Requirements for KDP, Kobo, and Apple Books
- Amazon KDP: Requires a working NCX or NAV. KDP's EPUB validator will flag a missing or empty TOC as a warning. An EPUB with no TOC may still publish but will get a lower quality score.
- Kobo Writing Life: Requires a functional NAV document (EPUB 3). EPUBs without a TOC are rejected or require manual review.
- Apple Books Connect: Requires a valid NAV document. EPUBs are checked with EPUBCheck — a missing TOC fails validation.
- Draft2Digital: Generates its own TOC from chapter structure, but having a pre-built TOC improves accuracy.
Preventing the Problem at Conversion
If you're converting a PDF to EPUB, use a converter that detects heading structure — this is what generates automatic TOC entries. toolkit.bot uses layout analysis to identify font size, bold, and position patterns to detect headings. The resulting EPUB includes a working TOC without any manual work.
Convert at toolkit.bot/pdf2epub — the EPUB output includes both NCX and NAV documents with entries for all detected chapter headings.
Need an EPUB with a working table of contents from your PDF? toolkit.bot detects headings automatically.
Convert PDF to EPUB →