Free EPUB test files and sample generator

The open eBook standard (a ZIP of XHTML + metadata). Generate valid .epub sample files to test readers, converters, uploaders and catalog imports.

Generate a .epub file →

What is a .epub file?

EPUB: Electronic Publication. EPUB is the open ebook standard: a ZIP package of XHTML content with a manifest and spine describing reading order. Every major reader except Kindle uses it natively.

Why generate a test EPUB file?

What you can put inside a .epub file

You get 3 content options for EPUB, so the file holds something meaningful rather than random padding: Paragraph text, Article (headings + paragraphs), Numeric / figures. For EPUB these are alternatives, so choose the one that matches what you need to test.

How a .epub file is identified

Every .epub file begins with 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. That is what a validator inspecting content rather than the file name looks for.

How the size lands on the exact byte

EPUB is a ZIP of XHTML, so the padding is trailing whitespace inside a content document, legal XML, invisible in a reader.

Negative testing with broken EPUB files

Which failure to reach for, and what to assert for each, is covered in how to make a corrupted file for testing. For upload limits and type checks see testing file upload validation.

Sample EPUB content

[EPUB], container.xml + content.opf + chapter1.xhtml (a ZIP package).

This shows the shape of the file. Your download is generated fresh at the size you choose, so the values will differ.

How to open and verify the file

Open in Calibre, Apple Books or a browser EPUB reader; validate with `epubcheck`.

Media type application/epub+zip · extension .epub · category eBooks

Generate a .epub file → · questions about sizes, privacy or cost are answered on the site FAQ.

Frequently asked questions about EPUB files

What identifies a .epub file?

A .epub file begins with the bytes 50 4B 03 04, the ASCII letters "PK", the initials of Phil Katz, who created the ZIP format. Those bytes are what a content-sniffing validator looks for, and what the Corrupted condition destroys.

How can a .epub file be an exact number of bytes?

EPUB is a ZIP of XHTML, so the padding is trailing whitespace inside a content document, legal XML, invisible in a reader.

What can go inside the EPUB file?

There are 3 content options for .epub: Paragraph text, Article (headings + paragraphs), Numeric / figures. For EPUB these are alternatives, so pick the one matching what you need to test.

Can I download several broken EPUB files at once?

Yes, select more than one File Condition and you get one ZIP containing a .epub per condition, each named after its condition.

Can the EPUB file use UTF-16 or a byte-order mark?

No, and deliberately. A .epub file is a container rather than plain text, so rewriting its bytes as UTF-16 would not produce a UTF-16 document. It would produce a broken file. Use a text format such as CSV, JSON or XML for encoding tests.

How do I open or verify the EPUB file?

Open in Calibre, Apple Books or a browser EPUB reader; validate with epubcheck.

Browse all file formats →