Electronic Publication (.epub)
W3C StandardElectronic Publication (EPUB) is an openly specified ebook format maintained by the W3C, designed to package reflowable or fixed-layout publications for compatible reading systems.
Convert MOBI to EPUB
Free in-browser MOBI to EPUB converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify EPUB files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify EPUB files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
50 4B 03 04 ... 6D 69 6D 65 74 79 70 65ASCII REPRESENTATION: PK..mimetypeapplication/epub+zip
Standardization: W3C EPUB 3.3 Recommendation
Technical Specifications
| Container Architecture | ZIP archive containing uncompressed 'mimetype' file, META-INF/container.xml, and OEBPS content package |
| Compression | Deflate (zlib) compression on internal content files; 'mimetype' file strictly uncompressed (Store mode) |
| Byte Endianness | Little-Endian (ZIP container) |
| Color Spaces | sRGB, Display P3, CSS Color Module Level 4 |
| Channels & Structure | Reflowable or fixed-layout XHTML pages, CSS stylesheets, embedded SVG/raster images, audio, and video |
| Max Dimensions | Unbounded pagination (reflows dynamically to any display size from watch to 8K TV) |
| Transparency | Full CSS alpha transparency, opacity masks, and transparent PNG/SVG graphics |
| Streaming & Progressive | Table of Contents (toc.ncx / nav.xhtml) enables instant chapter seeking |
Technical Comparison Matrix: EPUB vs Competitors
| Technical Attribute | EPUB (Current) | AZW3 | MOBI | |
|---|---|---|---|---|
| Reflowable Text | Reflowable text; layout depends on the reading system | Fixed page layout (requires zooming) | Reflowable on Kindle only | Primitive reflow |
| Standardization | W3C Official Open Recommendation | ISO 32000 Open Standard | Proprietary Amazon standard | Obsolete proprietary standard |
| Hardware Compatibility | Support varies by device and reading app. | Supported by many reading systems; availability varies | Amazon Kindle devices only | Vintage Kindle & PDA only |
| Container Architecture | ZIP archive with XHTML/CSS/JS | Binary object hierarchy | PalmDOC database | PalmDOC database |
Common Corruption Modes & Hex Recovery Guide
E-reader error: 'The package could not be opened: invalid mimetype'.
Root Cause: Compressor compressed the 'mimetype' file or placed it at an offset other than byte 30.
Recovery: Re-package using File2File.app Ebook Repair to enforce uncompressed mimetype placement.
Security Analysis & Parser Attack Vectors
EPUB content documents use XHTML and may include scripting, but EPUB reading systems are not required to support scripts. Security controls depend on the reading system and its configuration.
Known Attack Vectors
- Cross-site scripting (XSS) in EPUB JavaScript reading systems to steal user library data.
- XML External Entity (XXE) injection in EPUB XML manifest parsers.
- Zip bomb decompression attacks consuming server storage during catalog ingest.
Defensive Best Practices: Disable script execution and external network fetching when parsing untrusted EPUBs.
Historical Origins & Milestones
Key Advantages & Pros
- An open standard maintained by the W3C and used for digital publications.
- Flawless reflowable typography: text automatically adapts font size, margins, and line spacing to any display.
- World-class accessibility support: screen readers, audio narration synchronization (Media Overlays), and dyslexia fonts.
Technical Limitations & Cons
- Fixed-layout complex designs (like technical textbooks and magazines) can be difficult to render reliably across different screen ratios.
- Strict ZIP packaging rules: if the uncompressed 'mimetype' file is not the very first file at byte offset 30, the EPUB is invalid.
- Kindle devices require conversion (via Send-to-Kindle or caliber) rather than native USB drag-and-drop.
Interesting Technical Trivia
- The 'mimetype' file inside an EPUB must be the first file in the ZIP archive, must be completely uncompressed (0% compression), and must contain exactly 'application/epub+zip' with no trailing spaces.
- Project Gutenberg offers more than 70,000 free ebooks in multiple formats; EPUB availability varies by title.
- In 2017, the International Digital Publishing Forum (IDPF) merged directly into the World Wide Web Consortium (W3C).
Frequently Asked Technical Questions
Why is EPUB better than PDF for reading books?
EPUB is reflowable, meaning the text automatically adjusts to fit your phone or e-reader screen at any font size, whereas PDF has fixed page dimensions that require constant pinching and zooming.
Can I read EPUB files on an iPhone or Mac?
Apple Books can open EPUB books on supported Apple devices, though availability and setup can vary by device and software version.
How can I convert EPUB to PDF or MOBI?
You can convert EPUB books into beautifully formatted PDF documents or Kindle-friendly formats using File2File.app directly in your browser.
Related EPUB Conversion Pairs
Converting legacy Mobipocket eBook files to modern EPUB format ensures your digital library works on contemporary e-readers and mobile applications.
Converting EPUB files to Mobipocket eBook format transforms modern zipped HTML documents into single binary PalmDOC files for legacy e-readers.
Convert a FictionBook 2.0 book into an EPUB package with reflowable content for compatible e-readers and reading apps.
Convert EPUB e-books into FictionBook 2.0 XML files for compatible readers and archival workflows.