Digital publishing
How to Validate an EPUB File
“The entity &xyz; was referenced, but not declared.” IngramSpark lists that sentence in its guide to common EPUB errors, with the explanation: “You need to change the referenced named entity to a numeric one.”1 For an author who has never opened the code inside an ebook, a message like this is the first sign that an EPUB is a structured document governed by rules, and that a file which displays correctly in one reading application can still be rejected by a distributor.
To validate an EPUB file is to test it against those rules before a retailer does. This article explains what the official validator checks and what it ignores, how to run it, how to read its results by severity, how retailer checks differ from the validator, and why structural validation and accessibility testing are separate steps. Tool versions and retailer practices are reported as they stood in November 2026.
EPUBCheck is the official conformance checker for the EPUB standard
The reference tool is EPUBCheck. The W3C, which maintains the EPUB standard, describes it as “the official conformance checker for EPUB publications” and states that “EPUBCheck is a project owned by W3C.”2 It is distributed both as a command-line program and as a Java library that other software can build in.3
According to the project’s own description, EPUBCheck examines four things: “the structure of the container,” “the package description file and associated metadata,” “the content markup,” and “the consistency of internal references.”4 In practical terms, it confirms that the ZIP container is assembled correctly, that the package document contains its required metadata and lists every file, that each content document is valid XHTML or SVG, and that links, images, and stylesheets point to files that exist and are declared.
The W3C is equally direct about EPUBCheck’s limits. The project page states that “It will not detect typos, mispellings, off-topic images, etc.,” and that EPUBCheck cannot play an editorial role.5 The DAISY Consortium’s Accessible Publishing Knowledge Base adds that EPUBCheck has limited accessibility and CSS checks, and that “manual checking of EPUBs for usability in reading systems is always recommended.”6 A file can pass EPUBCheck and still have a broken layout, missing alternative text, or a chapter in the wrong place, provided the chapter is correctly declared.
Distributors run EPUBCheck whether or not the author does
Validation is not optional in practice, because the major distributors run the checker on every file they receive. The W3C states that “Most retailers will not accept an EPUB file unless it successfully passes EPUBCheck scrutiny.”7 As of November 2026, IngramSpark’s help center states that “IngramSpark uses EpubCheck during ePub content validation to validate EPUB files,” and lists the areas checked as “Open Container Format (OCF), Open Package Format (OPF), Open Publication Structure (OPS) mark-up.”8 Rakuten Kobo’s published EPUB specification states that “Kobo strongly recommends that only files that pass EPUBCheck without flags should be distributed,” and says that Kobo runs incoming files through EPUBCheck version 4.2.6.9 Google’s Play Books partner help advises publishers to run the EpubCheck tool to “ensure that there are no errors in the files you generated.”10
Running the validator before upload changes the order of events, not the standard applied. An author who validates first can fix problems in their own editing environment and upload once. An author who does not will discover the same problems one rejection at a time, often through error messages relayed by a distributor’s dashboard, which Google notes appear under the Content tab in its Partner Center.11
The current EPUBCheck version checks EPUB 3.3
EPUBCheck is updated as the standard changes. When the W3C announced EPUB 3.3 as a Recommendation in May 2023, it noted the release of epubcheck 5.0.1, which it described as “fully compatible with EPUB 3.3.”12 As of November 2026, the EPUBCheck releases page lists version 5.3.0, dated 2025-09-01, as the latest production-ready release and states that it checks EPUB 3.3.13 Earlier entries on the same page include 5.2.1 (2025-01-14), 5.2.0 (2024-12-30), and 5.1.0 (2023-07-07).14 The release notes for version 5.0.0-alpha-1 state that “the required Java runtime environment is now Java 8 or greater.”15
The version gap between the current release and the one Kobo reports using is worth noting. A file that passes EPUBCheck 5.3.0 may still receive a different message, or none, from 4.2.6, and the reverse is also possible, because rules have been added, removed, or reclassified between versions. The published sources do not list every difference. A cautious approach is to validate with the current release and, when a retailer reports a problem the current release does not, check the retailer’s documentation for the version it uses.
Running EPUBCheck requires Java and a single command
EPUBCheck is a Java program. DAISY’s knowledge base describes it as “a free command-line validation tool that automatically checks EPUB publications for conformance to the standard,” and explains that it runs from Command Prompt, PowerShell, or Terminal using the java command with a path to the epubcheck.jar file and the publication to be checked.16 The project’s README notes that it “can be run as a standalone command-line tool or used as a Java library.”17
The command-line documentation gives the general form as epubcheck [<options>] [<path>], with a note that users running it through the java command should substitute their own method of invocation.18 Several options are useful to self-publishers:
--mode expchecks a path “as an expanded EPUB directory,” which allows an author to validate an unzipped working folder without repackaging it; the related--saveoption, which works only in that mode, packages the directory into an.epubfile.19--json <file>writes “a JSON report to<file>,” and--xmp <file>writes an XMP report, which are useful for keeping a record of each validation run.20--failonwarningsmakes the program “return1if either warnings or errors are present,” rather than only for errors, which matters when validation is part of an automated build.21--profileselects a checking profile; the documented profiles aredefault,dict,edupub,idx, andpreview.22-f,-e, and-wlimit the report to fatal errors, to errors and fatal errors, or to warnings and above.23
Authors who prefer not to use a terminal have alternatives. DAISY lists Pagina EPUB-Checker as “A freeware graphical interface for running EPUBCheck,” FlightDeck as a web-based commercial validator that also checks vendor-specific content rules, and the Oxygen XML editor as a commercial editor with EPUBCheck built in.24 Many EPUB editing programs also include EPUBCheck internally, although the version they bundle may lag the current release; the version number is worth confirming in each tool’s documentation.
EPUBCheck messages are sorted by severity, and each level means something different
EPUBCheck reports problems at five severity levels, and DAISY’s knowledge base explains each.25
- Fatal. “A fatal error is one that will prevent reading systems from opening a publication.” These must be fixed.
- Error. Deviations from the EPUB standard that usually do not prevent the book from opening but can make content render unexpectedly. These typically need fixing.
- Warning. Deviations from recommended practice. DAISY states that “A publication with warnings is not invalid,” but warns that they may cause interoperability problems and that many vendors reject publications with warnings.
- Usage. Best-practice suggestions that are switched off by default and enabled with the
-uflag; addressing them is optional. - Info. Messages about EPUBCheck itself, such as a file it could not decrypt; these rarely require action.
The relationship between warnings and retailer acceptance deserves attention. Kobo’s wording, “without flags,” suggests that a clean report is the target for that retailer, not merely the absence of errors.26 An author distributing widely should therefore aim to clear warnings as well as errors, using the -w level or --failonwarnings to make sure none are overlooked.
Reading an EPUBCheck report is an exercise in finding the first real error
DAISY offers several practical observations on interpreting EPUBCheck output.27 The codes in parentheses after each message can usually be ignored, since they mainly help developers debug EPUBCheck itself. Reported locations are not always useful; EPUBCheck often reports (-1,-1) when a problem “cannot be traced to a specific location,” and such messages require investigation rather than a direct jump to a line. The total number of messages can also mislead, because one markup error can trigger many others. DAISY recommends revalidating often, so that an author does not chase problems that a single earlier fix has already resolved.28
A workable method follows from these observations. Fix fatal errors first, because nothing else can be tested reliably until the book opens. Then work through errors from the top of the report, revalidating after each change. Many errors in self-published files fall into recognizable groups, and IngramSpark’s guide lists several:29
- “The lang and xml:lang attributes must have the same value,” which occurs when both language attributes appear on an element with different values.
- “Duplicate map name ‘X’,” which means two image-map elements share a name that must be unique.
- “Undeclared prefix: X,” meaning a metadata prefix has been used without being declared on the root element.
- “The reference to entity X must end with the ‘;’ delimiter,” a missing semicolon after a character entity.
IngramSpark also advises making sure there is no blank space in the file name, noting that a space can cause an error with Apple.30 None of these problems is visible when the book is read in a forgiving application, which is why they surface only at upload.
Retailer checks add rules that EPUBCheck does not enforce
Passing EPUBCheck is necessary for distribution but not sufficient. Retailers apply their own limits on top of the standard. IngramSpark’s guide, for example, states that “No single image inside an EPUB can be greater than 3.2 million pixels,” and that “Apple requires the cover image to be less than 4 million pixels.”31 Kobo’s specification recommends limits of “10 MB of embedded content/each HTML file in an ePub” and “1 GB/ePub.”32 EPUBCheck does not test against any of these figures, because they are not part of the standard.
For Amazon, the relevant check is a different tool. As of November 2026, KDP’s help page on file formats states that it supports EPUB files “that meet the specifications outlined in the Kindle Publishing Guidelines” and recommends previewing them in Kindle Previewer before uploading.33 KDP describes Kindle Previewer as a tool that lets authors “Preview by device type, orientation, and font,” and lists the formats it opens as “.epub, .htm, .html, .xhtml, .opf, .kpf, .doc, and .docx.”34 It runs on “Microsoft Windows 10 (64-bit) and above” and on Intel and Apple Silicon Macs running macOS 12 and above.35 Because Amazon converts EPUB files into its own formats, Kindle Previewer shows the converted result rather than the EPUB as such, which is the more useful test for Kindle readers.
Google’s advice reflects the same logic in simpler form: open the file in an ereader program such as Adobe Digital Editions, on the reasoning that if it opens there it will likely process correctly, and run EpubCheck as well.36 Visual inspection in real reading applications catches the problems that a conformance checker is not designed to find.
Accessibility testing is a separate validation step
Structural validity and accessibility are tested by different tools. DAISY states that Ace by DAISY “is not integrated with EPUBCheck,” so publications must be validated with each tool separately.37 DAISY’s EPUBCheck page makes the same point from the other direction, noting that “the Ace and SMART tools also need to be run” in addition to EPUBCheck when accessibility is a goal.38
Ace is described by DAISY as “a free validation tool that checks EPUB publications for accessibility issues,” built on the axe engine with EPUB-specific checks, and it reports violations under WCAG Level A, WCAG Level AA, and the EPUB Accessibility specification.39 Its limits mirror EPUBCheck’s: “Passing Ace validation is not the same as meeting requirements of WCAG,” and “A clean report only means the issues Ace can check for have passed.”40 DAISY also cautions that not every EPUBCheck message is an accessibility problem; WCAG “only requires invalid content be fixed where the errors or warnings” cause accessibility problems.41 For distribution, however, the retailer’s acceptance rules usually require a clean EPUBCheck report regardless.
A validated file is a starting point for testing, not the end of it
The sequence that the sources support is straightforward. Validate with the current EPUBCheck release and clear fatal errors, errors, and warnings. Check the file against each retailer’s published limits, which EPUBCheck does not enforce. Preview the Kindle conversion in Kindle Previewer and open the EPUB in at least one other reading application. Run Ace if the book is intended to be accessible, and review its findings by hand. Revalidate after every change, including changes made to fix a display problem, since a visual fix can introduce a structural error.
The consequence of skipping these steps is rarely dramatic. Usually it is a rejected upload, a delayed release, or a book that opens correctly on the author’s device and incorrectly on a reader’s. Validation shifts the discovery of those problems from the distributor and the reader back to the author, where they are cheapest to fix.
Related articles on selfpublishingtool.com
- Understanding the EPUB File Format
- Inside the EPUB Zip Archive: Unzipping an eBook to Fix Broken Code by Hand
- Why Word’s “Save as Filtered HTML” Creates Bloated, Unvalidatable EPUBs
- Testing eBooks Across Different Reading Devices
- How to Create an Accessible eBook
- How to Prepare an eBook for Kindle Publication
Platform rules, fees and laws change. Facts in this guide are dated to when they were checked; confirm current terms with the platform or authority before relying on them. Nothing here is legal, tax or financial advice.