EPUB repair guide
How to Fix EPUB Validation Errors
An EPUBCheck report tells you which file failed, the relevant line when available, and what rule was broken. Use that evidence to make a focused repair, then validate the complete book again.
A reliable repair workflow
- Validate the original EPUB. Keep the complete code, message, file path, line, and column together.
- Fix fatal errors and errors first. Earlier package or parsing failures can cause later warnings that disappear after the root problem is repaired.
- Open a working copy. EPUB is a ZIP-based format. Use an EPUB editor such as Sigil or Calibre Editor, or extract a copy with a ZIP tool.
- Repair the referenced file. Edit the OPF package, XHTML document, navigation file, stylesheet, or asset identified by the report.
- Repackage correctly. If you rebuild the ZIP manually, the uncompressed
mimetypefile must be first and the internal directory structure must stay intact. - Revalidate and preview. Repeat until the relevant errors are gone, then inspect the book in Kindle Previewer or the preview tool for your target platform.
A passing EPUBCheck result confirms specification-level validity. It does not guarantee acceptance by Amazon KDP or another retailer, which may apply additional content and presentation checks.
Start with the complete message
An error code often names a category, not a universal one-line repair. Read the message and location before editing. These examples cover three real report patterns:
- HTM-004: Irregular DOCTYPE
Check whether the content follows EPUB 2 XHTML or EPUB 3 HTML rules. - OPF-054: Invalid date value
Replace a non-standard package metadata date with a valid W3C/ISO-style value. - RSC-005: Error while parsing file
Use the full schema message to identify the missing or invalid structure.
Do not repair the report in isolation
One edit can affect navigation, the manifest, the spine, links, or styling elsewhere in the book. Keep an untouched backup, change only what the message supports, and validate the entire EPUB after every repair round.