.fw files.wiki
EPUB

EPUB Files

Electronic Publication (EPUB)

EPUB is an open ZIP-based e-book format for reflowable or fixed-layout digital publications.

EPUB (Electronic Publication)

Developer
International Digital Publishing Forum (IDPF), now W3C Publishing Community
Category
eBooks
MIME type
application/epub+zip
Format
Container
Magic bytes
50 4B 03 04
First released
2007
Latest version
EPUB 3.3
Open standard
Yes

Open a .EPUB file online

Reading file…

What is a .EPUB file?

.epub represents an EPUB, Electronic Publication, an increasingly popular open eBook and digital publishing format invented by the International Digital Publishing Forum in 2007. Following the adoption of IDPF into World Wide Web Consortium, the maintenance of EPUB happens via W3C publishing standards, with EPUB 3.3 being the present-day version.

EPUB is an eBook with packaging of publication (not a simple image page). Contents of the package include text of a book, its table of contents, metadata, including title and author names, CSS style-sheets, cover, pictures, fonts, and reading order data. EPUB 3 publications include also audio and video clips or MathML, SVG and/or scripting using JavaScript, where the technology is supported by a reading system.

The sources of .epub files may include free public domain collections, such as Project Gutenberg; commercial publishers, online bookstores; library lending programs; academic publishers; self-publishing platforms; applications for creating books, such as Sigil, Calibre, and Pandoc. The extension represents both e-Books that change page size depending on display screen or choice of font; it represents as well fixed-layout editions, such as comic-books or textbooks.

.epub does not represent an essential or popular mainstream format different from EPUB. An authentic EPUB is ZIP-based document and starts with bytes PK (50 4B 03 04); an EPUB includes at least one non-compressed entry 'mimetype' of exactly the type "application/epub+zip". DRM-ed EPUB has .epub extension, however the usage might depend on Adobe Content Server, libraries systems, Kobo reader or Apple Books.

How to open a .EPUB file

Open a .EPUB file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .EPUB file if you have an app for .epub files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .EPUB file -> select Open with -> Choose another app.
  4. 4 Choose Calibre in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .epub files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .EPUB file on macOS

  1. 1 In the Finder app, locate your .EPUB file.
  2. 2 Just double-click your .EPUB file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> Apple Books.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for macOS

Open a .EPUB file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> Calibre.
  4. 4 Install Calibre (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .EPUB file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .EPUB file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap Google Play Books and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download Google Play Books from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .EPUB file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .EPUB file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select Apple Books from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .EPUB file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .EPUB files

The programs in Windows that are used to work with EPUB include Calibre, Thorium Reader, Adobe Digital Editions, FBReader, Okular, and Sumatra PDF. The choice Calibre is a preferred one because this reader offers the maximum robustness with respect to handling large libraries and metadata editing and can do conversions of the books. However, it should be admitted that Thorium Reader is the most appropriate to use as EPUB 3 and accessibility tester, Sumatra PDF - to gain quick access to your books although this application is more lightweight than Calibre and has fewer features to manage the library. It should be pointed out that both Calibre and Adobe Digital Editions are available free of charge, Calibre is open-source and Adobe program is widely used in conjunction with library and other vendor EPUB lending processes.

Among the programs for macOS the most frequent to read EPUB is a native program of the same Apple called Apple Books. If there is a need in more functions to edit and test standards or convert the documents you have at hand the list will include Calibre, Thorium Reader, Adobe Digital Editions, Sigil, and FBReader. This list implies that Apple Books, Calibre, Thorium Reader, and Sigil are free. At the same time, Adobe Digital Editions and FBReader are both free of charge.

As for Linux, you may choose among such programs as Calibre, Foliate, Thorium Reader, Okular, FBReader, and either GNOME or KDE document applications. It seems to me, that in some cases packages from package managers may have less actual features due to a fact that new EPUB 3.3 standard is not supported completely, then the update from the official sources would be welcome especially if any kind of special formatting is expected.

When it goes to mobiles - Android devices, I would prefer such EPUB libraries as Google Play Books, Adobe Digital Editions, Kobo Books, FBReader, and BookFusion as well as reader application for the specific model. The library EPUBs need a special library software designated to this specific library.

For iOS and iPads the EPUB opening program is Apple Books working with the Books file system and opened through File menu, Mail, Safari downloading, AirDrop, sharing, etc. However, Google Play Books, Kobo and their application for web, also BookFusion and Adobe Digital Editions could be useful here in addition to EPUB libraries on websites of the libraries Google Play Books upload and Kobo or web-reading. Browsers, obviously, won't open epub files similar to pdfs. They will recognize only files in the form of folder with signature 50 4B 03 04 as ZIP archives. If it does, you should not rezip the EPUB files in any case as it could lead to breaking EPUB rules.

Technical details

EPUB is an Open Container Format based on ZIP; hence, its signature (found in offset 0) is ZIP local-file-header 50 4B 03 04 magic number. The first ZIP entry must be called mimetype and must be uncompressed, having no further ZIP header info (no extra field), containing "application/epub+zip" ASCII literal. The position allows software to detect EPUB container before parsing of the central directory or uncompression.

META-INF/container.xml must define the OPF package (often in .opf file) in its rootfile full-path attribute. EPUB OPF file holds publication information, the manifest of resource content (metadata), spine and order of reading materials, declarations about media-types, and packaging information itself. The typical reserved paths in the OCF container are: META-INF/metadata.xml, encryption.xml, rights.xml, signatures.xml; in the case where proprietary DRM mechanism was used. For encryption information is used only META-INF/encryption.xml but in the case DRM used - specific vendors' software.

Publication content must use XHTML encoded either in XML or HTML5 files, style information using CSS, multimedia information such as: images, fonts, SVG graphics, and audio/video information as declared in the manifest, zip compression (commonly, deflate), UTF-8 for file naming. In case of EPUB 2 usage NCX format for table of contents was widespread. In the modern version EPUB 3 uses XHTML Navigation Document, but many publications also use NCX for compatibility with old EPUB readers. Also rich set of the accessible information about the publication, and MathML and SVG embedding as well as scripts were standardized in EPUB 3.

The registered mime is application/epub+zip. It was developed and used starting from EPUB 2.0 (in 2007) till today (W3C specs for EPUB 3.3). The typical size can vary from below 1 MB for simple book in plain textual format up to several hundred MB in case where publication is comics or educational text book. Validation of OCF packaging, OPF metadata, manifest info and EPUB 2/xhtml/xml syntax can be done with the EPUBCheck application.

How to convert .EPUB files

Despite the advent of EPUB readers that allow reading on various electronic platforms and in a convenient manner, the PDF file is considered the most popular request from people for the purpose of printing, page-based citation and delivery of text files that cannot read through EPUB readers. In addition, one needs just run a command-line ebook-convert input.epub output.pdf with regard to Calibre software, while the elements such as reflowable text pages, breakage pages, fonts etc. may have been altered as a result of pagination.

The preferred Kindle file format is AZW3, rather than old MOBI. The AZW3 preserves a greater number of elements like css, pictures or the layout. Most commonly, an operation of converting a Kindle is executed in accordance to following commands: ebook-convert input.epub output.azw3 and after, one might load the file to a kindle device by either copying to the device with USB or sending by some kind of specific tool; at last, in case of the lack of some tools one may utilize an outdated type that is called MOBI.

In order to make the EPUB file readable for any program like Word or Google documents an operator may utilize DOCX format. The command line conversion of files could be done in several ways: Pandoc: pandoc input.epub -o output.docx. Calibre: ebook-convert input.epub output.docx.

Conversion to HTML is the simplest way to access content, because all contents of the book will be exposed. One needs just run a simple command: pandoc input.epub -s -o output.html. Another approach may consist of a conversion that may generate files inside an archive as a part of a book (chapters) that have been generated by some tool.

As it is already mentioned above, plain text file does not include some elements such as links and other, it has an extremely simplified view of the source file and could be created easily as the following: pandoc input.epub -t plain -o output.txt. Also the operator might need a simple and readable file which could be included to some technical work or a document that needs a versioning (in git). One should just execute the following commands: pandoc input.epub -t gfm -o output.md

Convert toToolCommand / note
PDF Calibre ebook-convert ebook-convert input.epub output.pdf Useful for printing and fixed pagination; reflowable text, page breaks, hyperlinks, and font metrics may change.
AZW3 Calibre ebook-convert ebook-convert input.epub output.azw3 Common for Kindle devices that support KF8/AZW3; DRM-protected EPUB files must be authorized or decrypted legally first.
DOCX Pandoc pandoc input.epub -o output.docx Good for editing text in word processors; complex layout, interactivity, media overlays, and some CSS are simplified.
HTML Pandoc pandoc input.epub -s -o output.html Extracts the reading order into a standalone HTML file; multi-file EPUB structure and packaged assets may be flattened or rewritten.
TXT Pandoc pandoc input.epub -t plain -o output.txt Produces plain text for search, quoting, or accessibility workflows; all images, styling, links, and tables lose structure.
MOBI Calibre ebook-convert ebook-convert input.epub output.mobi Legacy Kindle format; use AZW3 or KFX when possible because MOBI has limited CSS and typography support.
Markdown Pandoc pandoc input.epub -t gfm -o output.md Useful for documentation or version control; EPUB metadata and rich layout must be represented approximately.

Common problems and fixes

This document highlights typical problems with possible solutions associated with DRM-protected EPUB e-books along with related packaging problems.

"Protected by DRM” or "Error getting license” indicates encryption of the ebook on particular Adobe ID, Kobo account, online bookstore account or a library lending platform. Launch the EPUB file in an appropriate application, e.g., Adobe Digital Editions, Kobo Books or the corresponding app designed for lending libraries, and log in to the account which purchased/borrowed the ebook.

"Not a valid EPUB file” suggests the corrupted, incomplete or improperly named EPUB inside ZIP file. Compare the file size with the information at the website where the download took place, then re-download it and run tests with EPUB validation tools such as EPUBCheck (or unzip the EPUB into a content directory) or any Zip tool supporting contents listing.

"Mimetype entry missing or not the first file in the archive” indicates packing problems resulting from inappropriate zipping process in the course of which the uncompressed file containing 'application/epub+zip" should become the first in the list and present inside EPUB.

An older reading device could show empty or incorrectly displayed pages and the message "unsupported EPUB version" while encountering the following: fixed-layout ebooks, scripting code, MathML code, svg graphics, multimedia, or any other EPUB version greater than v1.x or 2.x. Test whether Thorium Reader, Apple Books, and the ebook reading program issued currently by ebook vendor are useful here. This applies particularly to the EPUB v3.1 books with scripts, multimedia, math and graphics features.

Problems related with lack of fonts, incorrect line break, weird-looking characters may be solved by switching font overrides inside a reader and turning publisher-styling off.

If broken images or a "resource not found error message" shows, the problem is probably caused by improper package structure in general. Validation tool could be very helpful to repair incorrect links inside OPF files, wrong file extensions/paths or any other issues resulting from inappropriate linking structure.

In case of opening the EPUB file as archive, use File associations in Control panel/Open With to change the association (Windows/macOS), launch a designated EPUB reader and assign its default opening action (Windows/macOS), or upload it in the existing reader. In case of downloading the .acsm file, it will help to get actual EPUB file in Adobe Digital Editions or equivalent library lending app.

Security considerations

EPUB is the ZIP format that includes the signature 50 4B 03 04 and is not a type of Office document with macro programs and executables. Nevertheless, the content of EPUB 3 can include XHTML, CSS, SVG, fonts, images, audio, video, remote links, and scriptable parts if the reader supports such languages.

Untrusted .epub files should be considered potentially malicious, since they run actively in the reading application. Security vulnerabilities were identified for parsers of XML/zip, images, fonts, JavaScript, and DRM; hence, one should first update Calibre, Thorium Reader, Apple Books, Adobe Digital Editions, Kobo app, browser readers, and OS before loading any files received from emails or downloaded non-store sources. It is recommended to prohibit accessing the net or running any kind of scripting by the reading software.

Dangerous content can exploit links and remote images, execute JavaScript code, send tracking pixel images, or confirm the fact of viewing the content and redirect a victim from legitimate site to any phishing resources. Metadata can show us the book's title, author's name, publishing organization, languages of publication, various unique identifiers or modification date, generating program, cover and watermark images used in commercial environments. Poor handling with the ZIP container will allow to exploit dangerous techniques including path traversal, decompression bomb attacks, or large objects.

History and versions

EPUB originated as part of the Open eBook Publication Structure initiative developed during the period of late nineties and early 2000s, as publishers along with software producers endeavored to develop standardizing formats for reflowable digital books. The first specification of the new EPUB format, i.e., EPUB 2.0, was introduced by the International Digital Publishing Forum in 2007, as a replacement of its predecessor, namely the Open eBook Specification.

EPUB 3.0 was announced in 2011 and incorporated HTML5 functionality, richer CSS styling, media types, SVG, MathML, multi-language publishing, better accessibility as well as fixed-layout publications into the format. EPUB 3.0.1 standard was introduced later, in 2014, and was adopted quite widely by commercial reading systems and producer workflows. EPUB 3.1 was released in 2017, but its adoption was rather low, taking account of problems with backwards compatibility with the EPUB 3.0.1 practice. EPUB 3.2 specification was released in 2019 as a community document that met requirements of compatibility, thus acting as an intermediate step before W3C adoption.

EPUB 3.3 became an official W3C Recommendation in 2023, accompanied by EPUB Reading Systems 3.3 and EPUB Accessibility 1.1. The format EPUB continues being used mostly outside Amazon’s own Kindle e-books system.

.pdf (Portable Document Format) is generally the preferred conversion target where exact page layout and geometry, page number formatting, and printing qualities matter; EPUB will be the preferred solution if mobile compatibility, font scaling, compatibility with e-readers like screen readers are critical. MOBI (.mobi), AZW (.azw), AZW3 (.azw3) and KFX are Kindle file types targeted towards the Amazon ecosystem, while EPUB stands for open multi-vendor cross-compatible format that many Kindle pipelines transform on-the-fly.

EPUB adds the functionality of e-book packing and additional data (metadata, manifest, navigation, and resources management for offline reading) onto basic content types like HTML and XHTML documents (.html, .xhtml). Image archives such as CBZ (.cbz), CBR (.cbr) are used primarily for comics, while fixed-layout EPUB can add additional information to images (metadata, navigation, accessibility, text annotations and overlays), however, with more demanding requirements regarding structure. DOCX (.docx) may serve better than EPUB to collaborate on changes in documents, however, EPUB is more suitable for delivery to book stores or libraries after completion of editing cycle, as the former needs more processing in the latter case. ODT (.odt) - this open source document format should be converted into EPUB, which can act then as a distribution medium. DAISY .opf, .ncx, and .dtb have contributed significantly to EPUB 3 accessibility support, which would be usually used for producing any new accessible books from the scratch.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.