How to Validate Epubs to Ensure They Are CORRECT

Video thumbnail

If you already know how to generate your own custom epubs, the next step is to verify them so that the generated files do not have errors. For that, I used the following tool: EpubCheck, from the W3C organization, which handles all standards related to EPUBs:

https://www.w3.org/publishing/epubcheck/

Validating EPUBs is not an optional procedure or a technical whim: it is what marks the difference between an ebook that “seems to work” and one that truly complies with standards and will be accepted without problems by platforms like Google Play Books or Apple Books.

In this guide, I explain how to validate EPUBs professionally, which tools to use, and which errors are the most common, based on both official standards and real problems I encountered by not validating in time.

What it means to validate an EPUB and why it is mandatory

Validating an EPUB means checking that the file complies with the technical standards of the format, not just that it looks “good” in a specific reader.

Opening EPUB vs Valid EPUB

One of the biggest mistakes is confusing these two concepts. An EPUB can:

  • Open without problems in Calibre
  • Look correctly in a specific reader

…and still be invalid.

In my case, I discovered this when I tried to upload a book to Google Play Books. The EPUB opened perfectly, but the platform returned errors and suggested contacting support. The problem was not the content, but the internal structure of the file.

Platforms that require validation

If you publish on:

  • Google Play Books
  • Apple Books
  • Professional ebook stores

Validation is non-negotiable. These platforms analyze the EPUB internally and reject files with errors, even if they look correct visually.

Why is it important to validate?

I really didn't know that this part of EPUB generation was so important. It turns out that, in addition to making sure your book looks good in applications like Calibre, it also has to be structurally valid, especially if you are going to upload it to platforms like Google Play Books or Apple Books.

In my case, I had problems with the EPUB when uploading it to Google Play; it threw errors and suggested contacting support. I discovered all this precisely because I was not correctly validating the EPUB files.

A professional tool: EpubCheck (W3C)

That's why I decided to use EpubCheck, a very reliable tool that validates if the file complies with the standards. Even if an EPUB opens in Calibre, it doesn't mean it's valid. Some errors can prevent it from working correctly on other platforms, or even prevent the upload from being accepted.

Furthermore, as a professional, it is important to do things right from the start. This tool has helped me a lot to verify that everything is correct. Even if you are using automatic tools to generate EPUBs, I recommend passing this validation to have a “double check”.

The important thing here is to understand something key:

Just because an EPUB editor has a “validator” doesn't mean it's enough.

I use EpubCheck even when the file has already passed through automatic editors. It is my double check before publishing.

Online validators: when to use them and when not to

There are online validators that run on EpubCheck and can be useful for quick tests. The problem is that:

  • You have size limits
  • You are uploading personal files
  • They don't always show the full detail of the errors

If you work with your own or professional books, validating locally is the best option.

How to install and use EpubCheck?

EpubCheck is a tool made in Java. Therefore, you need to have OpenJDK or Java installed, or you can directly use the one that comes with Android Studio (which was my case).

I haven't developed in Java for a long time, so I didn't have Java installed natively. Since Android Studio already has it integrated, I simply used that one.

On Mac, the system already had OpenJDK pre-installed. On Windows, I simply accessed the folder where the Android Studio Java is located and executed it from there.

Requirements: Java, OpenJDK, or Android Studio

In my case, I didn't have Java installed because I hadn't developed in Java for years. The solution was simple: Android Studio already includes Java, so I used 그 executable directly.

  • On macOS, OpenJDK usually comes pre-installed
  • On Windows, you can use the Java that comes with Android Studio

You don't need to install anything additional if you already have it.

Basic execution on Windows and macOS

Once EpubCheck is downloaded from its official site:

  1. Unzip the ZIP
  2. Locate the epubcheck.jar file
  3. Run the command from the terminal

Steps to use EpubCheck

Download the EpubCheck package from the official site I shared at the beginning of the post.

  • Unzip the ZIP file; it will generate a folder with several files.
  • Look for the file named epubcheck.jar.
  • Use a terminal or command line to run the tool. The basic command would be:
$ java -jar epubcheck.jar path/to/the/file.epub

In my case, I had to indicate the full path of the Android Studio Java executable, since I didn't have Java as such installed on the system.

When you run the command, if the program takes a little while, it's a good sign: it means it's processing the file. If everything is correct, you won't see errors. If it finishes too quickly, there might be a problem with the path or it might not be finding the file.

In a correct file, the program simply indicates that there are no errors. On the other hand, when there are errors, it shows them clearly.

How to know if the validation was successful

Here is an important detail I learned from practice:

  • If it takes a while → it is processing the EPUB
  • If it finishes too fast → there is usually a problem with the path

When the EPUB is correct, EpubCheck shows no errors.

If there are problems, it details them with surgical precision.

Common errors when validating EPUBs

I also found errors due to misplaced tags, such as <div> in positions that are not allowed. This usually happens when:

  • Exporting from Google Docs
  • Using Sigil or InDesign without cleaning the code

EpubCheck indicates the exact file and line, which makes the correction direct and fast.

For example, one of my books had errors because I customized a font but hadn't physically included it in the EPUB, even though I referenced it in the CSS. EpubCheck indicated it clearly and allowed me to fix it quickly:

found in the EPUB. ERROR(RSC-007): ERROR(RSC-007): I:/descargas/librosacademia/laravel/es/laravel.epub/OEBPS/chapter22.xhtml(42,13): El recurso referenciado "OEBPS/fonts/SUSE-ExtraBold.ttf" no se ha encontrado en el EPUB.
ERROR(RSC-007): I:/descargas/librosacademia/laravel/es/laravel.epub/OEBPS/chapter22.xhtml(47,13): El recurso referenciado "OEBPS/fonts/SUSE-Regular.ttf" no se ha encontrado en el EPUB.
ERROR(RSC-007): I:/descargas/librosacademia/laravel/es/laravel.epub/OEBPS/chapter22.xhtml(52,13): El recurso referenciado "OEBPS/fonts/SUSE-SemiBold.ttf" no se ha encontrado en el EPUB.

Prueba finalizada con errores
Mensajes: 0 errores fatales / 405 errores / 0 advertencias / 0 indicaciones

EPUBCheck completado

C:\Users\andre>
C:\Users\andre>
C:\Users\andre>
C:\Users\andre>
C:\Users\andre>"C:\Program Files\Android\Android Studio\jbr\bin\java.exe" -jar "I:\descargas\epubcheck-5.2.1\epubcheck.jar" "I:\descargas\librosacademia\mac\alpine\es\Primeros pasos con Alpine.js, tu nuevo y ligero framework JavaScript.epub"
Validación usando la versión de reglas epub 2.0.1.

I have also had files with errors like misplaced <div> tags or files not found inside the EPUB. Sometimes, this is caused by editors like Sigil, or even when you export from Google Docs and some reference is lost. EpubCheck shows you exactly which file has the problem and on which line it occurs:

ERROR(RSC-005): I:/descargas/librosacademia/mac/alpine/es/Primeros pasos con Alpine.js, tu nuevo y ligero framework JavaScript.epub/OEBPS/chapter3.xhtml(670,2115): Error al analizar el archivo: el elemento "div" no se permite aquí; se esperaba el elemento final de etiqueta, texto o elemento "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" o "var" (con xmlns:ns="http://www.w3.org/2000/svg")
ERROR(RSC-005): I:/descargas/librosacademia/mac/alpine/es/Primeros pasos con Alpine.js, tu nuevo y ligero framework JavaScript.epub/OEBPS/chapter5.xhtml(603,227): Error al analizar el archivo: el elemento "div" no se permite aquí; se esperaba el elemento final de etiqueta, texto o elemento "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" o "var" (con xmlns:ns="http://www.w3.org/2000/svg")
ERROR(RSC-005): I:/descargas/librosacademia/mac/alpine/es/Primeros pasos con Alpine.js, tu nuevo y ligero framework JavaScript.epub/OEBPS/chapter5.xhtml(603,1057): Error al analizar el archivo: el elemento "div" no se permite aquí; se esperaba el elemento final de etiqueta, texto o elemento "a", "abbr", "acronym", "applet", "b", "bdo", "big", "br", "cite", "code", "del", "dfn", "em", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "tt" o "var" (con xmlns:ns="http://www.w3.org/2000/svg")

You can also use Android Studio, which has a version of Java installed; here are some commands you can run:

--- PC
"C:\Program Files\Android\Android Studio\jbr\bin\java.exe" -jar "I:\descargas\epubcheck-5.2.1\epubcheck.jar" "I:\descargas\librosacademia\laravel\es\laravel.epub"

--- MacOS
java -jar "/Volumes/My Passport/archivos/descargas/libros ready/epubcheck-5.2.1/epubcheck.jar" "/Volumes/My Passport/archivos/descargas/libros ready/flask/es/Primeros pasos con Flask 3.epub"

How to fix the errors shown by EpubCheck

There is no magic here: you have to read the message and act.

Interpreting error messages

EpubCheck indicates:

  • Type of error
  • Affected file
  • Exact line

This is infinitely better than “something is wrong”.

Real examples and practical solutions

In my experience, the most frequent errors are solved by:

  • Including forgotten resources
  • Correcting paths
  • Cleaning up improperly closed HTML tags

Once you correct and run EpubCheck again, the file is usually clean quickly.

Validating EPUBs without installing anything

If you just want a quick check, there are web validators based on EpubCheck. They work, but I see them more as:

  • One-off test
  • Small EPUBs
  • Non-sensitive cases

For professional work, I still recommend local validation.

Final recommendations before publishing your EPUB

After several validated books (and some errors learned the hard way), my advice is clear:

  • Always validate, even if the EPUB “looks good”
  • Use official EpubCheck, not just integrated validators
  • Correct errors before uploading to platforms
  • Treat validation as part of the professional workflow

Validating EPUBs is preventing problems, rejections, and unnecessary headaches.

Conclusion

Validating EPUBs is not an optional step or a technical one only for experts. It is an essential practice if you want to publish ebooks professionally.

With EpubCheck, Java, and a few minutes of review, you can ensure that your book meets the standards, will be accepted by platforms, and will work correctly on any device.

Extra: Generate a Microsoft Word from an Epub (And other formats)

Generate a Microsoft Word from an Epub (And other formats)
Video thumbnail

Here I am going to show you something that I think almost no one says: how you can generate a Word from an Epub. So, well, as I said, I asked artificial intelligence a bit and it told me that with Word, which is the simplest program I have here, so to speak, because the other one is Adobe Acrobat, which is more complicated, so I'm not going that way; I tried opening a PDF with Word but I wasn't successful either.

There are web applications that I don't like very much because it is my personal book. So, I don't want to upload it to these applications, and it's worth knowing that, so to speak, when you upload a document, what happens there? They take ownership of your document, is what I'm getting at. Because you don't know what their conditions are, they can change them, they can place them; you know that everyone is very tricky.

The Solution: Calibre to the Rescue

So, well, in that case, what do I say? Use a little logic here. Luckily, I already knew an application that works quite well for reading, writing and everything else, which is this one called Calibre. So, notice that here, in this case, it's not a PDF, but directly an Epub.

From Calibre, you have the option to convert and you have many formats, among them, Word.

Conclusion

In summary:

  • Download EpubCheck, it is a free, professional, and reliable tool.
  • Install Java or use the one from Android Studio if you already have it.
  • Run the validation with the command java -jar epubcheck.jar followed by the file path.
  • Fix any errors that are shown. It is better to prevent than to upload a book with problems.

Discover how to validate EPUBs with EpubCheck step by step. Avoid errors and rejections on Google Play and publish 100% valid ebooks.

I agree to receive announcements of interest about this Blog.

Andrés Cruz

ES En español