How do I fix EPUBCheck errors?
Updated:
Run EPUBCheck, then fix the messages in order: each one gives a code such as RSC-005, the file, the line and column, and fixing the first errors often clears several later ones. Look up the code in our [EPUBCheck reference](/epubcheck/) for its usual causes and fix, edit the EPUB's files, rebuild the archive and validate again until no errors remain.
Step by step
- Run
java -jar epubcheck.jar book.epub(EPUBCheck is free, from the W3C). Add--locale enif you want the messages in English whatever your system language. - Start with fatal errors and errors; warnings do not make the EPUB invalid.
- For each message, open the file it names at the line and column it gives. Look up the code to know what it means.
- Unzip the EPUB, or open it in an EPUB editor, and correct the file.
- Rebuild the archive with the mimetype file first and uncompressed, then validate again.
The most common codes
- RSC-005: a file breaks the schema, for example an attribute not allowed where it is or a missing dcterms:modified date.
- RSC-007 and RSC-008: a referenced file is missing, or present but not in the manifest.
- RSC-012: a link points to an #id that does not exist, often after footnotes were moved.
- OPF-014 and PKG-006: a missing manifest property, or a mimetype file that is not first in the ZIP.
When the EPUB came from a converter
If a converter produced hundreds of errors, fixing them by hand is rarely worth it: convert again with a tool that writes valid EPUB 3. EpubCC writes EPUB 3, and every EPUB in our public benchmark was validated with EPUBCheck.
Convert a PDF to a clean EPUB 3
Convert up to 5 pages free, no account needed.