Electronic Publication
EPUB is a ZIP archive containing XHTML content, CSS, images, and an OPF package document, identified by an uncompressed mimetype file at offset 0 containing exactly application/epub+zip. The W3C maintains the current EPUB 3.3 specification (2023).
EPUB rendering requires a full e-book layout engine with pagination not available in browser WASM.
تبحث عن تحويل؟ جرّب صيغة ذات صلة:
أسئلة شائعة
Can I read EPUB files on a Kindle?
Older Kindle models require conversion to MOBI or AZW3 using Calibre. Kindle firmware released after late 2022 and the Send to Kindle service accept EPUB files directly, converting them to KF8 on ingestion. Kindle Scribe and newer Paperwhite models handle EPUB without manual conversion.
How do I remove DRM from an EPUB I purchased?
DRM removal depends on the DRM system used (Adobe ADEPT, Apple FairPlay, or Readium LCP). Tools exist but their legality varies by jurisdiction. A DRM-free alternative is purchasing from stores that sell unencrypted EPUB files (e.g., Kobo Plus, Smashwords, or publisher direct sales).
Why does my EPUB fail validation in EPUBCheck?
The most common failures are: mimetype entry not first in ZIP or compressed instead of stored, missing META-INF/container.xml, XHTML files with invalid markup (unclosed tags, missing xmlns), and manifest items referencing files not present in the ZIP. Run epubcheck with --info flag for detailed diagnostics.
What is the difference between EPUB 2 and EPUB 3?
EPUB 2 uses XHTML 1.1, DTBook, and NCX for navigation. EPUB 3 upgrades to HTML5, CSS3, SVG, MathML, JavaScript (sandboxed), and replaces NCX with an XHTML Navigation Document. EPUB 3 also adds media overlays (synchronized audio via SMIL) and improved accessibility metadata.
ما يميز .EPUB
What is an EPUB file?
EPUB (Electronic Publication) is the most widely supported open eBook format. Developed by the IDPF (now part of W3C), EPUB files are ZIP archives containing XHTML content, CSS styling, images, and metadata. EPUB 3 supports reflowable and fixed-layout content, audio, video, and interactive elements.
اكتشف التفاصيل التقنية
How to open EPUB files
- Apple Books (macOS, iOS) — Built-in
- Calibre (Windows, macOS, Linux) — Free, feature-rich
- Kobo eReaders — Native EPUB support
- Google Play Books (Android, Web) — Upload and read
Technical specifications
| Property | Value |
|---|---|
| Format | ZIP with XHTML/CSS |
| Current Version | EPUB 3.3 (W3C) |
| Layout | Reflowable or fixed |
| DRM | Adobe DRM, Apple FairPlay |
| Accessibility | Full WCAG support in EPUB 3 |
Common use cases
- eBooks: Commercial and self-published digital books.
- Digital magazines: Rich media periodicals.
- Documentation: Technical manuals and guides.
- Academic publishing: Textbooks and research papers.
المرجع التقني
- نوع MIME
application/epub+zip- Magic Bytes
50 4B 03 04ZIP archive. Contains mimetype file with application/epub+zip.- المطوّر
- International Digital Publishing Forum (IDPF)
- سنة التقديم
- 2007
- معيار مفتوح
- نعم — عرض المواصفات
ZIP archive. Contains mimetype file with application/epub+zip.
البنية الثنائية
EPUB files are ZIP archives with specific structural requirements. The ZIP local file header starts with magic bytes 50 4B 03 04 (PK). The first file entry in the ZIP MUST be named 'mimetype' and MUST contain exactly the ASCII string 'application/epub+zip' (no trailing newline, no extra whitespace). This mimetype entry MUST be stored uncompressed (compression method 0x0000 in the local file header) and MUST have no extra field data in its local file header (extra field length = 0x0000). This allows detection tools to find the string 'application/epub+zip' at a fixed offset (byte 38) in the file without decompressing. After the mimetype entry, the ZIP contains: META-INF/container.xml (points to the root file, typically OEBPS/content.opf or OPS/content.opf), the OPF package document (manifest of all content files, spine reading order, metadata), XHTML content documents, CSS stylesheets, image assets (JPEG, PNG, SVG), optional NCX (EPUB 2) or XHTML nav document (EPUB 3) for table of contents, and optional fonts (OTF, WOFF). EPUB 3 adds support for MathML, JavaScript (restricted), media overlays (SMIL for synchronized audio), and the EPUB Navigation Document replacing the NCX.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
0x00 | 4 bytes | ZIP Local File Header Signature | 50 4B 03 04 (PK) | Standard ZIP local file header magic. Present because EPUB is a constrained ZIP archive. |
0x1A | 2 bytes | Filename Length | 08 00 (8 bytes) | Length of the filename field. For the first entry, this must be 8 (the string 'mimetype'). |
0x1C | 2 bytes | Extra Field Length | 00 00 | Must be 0 for the mimetype entry. Any extra field data shifts the mimetype string offset and breaks EPUB detection. |
0x1E | 8 bytes | Filename | 6D 69 6D 65 74 79 70 65 (mimetype) | First file entry filename. Must be exactly 'mimetype' for valid EPUB. |
0x26 | 20 bytes | Mimetype Content | application/epub+zip | Uncompressed content of the mimetype file. No trailing newline or whitespace allowed. |
نقاط الضعف
- Malicious JavaScript in scripted content documents — EPUB 3 allows restricted JS that could exploit reader app vulnerabilities or exfiltrate reading behavior if the reader does not sandbox scripts properly
- Path traversal via ZIP entry names — crafted filenames like ../../etc/passwd in the ZIP can escape the extraction directory on vulnerable tools (Zip Slip vulnerability)
- XML External Entity (XXE) injection — XHTML or OPF content referencing external entities can trigger server-side request forgery or local file disclosure in readers that resolve DTD references
- Embedded font exploits — malformed OTF/TTF font files inside EPUB can trigger memory corruption in font rendering engines (historical: FreeType CVEs)
الحماية: FileDex processes EPUB files entirely in the browser sandbox. No server upload occurs, no JavaScript within the EPUB is executed, and ZIP extraction operates within the browser's memory sandbox without filesystem write access. Font rendering uses the browser's built-in engine with its own security boundary.