If you publish on KDP (Kindle Direct Publishing), you probably know the pattern:
- You upload, and only then get the dreaded "no table of contents" warning
- In the Kindle previewer, tapping a chapter in the TOC lands you in the middle of the chapter
- The book goes through — with a � (U+FFFD) sitting in the middle of a paragraph
None of these show up just because "the file opens." They surface at ingestion or in the previewer, when fixing them costs you another upload cycle. Plenty of authors end up writing their own Python scripts to pre-check their EPUBs. This post organizes those checks into one checklist, grouped by how they fail — and at the end I'll point to a free browser tool that runs all of them at once (full disclosure: it's from a site I'm involved with).
1. Package structure: is it a valid book at all?
- The
mimetypeentry is first in the ZIP and stored uncompressed. This is mandated by the EPUB spec. Tools like Pandoc and Calibre get it right; it breaks when you re-zip a book by hand. - Every file in the manifest actually exists, and every spine reference resolves. Renamed chapters and swapped images leave dead references behind, and dead references break chapters and styling.
- Every XHTML file is well-formed XML. A single unclosed tag or a raw
&can get a chapter — or the whole book — rejected by strict readers and store ingestion. If you hand-roll your conversion from Markdown, watch out for HTML-isms like<input>sneaking into a checklist and quietly breaking XHTML validity.
2. The table of contents: where KDP warnings are born
- A TOC exists (a nav document for EPUB 3,
toc.ncxfor EPUB 2). This is what KDP's "no table of contents" warning is about. A page of hand-made hyperlinks in Word is not a TOC as far as KDP's parser is concerned. - TOC links land somewhere real. The target file must exist — and if the link has a
#fragment, that anchor id must exist in the target file. A TOC that displays is not the same as a TOC that navigates. - TOC targets sit on headings, with ASCII ids. This is the Pandoc trap: with Japanese (or any non-ASCII) source text, Pandoc's auto-generated ids can be non-ASCII, and the id often lands on a
<section>element instead of the heading. On Kindle, the jump then resolves imprecisely and you land mid-chapter, next to a figure. The durable fix is to move ids onto theh1–h6elements and keep them ASCII — and it's worth checking for this pattern before you upload.
3. Body text: the quiet breakage
- No U+FFFD replacement characters (�). They're the fingerprint of a failed encoding conversion. Your eyes will glide over a look-alike character or a missing one; a machine search won't.
- No empty or near-empty chapters. Usually a conversion slip or a leftover placeholder.
- No tables with five or more columns. On a phone-width Kindle app they're effectively unreadable. Split the table, or turn it into an image or a list.
4. Metadata, cover, images
- Title, author, and language are set. A missing or malformed language tag in particular breaks hyphenation and text-to-speech, and strict validators flag it as an error.
- The cover matches store recommendations. KDP recommends 2560 × 1600 px (1.6 : 1). Much smaller covers look soft in the store; a very different ratio gets letterboxed.
- Images have alt text. KDP's submission flow asks you to declare accessibility (whether informative images have alternative text). Missing alt text is cheap to fix before upload and annoying after.
Running the whole list at once
All of the above can be checked in one pass with the EPUB Checker on e-ink.me — the site I work on:
EPUB Checker (free, no upload): https://e-ink.me/en/tools/epub-checker
- Drop in an EPUB and it runs 21 checks — structure, TOC, metadata, cover, images, heading order, plus the KDP-specific items from this post (dead TOC targets, anchor element/id problems, XHTML well-formedness, U+FFFD, cover size, wide tables) — and returns an error / warning / suggestion report
- The file never leaves your device. Everything runs locally in your browser, so unpublished manuscripts are fine
- Failed checks link straight to the matching free repair tool (TOC rebuild, metadata editor, cover changer, and so on)
Two honest caveats:
- This is not an official KDP validator. Treat it as a preflight for everything a machine can check, and keep Kindle Previewer as your final visual pass
- It does not measure layout — text or tables overflowing the page is a rendering question, and no static checker can answer it
The point of a preflight
"Conversion finished" and "content verified" are two different events. Every problem you let a machine find first is one you don't have to squint for in the previewer. If you ship on KDP, make the checklist a habit.
