Electronic Publication (.epub)

W3C Standard

Electronic 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:

Select or drop files here

Private - files never leave your device

or paste Ctrl+V
Zero-Network-Transmission Privacy Guarantee: 0 bytes uploaded to external servers. All processing occurred locally in your browser sandbox.

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 65

ASCII REPRESENTATION: PK..mimetypeapplication/epub+zip

Standardization: W3C EPUB 3.3 Recommendation

Technical Specifications

Container ArchitectureZIP archive containing uncompressed 'mimetype' file, META-INF/container.xml, and OEBPS content package
CompressionDeflate (zlib) compression on internal content files; 'mimetype' file strictly uncompressed (Store mode)
Byte EndiannessLittle-Endian (ZIP container)
Color SpacessRGB, Display P3, CSS Color Module Level 4
Channels & StructureReflowable or fixed-layout XHTML pages, CSS stylesheets, embedded SVG/raster images, audio, and video
Max DimensionsUnbounded pagination (reflows dynamically to any display size from watch to 8K TV)
TransparencyFull CSS alpha transparency, opacity masks, and transparent PNG/SVG graphics
Streaming & ProgressiveTable of Contents (toc.ncx / nav.xhtml) enables instant chapter seeking

Technical Comparison Matrix: EPUB vs Competitors

Technical AttributeEPUB (Current)PDFAZW3MOBI
Reflowable TextReflowable text; layout depends on the reading systemFixed page layout (requires zooming)Reflowable on Kindle onlyPrimitive reflow
StandardizationW3C Official Open RecommendationISO 32000 Open StandardProprietary Amazon standardObsolete proprietary standard
Hardware CompatibilitySupport varies by device and reading app.Supported by many reading systems; availability variesAmazon Kindle devices onlyVintage Kindle & PDA only
Container ArchitectureZIP archive with XHTML/CSS/JSBinary object hierarchyPalmDOC databasePalmDOC 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

2023W3C officially publishes EPUB 3.3 as an endorsed Web Standard Recommendation.
2011IDPF releases EPUB 3, introducing HTML5, CSS3, MathML, audio, and video media overlays.
2007EPUB 2.0 succeeds the Open eBook Publication Structure (OEBPS) as the official industry standard.

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.