iWrity Logo
iWrity.comAmazon Book Reviews

Writing Craft Guide

How to Create and Validate an EPUB File

EPUB is the universal ebook format accepted by every major retailer except Amazon. Get it right and your book works on Kobo, Apple Books, B&N Press, and everywhere else with a single file. Get it wrong and you face rejections, broken layouts, and missing metadata. Here is everything you need to know.

EPUB 3

Current industry standard

Current standard

Accepted by all major non-Amazon retailers

Valid EPUB

Accepted by all major retailers

Everything you need to create and validate your EPUB

EPUB 2 vs. EPUB 3: which standard to use

EPUB 3 is the current standard and what all major retailers expect for new submissions. EPUB 2 is legacy and still technically accepted, but it lacks support for modern accessibility features and richer media. For prose fiction and non-fiction there is no functional difference in how the book reads, but EPUB 3 is the future-proof choice. If your formatting tool defaults to EPUB 2, check whether it has an EPUB 3 export option before submitting to retailers.

What is inside an EPUB file

An EPUB is a ZIP archive with a .epub extension. Inside: an OPF manifest file listing every resource, one or more XHTML content files (your chapters), a CSS stylesheet, a navigation file (nav.xhtml for EPUB 3, ncx for EPUB 2), your cover image, and any embedded fonts. The container.xml file points the reading system to the OPF. Understanding this structure means you can open any EPUB in a text editor, diagnose errors yourself, and make targeted fixes without re-running your formatting tool from scratch.

Using Calibre for conversion and editing

Calibre is a free, open-source ebook management tool that converts between formats and includes a built-in EPUB editor. Use it to convert a DOCX to EPUB, apply metadata, and inspect or edit the internal HTML and CSS. The Calibre EPUB editor lets you fix formatting issues at the file level without coding knowledge. It is not a substitute for a dedicated formatting tool like Vellum, but for authors without access to Mac-only software it is the most powerful free alternative available.

Running EPUBCheck and reading the results

EPUBCheck is the official EPUB validator. Run it on your file before submitting to any retailer. The output lists errors (critical, will cause rejection) and warnings (non-critical, worth investigating). Most errors fall into a small set of categories: missing manifest entries, broken links, invalid HTML, and missing required OPF metadata. Fix critical errors first. Warnings about deprecated features can usually be ignored for standard prose books unless you are targeting accessibility compliance.

Metadata inside the OPF file

The OPF file controls how retailers display your book. Required fields are title, author, language, and identifier (ISBN or UUID). Set the language code correctly: en-US for American English, en-GB for British, nl for Dutch. The cover image must be declared with a specific properties attribute to be recognised as the cover by reading systems. Missing or wrong metadata is the second most common cause of retailer rejection after invalid HTML. Most formatting tools set OPF metadata for you, but always verify the output file.

Distributing to Kobo, Apple Books, and B&N Press

A valid EPUB 3 file is accepted by all major non-Amazon retailers. Kobo Writing Life, Apple Books for Authors, and B&N Press each have their own upload portals. Kobo processes files within a few hours. Apple Books requires an Apple ID and an iTunes Producer account for authors distributing more than a handful of titles. B&N Press is straightforward. Alternatively, Draft2Digital or Smashwords act as aggregators and distribute to all three from a single file upload, saving you from managing separate accounts.

Write your book with iWrity

iWrity helps you write books that are ready to publish on every platform. Start writing today and worry about formatting after you finish the draft.

Start for free

Frequently Asked Questions

What is the difference between EPUB 2 and EPUB 3?

EPUB 2 is the older standard and is still supported by most readers, but EPUB 3 is the current industry standard and adds support for audio, video, enhanced interactivity, and better accessibility features. For standard prose fiction and non-fiction, both work fine, but EPUB 3 is what major retailers now expect. Kobo, Apple Books, and B&N Press all accept EPUB 3. If you are creating a new file, always target EPUB 3.

How do I validate an EPUB file?

EPUBCheck is the official open-source validator maintained by the W3C EPUB Working Group. You can run it as a command-line Java tool or use an online version at the DAISY Consortium website. Upload or point EPUBCheck at your EPUB file and it will list every error and warning with the file and line number causing the problem. Major retailers including Apple Books and Kobo run EPUBCheck automatically on submission and reject files with critical errors.

What are the most common EPUB errors and how do I fix them?

The most common EPUB errors are: missing or malformed OPF manifest entries (every file inside the EPUB must be listed in the manifest), broken internal links (an anchor reference pointing to an ID that does not exist), invalid HTML (unclosed tags, deprecated elements), missing required metadata in the OPF file (language, title, identifier), and cover image not declared as a cover in the manifest. Calibre's EPUB editor can fix most of these without touching raw files.

Can I distribute the same EPUB file to all non-Amazon retailers?

Yes, a valid EPUB 3 file is accepted by Kobo, Apple Books, B&N Press, Smashwords, and Draft2Digital. Each retailer may apply minor rendering differences, but the source file is the same. Amazon is the exception: KDP does not accept EPUB directly and requires either DOCX or MOBI input, though their internal conversion pipeline creates a Kindle-optimized version from your file.

What metadata belongs in the OPF file?

The OPF (Open Packaging Format) file is the spine of your EPUB. Required metadata includes: dc:title, dc:creator (author name), dc:identifier (usually your ISBN or a unique UUID), dc:language (BCP 47 language code, e.g. en-US), and dc:rights. Recommended fields include dc:publisher, dc:date, and the cover image declaration. Well-formed metadata means retailers display your book correctly and search systems index it accurately.