| Electronic Publication (EPUB) | |
|---|---|
| Filename extension | .epub |
| Internet media type | application/epub+zip |
| Magic number | PK\x03\x04 (Zip) |
| Developed by | International Digital Publishing Forum (IDPF) |
| Initial release | September 2007; 18 years ago (2007 -09) |
| Latest release | |
| Type of format | e-bookfile format |
| Contained by | OEBPS Container Format (OCF;Zip) |
| Extended from | Open eBook,XHTML,CSS,DTBook |
| Standard | ISO/IEC TS 30135 |
| Open format? | Yes |
| Website | w3.org/epub3 |
EPUB is ane-bookfile format that uses the ".epub"file extension. The term is short forelectronic publication and is sometimes stylized asePUB. EPUB is supported by manye-readers, and compatible software is available for most smartphones, tablets, and computers. EPUB is atechnical standard published by theInternational Digital Publishing Forum (IDPF). It became an official standard of the IDPF in September 2007, superseding the olderOpen eBook (OEB) standard.[2]
TheBook Industry Study Group endorses EPUB 3 as the format of choice for packaging content and has stated that the global book publishing industry should rally around a single standard.[3] Technically, a file in the EPUB format is aZIP archive file consisting ofXHTML files carrying the content, along with images and other supporting files. EPUB is the most widely supported vendor-independentXML-based e-book format; it is supported by almost all hardware readers and many software readers andmobile apps.[4]
A successor to theOpen eBook Publication Structure, EPUB 2.0 was approved in October 2007,[5] with a maintenance update (2.0.1) approved in September 2010.[6]
The EPUB 3.0 specification became effective in October 2011, superseded by a minor maintenance update (3.0.1) in June 2014.[7] New major features include support for precise layout or specialized formatting (Fixed Layout Documents), such as for comic books,[8] andMathML support. The current version of EPUB is 3.2, effective May 8, 2019.[9] The (text of) format specification underwent reorganization[10] and clean-up; format supports remotely hosted resources and new font formats (WOFF 2.0 andSFNT)[11] and uses more pureHTML andCSS.[12]
In May 2016IDPF members approvedWorld Wide Web Consortium (W3C) merger,[13] "to fully align the publishing industry and core Web technology".[14]
EPUB 2.0 was approved in October 2007, with a maintenance update (2.0.1) intended to clarify and correct errata in the specifications being approved in September 2010.[6] EPUB version 2.0.1 consists of three specifications:
.epub file in XML.[16]EPUB internally uses XHTML orDTBook (an XML standard provided by theDAISY Consortium) to represent the text and structure of the content document, and a subset of CSS to provide layout and formatting.XML is used to create the document manifest,table of contents, and EPUBmetadata. Finally, the files are bundled in azip file as a packaging format.
An EPUB file uses XHTML 1.1 (or DTBook) to construct the content of a book as of version 2.0.1. This is different from previous versions (OEBPS 1.2 and earlier), which used a subset of XHTML. There are, however, a few restrictions on certain elements. TheMIME type for XHTML documents in EPUB isapplication/xhtml+xml.[15][a]
Styling and layout are performed using a subset of CSS 2.0, referred to asOPS Style Sheets. This specialized syntax requires that reading systems support only a portion of CSS properties and adds a few custom properties. Custom properties includeoeb-page-head, oeb-page-foot, andoeb-column-number. Font-embedding can be accomplished using the@font-face property, as well as including the font file in the OPF's manifest (see below). TheMIME type for CSS documents in EPUB istext/css.[15][b]
EPUB also requires thatPNG,JPEG,GIF, andSVG images be supported using theMIME typesimage/png, image/jpeg, image/gif, image/svg+xml. Other media types are allowed, but creators must include alternative renditions using supported types.[15] For a table of all required MIME types, seeSection 1.3.7 of the specification.
Unicode is required, and content producers must use eitherUTF-8 orUTF-16 encoding.[15] This is to support international and multilingual books. However, reading systems are not required to provide the fonts necessary to display every Unicode character, though they are required to display at least a placeholder for characters that cannot be displayed fully.[15]
An example skeleton of an XHTML file for EPUB looks like this:
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en"><head><metahttp-equiv="Content-Type"content="application/xhtml+xml; charset=utf-8"/><title>Pride and Prejudice</title><linkrel="stylesheet"href="css/main.css"type="text/css"/></head><body> ...</body></html>
The OPF specification's purpose is to "[define] the mechanism by which the various components of an OPS publication are tied together and provides additional structure and semantics to the electronic publication".[16] This is accomplished by two XML files with the extensions.opf and.ncx.
The OPF file, traditionally namedcontent.opf, houses the EPUB book's metadata, file manifest, and linear reading order. This file has a root elementpackage and four child elements:metadata,manifest,spine, andguide. Furthermore, thepackage node must have theunique-identifier attribute. The .opf file's MIME type isapplication/oebps-package+xml.[16]
Themetadata element contains all the metadata information for a particular EPUB file. Three metadata tags are required (though many more are available):title,language, andidentifier.title contains the title of the book,language contains the language of the book's contents inRFC 3066 formator its successors, such as the newerRFC 4646 andidentifier contains a unique identifier for the book, such as itsISBN or aURL. Theidentifier'sid attribute should equal theunique-identifier attribute from thepackage element.[16][c]
Themanifest element lists all the files contained in the package. Each file is represented by anitem element, and has the attributesid,href,media-type. All XHTML (content documents), stylesheets, images or other media, embedded fonts, and the NCX file should be listed here. Only the.opf file itself, thecontainer.xml, and themimetype files should not be included.[16]
Thespine element lists all the XHTML content documents in their linear reading order. Also, any content document that can be reached through linking or the table of contents must be listed as well. Thetoc attribute ofspine must contain theid of the NCX file listed in the manifest. Eachitemref element'sidref is set to theid of its respective content document.[16]
Theguide element is an optional element for the purpose of identifying fundamental structural components of the book. Eachreference element has the attributestype,title,href. Files referenced inhref must be listed in the manifest, and are allowed to have an element identifier (e.g.#figures in the example).[16][d]
An example OPF file:
<?xml version="1.0"?><packageversion="2.0"xmlns="http://www.idpf.org/2007/opf"unique-identifier="BookId"><metadataxmlns:dc="http://purl.org/dc/elements/1.1/"xmlns:opf="http://www.idpf.org/2007/opf"><dc:title>PrideandPrejudice</dc:title><dc:language>en</dc:language><dc:identifierid="BookId"opf:scheme="ISBN">123456789X</dc:identifier><dc:creatoropf:file-as="Austen, Jane"opf:role="aut">JaneAusten</dc:creator></metadata><manifest><itemid="chapter1"href="chapter1.xhtml"media-type="application/xhtml+xml"/><itemid="appendix"href="appendix.xhtml"media-type="application/xhtml+xml"/><itemid="stylesheet"href="style.css"media-type="text/css"/><itemid="ch1-pic"href="ch1-pic.png"media-type="image/png"/><itemid="myfont"href="css/myfont.otf"media-type="application/x-font-opentype"/><itemid="ncx"href="toc.ncx"media-type="application/x-dtbncx+xml"/></manifest><spinetoc="ncx"><itemrefidref="chapter1"/><itemrefidref="appendix"/></spine><guide><referencetype="loi"title="List Of Illustrations"href="appendix.xhtml#figures"/></guide></package>
The NCX file (NavigationControl file forXML), traditionally namedtoc.ncx, contains the hierarchicaltable of contents for the EPUB file. The specification for NCX was developed forDigital Talking Book (DTB), is maintained by theDAISY Consortium, and is not a part of the EPUB specification. The NCX file has a MIME type ofapplication/x-dtbncx+xml.
Of note here is that the values for thedocTitle,docAuthor, andmeta name="dtb:uid" elements should match their analogs in the OPF file. Also, themeta name="dtb:depth" element is set equal to the depth of thenavMap element.navPoint elements can be nested to create a hierarchical table of contents.navLabel's content is the text that appears in the table of contents generated by reading systems that use the .ncx.navPoint'scontent element points to a content document listed in the manifest and can also include an element identifier (e.g.#section1).[16][18]
A description of certain exceptions to the NCX specification as used in EPUB is in Section 2.4.1 of the specification.[19] The complete specification for NCX can be found in theSpecifications for the Digital Talking Book.[18]
An example .ncx file:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN""http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"><ncxversion="2005-1"xml:lang="en"xmlns="http://www.daisy.org/z3986/2005/ncx/"><head><!-- The following four metadata items are required for all NCX documents,including those that conform to the relaxed constraints of OPS 2.0 --><metaname="dtb:uid"content="123456789X"/><!-- same as in .opf --><metaname="dtb:depth"content="1"/><!-- 1 or higher --><metaname="dtb:totalPageCount"content="0"/><!-- must be 0 --><metaname="dtb:maxPageNumber"content="0"/><!-- must be 0 --></head><docTitle><text>PrideandPrejudice</text></docTitle><docAuthor><text>Austen,Jane</text></docAuthor><navMap><navPointclass="chapter"id="chapter1"playOrder="1"><navLabel><text>Chapter1</text></navLabel><contentsrc="chapter1.xhtml"/></navPoint></navMap></ncx>
An EPUB file is a group of files that conform to the OPS/OPF standards and are wrapped in a ZIP file.[20] The OCF specifies how to organize these files in the ZIP, and defines two additional files that must be included.
Themimetype file must be a text document in ASCII that contains the stringapplication/epub+zip. It must also be uncompressed, unencrypted, and the first file in the ZIP archive. This file provides a more reliable way for applications to identify the MIME type of the file than just the.epub extension.[17]
Also, there must be a folder namedMETA-INF, which contains the required filecontainer.xml. This XML file points to the file defining the contents of the book. This is the OPF file, though additional alternativerootfile elements are allowed.[17]
Apart frommimetype andMETA-INF/container.xml, the other files (OPF, NCX, XHTML, CSS and images files) are traditionally put in a directory namedOEBPS.
An example file structure:
--ZIP Container--MIME typeMETA-INF/ container.xmlOEBPS/ content.opf chapter1.xhtml ch1-pic.png css/ style.css myfont.otf
An example container.xml, given the above file structure:
<?xml version="1.0" encoding="UTF-8" ?><containerversion="1.0"xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfilefull-path="OEBPS/content.opf"media-type="application/oebps-package+xml"/></rootfiles></container>
The EPUB 3.0 Recommended Specification was approved on 11 October 2011. On June 26, 2014, EPUB 3.0.1 was approved as a minor maintenance update to EPUB 3.0. EPUB 3.0 supersedes the previous release 2.0.1.[e]
EPUB 3 consists of a set of four specifications:[21]
The EPUB 3.0 format was intended to address the following criticisms:
On June 26, 2014, the IDPF published EPUB 3.0.1 as a final Recommended Specification.[24]
In November 2014, EPUB 3.0 was published by theISO/IEC as ISO/IEC TS 30135 (parts 1–7).[25]
In January 2020, EPUB 3.0.1 was published by theISO/IEC as ISO/IEC 23736 (parts 1–6).[26]
EPUB 3.2 was announced in 2018,[27] and the final specification was released in 2019.[28] A notable change is the removal of a specialized subset of CSS, enabling the use of non-epub-prefixed properties. The references to HTML and SVG standards are also updated to "newest version available", as opposed to a fixed version in time.[29]
The W3C announced version 3.3 on May 25, 2023.[30] Changes included stricter security and privacy standards; and the adoption of theWebP andOpus media formats.[31]
The format and many readers support the following:
An EPUB file can optionally contain DRM as an additional layer, but it is not required by the specifications.[36] In addition, the specification does not name any particular DRM system to use, so publishers can choose a DRM scheme to their liking. However, future versions of EPUB (specifically OCF)may specify a format for DRM.[17]
The EPUB specification does not enforce or suggest a particular DRM scheme. This could affect the level of support for various DRM systems ondevices and the portability of purchased e-books. Consequently, such DRM incompatibility may segment the EPUB format along the lines of DRM systems, undermining the advantages of a single standard format and confusing the consumer.[37][38][39][40][41][42]
DRMed EPUB files must contain a file calledrights.xml within theMETA-INF directory at the root level of the ZIP container.[17][clarification needed]
EPUB is a popular format forelectronic data interchange as it is based on HTML and other published standards and requires no licensing to implement. EPUB is widely supported by software readers such asGoogle Play Books onAndroid andApple Books oniOS andmacOS and hardware such asAmazon's Kindle e-readers.
The EPUB format is the underlying framework for Apple's proprietary iBook format, which depends upon code from the Apple Books app to function.[43] In 2022,Amazon'sSend to Kindle service removed support for its ownKindle File Format in favor of EPUB.[44][45]
Popular EPUB producers ofpublic domain andopen licensed content includeProject Gutenberg,Standard Ebooks,PubMed Central,SciELO and others.
EPUB requires readers to support theHTML5,JavaScript, CSS,SVG formats, making EPUB readers use the same technology as web browsers. Such formats are associated with various types of security issues and privacy-breaching behaviors e.g.Web beacons,CSRF,XSHM due to their complexity and flexibility. Such vulnerabilities can be used to implementweb tracking andcross-device tracking on EPUB files.[46][47][48] Security researchers also identified attacks leading to local files and other user data being uploaded.[49][50]
The "EPUB 3.1 Overview" document provides a security warning:[51]
Authors need to be aware that scripting in an EPUB Publication can create security considerations that are different from scripting within a Web browser. For example, typical same-origin policies are not applicable to content that has been downloaded to a user's local system. Therefore, it is strongly encouraged that scripting be limited to container constrained contexts.
An EPUB file is an archive that contains, in effect, a website. It includes HTML files, images, CSS style sheets, and other assets. It also contains metadata. EPUB 3.3 is the latest version. By usingHTML5, publications can contain video, audio, and interactivity, just like websites in web browsers.[33]
An EPUB publication is delivered as a single file. This file is an unencrypted zipped archive containing a set of interrelated resources.[52]
An OCF (Open Container Format) Abstract Container defines a file system model for the contents of the container. The file system model uses a single common root directory for all contents in the container. All (non-remote) resources for publications are in the directory tree headed by the container's root directory, though EPUB mandates no specific file system structure for this. The file system model includes a mandatory directory named META-INF that is a direct child of the container's root directory. META-INF stores container.xml.
The first file in the archive must be theMIME type file. It must be unencrypted and uncompressed so that non-ZIP utilities can read the MIME type. The MIME type file must be anASCII file that contains the stringapplication/epub+zip. This file provides a more reliable way for applications to identify the MIME type of the file than just the .epub extension.[52]
An example file structure:
--ZIP Container--MIME typeMETA-INF/ container.xmlOEBPS/ content.opf chapter1.xhtml ch1-pic.png css/ style.css myfont.otf toc.ncx
There must be a META-INF directory containing container.xml. This file points to the file defining the contents of the book, the OPF file, though additional alternativerootfile elements are allowed.[52] Apart from MIME type and META-INF/container.xml, the other files (OPF, NCX, XHTML, CSS and images files) are traditionally put in a directory named OEBPS. An example container.xml:
<?xml version="1.0" encoding="UTF-8" ?><containerversion="1.0"xmlns="urn:oasis:names:tc:opendocument:xmlns:container"><rootfiles><rootfilefull-path="OEBPS/content.opf"media-type="application/oebps-package+xml"/></rootfiles></container>
The ePUB container must contain:[53]
The ePUB container may contain:
Content documents include[54]HTML 5 content, navigation documents,SVG documents, scripted content documents, and fixed layout documents.Contents also include CSS and PLS documents. Navigation documents supersede the NCX grammar used in EPUB 2.
Books with synchronized audio narration are created in EPUB 3 by using media overlay documents to describe the timing for the pre-recorded audio narration and how it relates to the EPUB Content Document markup. The file format for Media Overlays is defined as a subset ofSMIL.[55]
EPUB reader software exists for all major computing platforms, such asAdobe Digital Editions andcalibre on desktop platforms,Google Play Books andAldiko on Android and iOS, and Apple Books on macOS and iOS. There is also cross-platform editor software for creating EPUB files, including theopen source programs calibre andSigil.
Most modernweb browsers also support EPUB readerplugins. TheMicrosoft Edge browser had EPUB reader capability built in until September 2019.[56]
The following software can read and display EPUB files.
| Software | License | Platform | DRM formats supported | Notes |
|---|---|---|---|---|
| Adobe Digital Editions | Proprietary | MicrosoftWindows,AppleMac OS X, Android, iOS | Adobe Content Server | Requires online activation for EPUB files with DRM. |
| Aldiko | Proprietary | Android | Adobe Content Server | Supports EPUB for Android devices. |
| Apple Books | Proprietary | OS X, iOS | FairPlay[57] | Supports EPUB 2 and EPUB 3. Booksnot readable directly on computers other than Macs. |
| Bluefire Reader | Proprietary | Apple iOS, Android | Adobe Content Server | Supports EPUB for Android and iOS devices. |
| calibre | GPL | Windows, OS X, Linux | None | Primarily for library management, conversion, and transferring to devices, it includes an EPUB reader and editor.[58] |
| FBReader | Proprietary[59] | Windows, Linux, Android,PDAs, OS X | Readium LCP | |
| Foliate | GPL | Linux | None | Supports also Mobi, AZW(3) |
| Google Play Books | Proprietary | Web application, Android, Apple iOS | Lektz DRM | Supports downloading purchased books as EPUB and/or PDF. |
| Kitabu | Proprietary | OS X | None | Supports ePub3, ePub2, fixed layout. |
| Kobo | Proprietary | Windows, OS X, Android, Apple iOS, Kobo eReader Software, | Adobe Content Server | Supports EPUB 2 and EPUB 3. |
| Lector | GPL | Linux | None | Supports also Mobi, AZW(3/4), CBR/CBZ, PDF, DjVu, FB2 |
| Lektz Readers | Proprietary | Web application, GoogleAndroid, OS X,iOS, Windows | Lektz | eBook Readers for PDF, ePUB/2 and ePUB3 providing uniform experience across different platforms - iOS, Android, Windows PC, Mac Desktop and Web. |
| MuPDF | AGPL | Unix-like, Windows, Android, iOS | ||
| Libby | Proprietary | Windows, Android, Apple macOS, iOS, iPadOS | Free app for eBooks and audiobooks from local libraries. | |
| Lucifox | GPL | Windows, OS X, Linux | None | Ebook reader add-on with annotations for Firefox. Supports open standard ebooks in EPUB 3- and EPUB 2 format and retrieval of books from OPDS book catalogues. (Development discontinued January 2017) |
| Okular | GPL | Windows, OS X, Linux | ||
| Snapplify | Proprietary | All Web browsers, Apple iOS, Android | Adobe Content ServerSnapplify SnappSafe DRM | Supports downloading purchased books as EPUB and/or PDF. Supports PDF, ePUB2 and ePUB3 standard of e-books. |
| Sora | Proprietary | Windows, Android, Apple macOS, iOS, iPadOS | Free app for eBooks and audiobooks from schools. | |
| STDU Viewer | Freeware | Windows | Supports many documents format including EPUB. | |
| Sumatra PDF (based onMuPDF) | GPL | Windows | Adobe Content Server | Supports EPUB for devices. |
| xochitl | Proprietary[60] | Codex | None | GUI for thereMarkable and reMarkable 2 Paper Tablets |
The following software can create EPUB files.
| Software | License | Platform | Notes |
|---|---|---|---|
| ABBYY FineReader | Proprietary | Microsoft Windows | Version 11 exports to EPUB format. |
| Abiword | GPL | FreeBSD, Linux, Windows | Support EPUB 2.0 format export since 2.9.1 release[61] |
| Adobe InDesign | Proprietary | Windows, OS X | Exports to EPUB format. Versions prior to 5.5 create EPUBs that require significant editing to pass ePubCheck or ePubPreFlight. As from InDesign CC 2014, InDesign can export in ePub3 fixed-layout format. |
| Adobe RoboHelp | Unknown | Windows | Online documentation tool that supports export to EPUB format |
| Atlantis Word Processor | Shareware | Windows,Portable app | Converts any document to EPUB; supports multilevel TOCs, font embedding, and batch conversion. |
| Booktype | GPL | Web | Book production platform that outputs to many formats, including EPUB. The platform can import content in various formats and supports collaborative editing. |
| calibre | GPL | Windows, OS X, FreeBSD, Linux | Conversion software and e-book organizer. Allows plugins, including for editing EPUB files; there is for instance a plugin to merge several EPUB files into one.[62] |
| eLML | Unknown | Windows, OS X, FreeBSD, Linux | The eLesson Markup Language is a platform-independent XML-based open-source framework to create eLearning content. It supports various output formats like SCORM, HTML, PDF and also eBooks based on the EPUB format. |
| Feedbooks | Unknown | Web | Free cloud service for downloading public domain works and for self-publishing. |
| Help & Manual | Proprietary | Windows | Single source publishing tool that generates EPUB amongst several other documentation formats. |
| HelpNDoc | Free for personal use, commercial otherwise. | Windows | Help authoring tool that generates EPUB files and other formats. |
| iBooks Author | Proprietary | OS X | Desktop publishing and page layout application. Free from Apple. Can export .ibooks format, which is a proprietary format based on EPUB.[63] There are restrictions on the commercial distribution of works created with iBooks in the .ibooks format.[64] These restrictions apply to the .ibooks format only[65] and it can be argued that a file renamed to .epub is not distributed in the .ibooks format. |
| iStudio Publisher | Proprietary | OS X | Desktop publishing and page layout application. |
| LibreOffice Writer | Mozilla Public License,GNU Lesser General Public License | Windows, OS X, Linux | Text processor with a functionality to export as EPUB3 format since version 6.0. Also allowed to export as EPUB format via installing extension, such as eLaix.[66] |
| Lulu.com | Proprietary | Web | Converts .doc, .docx, or PDF manuscripts to an EPUB so that they may be sold on the Website in question. |
| Madcap Flare | Proprietary | Windows | Single source publishing tool that can export content as EPUB. |
| oXygen XML Editor | Proprietary | OS X, Windows, FreeBSD, Linux | oXygen XML editor is the first tool that supports creating, transforming, and validating the documents that comprise the EPUB package. |
| Pages | Proprietary | Mac OS X | Word processor that can export to EPUB format |
| Pages | Proprietary | AppleiOS | Word processor for mobile devices that can export to EPUB format |
| Pandoc | GPLv2 | Unix-like, Windows | Can convert to and from EPUB versions 2 and 3 |
| Playwrite | Proprietary | OS X | Native EPUB-based word processor. Native to EPUB 3 with EPUB 2 compatibility. |
| QuarkXPress | Proprietary | OS X, Windows | Desktop publishing tool, page layout application. Exports also to the EPUB format. |
| SerifPagePlus | Proprietary | Windows | Desktop publishing program that can export to the EPUB 2 and EPUB 3 format. Comes with built-in output conversion profiles for targeting specific devices, as well as generic devices. Also includes pre-tested blank eBook templates, or can open and edit existing PDF files and publish as EPUB. |
| Scrivener | Proprietary | Windows, OS X | Program for writers. Includes organization capabilities for fiction writers. Publishes to multiple formats. |
| Sigil | GPL | Windows, FreeBSD, Linux, OS X | Can open and edit EPUB books, instead of just converting from other formats to EPUB. Since version 0.7, supports embedding video or audio in EPUB.[67] |
| eXeLearning | GPL | Windows, Linux, OS X | Can be used to create educational interactive Web content, HTML5, IMS, SCORM and EPUB3 books[68] |
| Mellel | Proprietary | OS X | Word processor application, can export its documents to EPUB[69] |
| Google Docs | Proprietary | Web | Cloud word processor, can export to EPUB. |
type is in"Section 2.6",ePub OPDF 2.0.1 (specification draft), IDPF.