Book Design & Formatting
How to Validate an EPUB File with EPUBCheck
By the Inkora team · Nov 29, 2026 · 6 min read
An EPUB that looks fine in one reading app can still be broken underneath: a missing image, a link to a chapter that is not there, a typo in the package file. Stores and distributors catch these problems when you upload, and some reject the file outright. Validating it first means you find out on your own computer instead of in a rejection email. The standard tool for this is EPUBCheck. This guide explains what it checks, how to run it, what its messages mean and how stores use it. If you are not sure what is inside an EPUB, the glossary entry on EPUB is a quick primer.
What EPUBCheck is
EPUBCheck is the official conformance checker for EPUB publications. It is free and open source, developed under the W3C (the body that maintains the EPUB standard) with the DAISY Consortium, and the 5.x releases check files against EPUB 3.3, the current version of the specification. It also checks older EPUB 2 files.
It is a Java program that runs from the command line. That sounds technical, but you only need one command. There are also third-party apps that put a simple window around it, and many formatting tools run it for you behind the scenes.
What it checks
- The container. An EPUB is a ZIP file with a fixed structure. EPUBCheck checks the required "mimetype" file is present, first in the archive and correct.
- The package document (OPF). Metadata such as title, language and identifier, the manifest of every file, and the reading order (spine).
- Content documents. Each XHTML chapter is checked against the rules for valid markup, and CSS is checked for problems.
- Navigation. The table of contents document (and the older NCX file, if present).
- References. Every link, image and stylesheet that is referenced must exist in the package, and every file in the package should be declared.
What it does not check
It does not tell you whether the book looks good, whether chapters start in the right place, or whether there are typos. A file can pass EPUBCheck and still read badly. It also does not give a full accessibility report; the DAISY Consortium's Ace tool does that.
Step 1: Get EPUBCheck
- Check that Java is installed: open a terminal (Command Prompt or PowerShell on Windows, Terminal on Mac) and type
java -version. If nothing is found, install a current Java runtime first. The EPUBCheck installation page lists the minimum version. - Download the latest release ZIP from the EPUBCheck releases page on GitHub, linked from the W3C EPUBCheck site.
- Unzip it to a folder you can find again. Keep
epubcheck.jarand thelibfolder together; the program needs both. - On a Mac with Homebrew, or on Ubuntu or Debian, community-maintained packages give you an
epubcheckcommand directly (for examplebrew install epubcheck). These are not maintained by the project itself.
Step 2: Run it on your file
- In the terminal, change to the EPUBCheck folder, or use the full path to the JAR file.
- Run:
java -jar epubcheck.jar /path/to/mybook.epub
- To check an unpacked EPUB folder (useful while you are fixing files by hand), add the expanded mode option:
java -jar epubcheck.jar -mode exp /path/to/mybook-folder/
- Run
java -jar epubcheck.jar --helpto see other options, including ones that save a report to a file.
Tip: drag the EPUB file into the terminal window after typing the command and a space, and most systems paste in its full path for you.
Step 3: Read the output
A clean file ends with the message "No errors or warnings detected." Otherwise, each problem is printed on its own line in this form:
ERROR(RSC-007): mybook.epub/OEBPS/chapter03.xhtml(41,23): Referenced resource "images/map.jpg" could not be found in the EPUB.
Read it left to right:
- Severity (ERROR).
- Message code (RSC-007), which you can look up in the EPUBCheck messages reference.
- File and position: the file inside the EPUB, then the line and column. A line and column of -1 means the problem has no specific location.
- Description in plain language.
At the end there is a summary count of fatal errors, errors, warnings and information messages.
What the severities mean
| Severity | Meaning | Must you fix it? |
|---|---|---|
| Fatal | EPUBCheck could not process the file at all | Yes |
| Error | Breaks a requirement of the EPUB standard | Yes, stores may reject the file |
| Warning | Goes against a recommended practice | Usually worth fixing |
| Usage / Info | Minor notes about the content | Optional |
Common messages and what they mean
| Code | What it says | Usual cause | Fix |
|---|---|---|---|
| PKG-006 | mimetype file missing or not first in the archive | The EPUB was re-zipped with an ordinary ZIP tool | Rebuild it with an EPUB editor or the tool that created it |
| PKG-007 | mimetype contents wrong | Same as above, or the file was edited | Regenerate the EPUB |
| PKG-010 | File name contains spaces (warning) | Image or chapter named "Chapter 1.xhtml" | Rename files without spaces and update links |
| RSC-005 | Error while parsing a file | Invalid markup: unclosed tags, wrong attributes | Go to the line shown and correct the markup |
| RSC-007 | Referenced resource could not be found | An image, font or stylesheet is linked but missing | Add the file or remove the reference |
| RSC-012 | Fragment identifier is not defined | A link points to an anchor (#id) that does not exist | Fix the link or add the id |
| OPF-085 | Identifier marked as a UUID is not a valid UUID (warning) | Hand-typed identifier | Generate a proper UUID or use the ISBN |
| OPF-096 | Non-linear content cannot be reached | A file outside the reading order has no link to it | Link to it or add it to the spine |
| HTM-004 | Irregular DOCTYPE | Old or unusual HTML header | Use the standard XHTML header for your EPUB version |
| NCX-001 | NCX identifier does not match the OPF identifier | Identifier changed in one file only | Make them match |
A single mistake can produce dozens of messages. Fix the first few, run the check again, and the list often shrinks quickly.
Step 4: Fix the errors
Where you fix a problem depends on how the EPUB was made.
- If a tool generated the file (Word plus a converter, Atticus, Calibre, Kindle Create, Inkora and so on), fix the cause in your source and export again. Editing the EPUB directly means the fix is lost next time you export.
- If you are fixing it by hand, use an EPUB editor rather than unzipping and rezipping it yourself. Sigil and Calibre's Edit book both repackage the file correctly, which avoids PKG-006. Sigil also has an EPUBCheck plugin. See the Sigil and Calibre tool pages.
- Run EPUBCheck again after every round of fixes, until it reports no errors.
- Then open the book in two or three reading apps and on a phone, because validity and appearance are separate questions.
How stores use validation
Each store sets its own rules, and these change, so check the current file requirements for every store you upload to.
- IngramSpark states that it runs EPUBCheck when it validates uploaded EPUB files. Its help centre also warns that a file can pass EPUBCheck and still be rejected for IngramSpark's own requirements or by a retailer such as Apple, for example over very large cover images.
- Apple Books, Kobo, Google Play Books and aggregators such as Draft2Digital all check uploaded files to some degree. A clean EPUBCheck report removes one of the most likely causes of a failed or delayed upload.
- Amazon KDP accepts EPUB uploads and converts them into its own format. Problems there tend to appear as conversion failures or odd formatting in the previewer, and a valid EPUB makes those far less likely.
Our store guides summarise each store's file requirements and link to the official pages.
When a different tool is easier
If you are not comfortable with a terminal, a graphical EPUBCheck app or an editor with an EPUBCheck plugin does the same job. Better still, use a formatter that produces valid files from the start and checks them for you; the formatting tools category compares the options. Inkora exports EPUB 3 directly from your manuscript; it is still worth running the file through EPUBCheck yourself before you upload, as with any tool.
Frequently asked questions
What is EPUBCheck?+
EPUBCheck is the official, free validator for EPUB files, developed under the W3C with the DAISY Consortium. It checks a file against the EPUB specification and lists errors and warnings.
Do I need to fix EPUBCheck warnings?+
Errors should always be fixed, as stores may reject the file. Warnings point to recommended practices; fix them where you can, as some reading systems handle them badly.
Can I validate an EPUB without the command line?+
Yes. Several third-party apps put a simple window around EPUBCheck, and editors such as Sigil can run it as a plugin.
If my EPUB passes EPUBCheck, will every store accept it?+
Not necessarily. Stores have extra requirements such as cover size and metadata rules. Passing EPUBCheck removes one common cause of rejection.
Why do I get a mimetype error after editing my EPUB?+
Re-zipping an EPUB with an ordinary ZIP tool usually puts the mimetype file in the wrong place or compresses it. Use an EPUB editor or regenerate the file from your formatting tool.
Turn your idea into a finished book
Inkora plans, writes and formats your book, designs the cover and exports print-ready PDF, EPUB and DOCX for every store.
Start writing free