EPUB Table of Contents Guide

Every EPUB needs two navigation files: nav.xhtml for EPUB 3 readers and toc.ncx for backward compatibility with older systems. A missing or malformed navigation document is one of the most common causes of KDP rejection and EPUBCheck failures. This guide covers the format for both files, nested TOC structure, and what validators check.

The two navigation files in every EPUB

A valid EPUB 3 file contains two table of contents documents, serving different reading systems:

Both files must be listed in the OPF manifest. The OPF spine element references the content reading order; the navigation files are separate from the spine but must point to the same content files.

nav.xhtml format (EPUB 3)

The nav.xhtml file is a complete XHTML document. The TOC itself lives inside a <nav epub:type="toc"> element. Each chapter is an <li> containing a link to the chapter's XHTML file:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:epub="http://www.idpf.org/2007/ops">
<head>
  <meta charset="utf-8"/>
  <title>Table of Contents</title>
</head>
<body>
  <nav epub:type="toc" id="toc">
    <ol>
      <li><a href="chapter01.xhtml">Chapter 1: The Beginning</a></li>
      <li><a href="chapter02.xhtml">Chapter 2: The Middle</a></li>
      <li><a href="chapter03.xhtml">Chapter 3: The End</a></li>
    </ol>
  </nav>
</body>
</html>

The epub:type="toc" attribute on the <nav> element is required — it signals to reading systems that this element is the table of contents. Without it, the nav.xhtml file exists but may not be recognized as navigation.

toc.ncx format (EPUB 2 / backward compatibility)

The toc.ncx file uses a different XML structure. Each chapter is a <navPoint> element with a sequential playOrder attribute. The dtb:uid meta value should match the book's unique identifier from the OPF:

<?xml version="1.0" encoding="utf-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
  <head>
    <meta name="dtb:uid"   content="urn:uuid:YOUR-BOOK-UUID-HERE"/>
    <meta name="dtb:depth" content="1"/>
  </head>
  <docTitle><text>Book Title Here</text></docTitle>
  <navMap>
    <navPoint id="np-1" playOrder="1">
      <navLabel><text>Chapter 1: The Beginning</text></navLabel>
      <content src="chapter01.xhtml"/>
    </navPoint>
    <navPoint id="np-2" playOrder="2">
      <navLabel><text>Chapter 2: The Middle</text></navLabel>
      <content src="chapter02.xhtml"/>
    </navPoint>
    <navPoint id="np-3" playOrder="3">
      <navLabel><text>Chapter 3: The End</text></navLabel>
      <content src="chapter03.xhtml"/>
    </navPoint>
  </navMap>
</ncx>

Nested TOCs — parts and chapters

For books with a hierarchy — parts containing chapters, or chapters with sections — both nav.xhtml and toc.ncx support nesting. In nav.xhtml, nest a second <ol> inside the parent <li>:

<nav epub:type="toc" id="toc">
  <ol>
    <li>
      <a href="part1.xhtml">Part One: The Storm</a>
      <ol>
        <li><a href="chapter01.xhtml">Chapter 1</a></li>
        <li><a href="chapter02.xhtml">Chapter 2</a></li>
      </ol>
    </li>
    <li>
      <a href="part2.xhtml">Part Two: The Calm</a>
      <ol>
        <li><a href="chapter03.xhtml">Chapter 3</a></li>
      </ol>
    </li>
  </ol>
</nav>

In toc.ncx, nest <navPoint> elements as children of a parent <navPoint>. Update the dtb:depth meta value to reflect the maximum nesting depth — 2 for two levels, 3 for three.

Nested TOCs work well for books with parts. For prose novels without parts, a flat single-level TOC is simpler and sufficient.

OPF manifest declarations

Both navigation files must be declared in the OPF manifest. nav.xhtml requires the properties="nav" attribute so reading systems can locate it:

<!-- In content.opf, inside <manifest> -->
<item id="nav"    href="nav.xhtml"
      media-type="application/xhtml+xml"
      properties="nav"/>
<item id="ncx"    href="toc.ncx"
      media-type="application/x-dtbncx+xml"/>

The spine element also needs a toc attribute pointing to the NCX item id:

<spine toc="ncx">
  <itemref idref="chapter01"/>
  <itemref idref="chapter02"/>
  <itemref idref="chapter03"/>
</spine>

KDP navigation requirements

KDP validates that an uploaded EPUB contains a navigation document before accepting the file. Files missing nav.xhtml fail with a navigation error. KDP uses the navigation document to generate the in-book Kindle TOC — the table of contents readers access from the Go To menu on their device.

Each entry in your nav.xhtml should link to a content file that exists in the EPUB archive and is listed in the OPF manifest. Links to files that are present in the nav but missing from the archive cause navigation errors on Kindle devices.

Apple Books is stricter: it requires EPUB 3 and validates nav.xhtml more rigorously than KDP. Run your EPUB through the free EPUB Validator before uploading to any platform to catch navigation errors before the store sees them.

Frequently asked questions

Do I need both nav.xhtml and toc.ncx, or just one?

A valid EPUB 3 file requires nav.xhtml as its primary navigation document. Including toc.ncx as well is strongly recommended: it provides backward compatibility for older reading systems and some validators check for it. Most EPUB build tools generate both automatically. If you are building an EPUB manually and only have one, you must have nav.xhtml — a toc.ncx alone is not sufficient for EPUB 3.

What happens if nav.xhtml is missing from my EPUB?

EPUBCheck reports a missing navigation document error and the file fails validation. KDP will reject the upload with a navigation error. Apple Books and Kobo also require a valid navigation document. This is one of the most common structural errors in manually edited EPUB files — the nav.xhtml must exist and be listed in the OPF manifest.

Does KDP use my nav.xhtml to build the Kindle in-book table of contents?

KDP uses the navigation document to generate the in-book Kindle TOC that readers access from the Go To menu on their device. The entries in your nav.xhtml become the navigable chapters in the Kindle reading experience. Entries that point to non-existent content files will cause navigation errors on the device.

Can the nav.xhtml TOC have different entries than the toc.ncx TOC?

Technically yes, but they should match. The nav.xhtml is the authoritative navigation document for EPUB 3 readers. The toc.ncx serves older systems. If they differ, users on different platforms will see different TOC entries — which creates a confusing experience. Keep them consistent.

My EPUB validator says "Missing NCX navigation (toc.ncx)" — what does that mean?

The OPF manifest references toc.ncx but the file is absent from the EPUB archive. This commonly happens with Scrivener and older Calibre exports that generate the OPF reference without creating the actual file. The fix is to either generate a valid toc.ncx and add it to the archive, or remove the OPF reference to it — though for backward compatibility, generating the file is the better option. The BookKraft TOC Generator outputs a valid toc.ncx alongside nav.xhtml.

Does BookKraft's TOC Generator output both nav.xhtml and toc.ncx?

Yes. The TOC Generator outputs Kindle HTML format (for direct manuscript insertion), EPUB 3 nav.xhtml, and NCX XML (toc.ncx) — all three from one set of chapter headings. You get both navigation files in the correct format for each platform.

For the full EPUB build workflow — manuscript cleanup, formatting, and platform submission — see the EPUB formatting guide. For Kindle-specific EPUB structure and OPF requirements, see the Kindle EPUB format guide. For a complete reference on OPF metadata fields — dc:title, dc:language, dc:identifier, and how stores use each field — see the EPUB metadata guide. For EPUB CSS — safe properties for paragraphs, headings, and page breaks — see CSS for EPUB files.

For common validation errors related to navigation — missing nav.xhtml, malformed toc.ncx, broken content references — see the missing NCX navigation error guide and the full EPUB error reference. For how chapter file splitting relates to TOC entry structure — how spine items map to navigable chapters — see chapter breaks in EPUB.

Generate nav.xhtml and toc.ncx from your chapter headings.

Paste your manuscript or chapter list. Get correct nav.xhtml (EPUB 3) and toc.ncx (NCX) output — no hand-coding.

Open TOC Generator →