Copyright © 1999-2021 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
This document provides a starting point for content authors and software developers wishing to understand the EPUB® 3 specifications. It consists entirely of informative overview material that describes the features available in EPUB 3.
The current version of EPUB 3 is defined in [EPUB-33], which represents the second minor revision of the standard. The substantive changes since EPUB 3.2 [EPUB-32] are documented in a separate section in the EPUB 3.3 document itself.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
This document was published by the EPUB 3 Working Group as a Working Group Note.
GitHub Issues are preferred for discussion of this specification. Alternatively, you can send comments to our mailing list. Please send them to public-epub-wg@w3.org (subscribe, archives).
Publication as a Working Group Note does not imply endorsement by the W3C Membership.
This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. The group does not expect this document to become a W3C Recommendation.
This document is governed by the 15 September 2020 W3C Process Document.
EPUB 3.3 [EPUB-33] is defined through a series of specifications as follows.
This overview document concentrates on the authoring format of EPUB 3.3.
This section covers the major features of EPUB, including important components and topics that apply to the process of authoring EPUB Publications as a whole.
'EPUB (OCF) Container' as the outer most component which encapsulates the 'EPUB Publication' containing two documents 'Publication Document' and 'Navigation Document' along with a inner component labelled 'Publication Resources' which contains multiple 'Content Documents' (XHTML, SVG), and multiple 'Other resources' (CSS, png, mp3, mov, ...).
Every EPUB Publication is represented by a Package Document. The Package Document specifies all the resources required to render that representation of the content. The Package Document also defines a reading order for linear consumption, and associates metadata and navigation information.
The Package Document defines a layer on top of the traditional structuring of a typical Web site to facilitate the authoring of digital publications.
A Web site, for example, embeds references to its resources within its content, which, while a simple and flexible
means of identifying resources, makes it difficult to enumerate all the resources required to render
it. In addition, there is no standard way for a Web site to define that a sequence of pages make up
a larger publication, which is precisely what EPUB's spine
element [EPUB-33]
does (i.e., it provides an external declarative means to explicitly specify navigation through a
collection of documents). Finally, the Package Document defines a standard way to represent metadata
globally applicable to a collection of pages.
The Package Document also includes a collection
element [EPUB-33], which allows grouping of logically related
Publication Resources. This element exists to enable the development of specialized
content identification, processing and rendering features, such as the ability to define embedded
preview content, or assemble an index or dictionary from its constituent XHTML Content
Documents.
The collection
element not currently used in any specifications that are actively maintained by the EPUB 3 Working Group.
Its future use in authoring EPUB Publications is uncertain.
The Package Document is specified in the dedicated section of [EPUB-33].
EPUB Publications provide a rich array of options for adding metadata. Each Package Document includes
a dedicated metadata
section [EPUB-33] for general information about the EPUB Publication, allowing titles,
authors, identifiers, and other information about the EPUB Publication to be easily accessed. It also
provides the means to attach complete bibliographic records using the link
element
[EPUB-33].
The Package Document also allows a Unique Identifier to be established for the EPUB
Publication using the unique-identifier
attribute [EPUB-33].
XHTML Content Documents also include the means of annotating document markup with rich metadata, making them more semantically meaningful and useful both for processing and accessibility purposes. Both RDFa [RDFA-IN-HTML] and Microdata [Microdata] attributes can be used in XHTML Content Documents for that purpose.
Each EPUB Publication contains one or more EPUB Content Documents, as defined in the dedicated section of [EPUB-33]. These are XHTML or SVG documents that describe the readable content and reference associated media resources (e.g., images, audio, and video clips).
XHTML Content Documents are defined by a profile of [HTML].
Although EPUB's history is steeped in enabling reflowable content, not all publications lend themselves easily to reflowing. Page-precise layouts are required to meaningfully represent children's books, comics and manga, magazines, and many other content forms.
EPUB 3 includes metadata that allows the creation of fixed-layout XHTML Content Documents [EPUB-33], in addition to existing capabilities for fixed layouts in SVG. This metadata enables the control of the page dimensions [EPUB-33], creating a canvas on which elements can be absolutely positioned.
The metadata does not just flag whether content is to be fixed or reflowed, but also allows EPUB Creators to specify the desired orientation of pages [EPUB-33], when to create synthetic spreads [EPUB-33], and how to position pages [EPUB-33] within those spreads, providing a broad range of control over the presentation of EPUB Publications.
The structure and semantics of EPUB Documents with Fixed Layouts are defined in [EPUB-33].
A key concept of EPUB is that content presentation adapts to the user, rather than the user having to adapt to a particular presentation of content. HTML was originally designed to support dynamic rendering of structured content, but over time HTML as supported in Web browsers has become focused on the needs of Web applications, and many popular Web sites now have layouts with less flexibility.
EPUB Publications, however, are designed to maximize accessibility for the visually impaired, and Reading Systems typically perform text line layout and pagination on the fly, adapting to the size of the display area, the user's preferred font size, and other environmental factors. This behavior is not guaranteed in EPUB; images, vector graphics, video, and other non-reflowable content might be included, and some Reading Systems might not paginate on the fly, or at all. Nevertheless, supporting dynamic adaptive layout and accessibility has been a primary design consideration throughout the evolution of the EPUB standard.
EPUB Content Documents can reference CSS Style Sheets, allowing EPUB Creators to define the desired rendering properties. EPUB 3 follows support for CSS as defined in the [CSSSnapshot].
EPUB 3 also supports CSS styles that enable both horizontal and vertical layout and both left-to-right and right-to-left writing. Refer to § 3.3 CSS in the Global Language Support section for more information.
EPUB 3 supports audio and video embedded in XHTML Content Documents via the [HTML]
audio
and video
elements, inheriting all the functionality and
features these elements provide. For more information on audio and video formats, refer to the
section on core media
types [EPUB-33].
Another key multimedia feature in EPUB 3 is the inclusion of Media Overlay Documents [EPUB-33]. When pre-recorded narration is available for an EPUB Publication, Media Overlays provide the ability to synchronize that audio with the text of a Content Document (see also § 4.4 Aural Renditions and Media Overlays).
The structure and semantics of EPUB Documents with Media Overlays are defined in [EPUB-33].
EPUB 3 supports two closely related font formats — OpenType [OpenType] and WOFF [WOFF] [WOFF2] — to accommodate both traditional publishing workflows and emerging Web-based workflows. Word processing programs used to create EPUB Publications are likely to have access only to a collection of installed OpenType fonts, for example, whereas Web-archival EPUB generators will likely only have access to WOFF resources (which cannot be converted to OpenType without undesirable, and potentially unlicensed, stripping of WOFF metadata).
EPUB 3 also supports both obfuscated and regular font resources for both OpenType and WOFF font formats. Support for obfuscated font resources is required to accommodate font licensing restrictions for many commercially available fonts. See the dedicated section on Resource Obfuscation in [EPUB-33] for more details.
EPUB strives to treat content declaratively — as data that can be manipulated, not as programs to be executed — but does support scripting as defined in [HTML] and [SVG2] (refer to the section on Scripting [EPUB-33] for more information).
It is important to note, however, that EPUB 3 does not require scripting support in Reading Systems, and scripting might be disabled for security reasons.
EPUB Creators 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, as further described in the section on Container-Constrained Scripts [EPUB-33].
In other words, consider limiting scripting to cases where it is essential to the user experience, since it greatly increases the likelihood that content will not be portable across all Reading Systems and creates barriers to accessibility and content reusability.
EPUB 3 provides the following text-to-speech (TTS) facilities for controlling aspects of speech synthesis, such as pronunciation, prosody, and voice characteristics:
The inclusion of generic pronunciation lexicons using the W3C PLS format [PRONUNCIATION-LEXICON] enables EPUB Creators to provide pronunciation rules that apply to the entire EPUB Publication. Refer to Pronunciation Lexicons [EPUB-TTS-10] for more information.
The incorporation of SSML phonemes functionality [SSML] directly into a EPUB Content Document enables fine-grained pronunciation control, taking precedence over default pronunciation rules and/or referenced pronunciation lexicons (as provided by the PLS format mentioned above). Refer to SSML Attributes [EPUB-TTS-10] for more information.
Note that EPUB Creators may also rely on CSS Speech [CSS-SPEECH-1] properties in their style sheet definitions.
The authoring features for improving the voicing of EPUB 3 publication are described in the separate Working Group Note on Text-to-Speech Enhancements [EPUB-TTS-10].
An EPUB Publication is transported and interchanged as a single file (a "portable document") that contains the Package Documents, all Content Documents, and all other required resources for processing the Publication. The single-file container format for EPUB is based on the widely adopted ZIP format, and an XML document that identifies the location of the Package Document for the Publication in the ZIP archive is located at a pre-defined location within the archive.
This approach provides a clear contract between any creator of an EPUB Publication and any system which consumes such EPUB Publications, as well as a reliable representation that is independent of network transport or file system specifics.
An EPUB Publication's representation as a container file is specified in the dedicated section of [EPUB-33].
EPUB 3 supports alternate representations of all text metadata items in the package metadata section
to improve global distribution of EPUB Publications. The alternate-script
property [EPUB-33] can be combined with the xml:lang
attribute to include and
identify alternate script renderings of language-specific metadata.
Using this property, a Japanese EPUB Publication could, for example, include an alternate Roman-script representation of the author's name and/or one or more representations of the title in a Romance language.
Text metadata items may also rely on attributes specifying base direction [EPUB-33] that allow for a finer control of bidirectional texts (e.g., titles that combine Latin and Arabic or Hebrew characters).
Finally, the page-progression-direction
attribute allows the content flow direction to be
globally specified for all Content Documents to facilitate rendering (see the page-progression-direction [EPUB-33]).
XHTML Content Documents leverage the HTML directionality features to improve support for
bidirectional content rendering: the bdi
element allows an instance of directional text to be isolated from the surrounding content,
the bdo
element allows directionality to
be overridden for its child content and the dir
attribute allows the directionality of any element to be explicitly set.
XHTML Content Documents also support ruby annotations [HTML] for pronunciation support (which makes them supported in Navigation Document links, as well).
SVG Content Documents support the rendering of bidirectional text, but do not include support for ruby.
EPUB 3's support for CSS3 modules enables typography for many different languages and cultures. Some specific enhancements include:
support for vertical writing, which also provides Reading Systems the ability to allow users to toggle direction;
better handling of emphasis, such as the inclusion of bōten;
better control over line breaking, so that breaks can occur at the character level for languages that do not use spaces to delimit new words; and
better control over hyphenation, to further facilitate line breaking.
EPUB 3 does not require that Reading Systems come with a set of built-in system fonts. As occurs in Web contexts, users in a particular locale might have installed fonts that omit characters required for other locales and Reading Systems might utilize intrinsic fonts or font engines that do not utilize operating system installed fonts. As a result, the text content of an EPUB Publication might not natively render as intended on all Reading Systems.
To address this problem, EPUB 3 supports the embedding of fonts to facilitate the rendering of text content, and this practice is advised to ensure content is rendered as intended. See also § 2.8 Fonts in the Features section for more information.
Support for embedded fonts also ensures that characters and glyphs unique to an EPUB Publication can be embedded for proper display.
EPUB 3's support for PLS documents and SSML attributes increases the pronunciation control that EPUB Creators have over the rendering of any natural language in text-to-speech-enabled Reading Systems. Refer to § 2.10 Text-to-speech in the Features section for more information on these capabilities.
The combination of CSS Speech and inline SSML phonemes also allows fine control over ruby.
The OCF container format supports UTF-8, allowing for internationalized file and directory naming of content resources.
A major goal of EPUB is to facilitate content accessibility, and a variety of features in EPUB 3 support this requirement. This section reviews these features, detailing some established best practices for ensuring that EPUB Publications are accessible where applicable.
EPUB 3 also includes an Accessibility specification [EPUB-A11Y-11] that leverages the extensive work done to make Web content accessible in [WCAG21]. The specification defines requirements to produce EPUB Publications that can be accessed by a wide range of users. It is accompanied by a techniques document [EPUB-A11Y-TECH-11] that outlines best practices for meeting these requirements.
It is important to note that while accessibility is important in its own right, accessible content is also more valuable content: an accessible EPUB Publication will be adaptable to more devices and be easier to reuse, in whole or in part, via human and automated workflows. The EPUB Working Group strongly recommends that EPUB Creators ensure that they generate accessible content.
[HTML] supports a number of elements that make markup more semantically meaningful (e.g.,
section
, nav
,
and aside
). EPUB Creators are encouraged to
use these elements, in conjunction with best practices for authoring well-structured Web content,
when creating EPUB XHTML Content Documents. These additions allow content to be better grouped and
defined, both for representing the structure of documents and to facilitate their logical
navigation. XHTML Content Documents also natively support the inclusion of ARIA role and state
attributes and events, including the dedicated [DPUB-ARIA-1.0] roles, enhancing the ability of
Assistive Technologies to interact with the content.
EPUB 3 includes the epub:type
attribute,
which is meant to be functionally equivalent to the W3C Role Attribute [Role-Attribute]. This attribute allows any element in an XHTML Content
Document to include additional information about its purpose and meaning within the work, using
controlled vocabularies and terms. Refer to the section on Expressing Structural
Semantics [EPUB-33] for more information.
With the latest resolution of the WG making the structural vocabulary a note, one may wonder whether referring to epub:type should stay in the Overview document...
The design center of EPUB is dynamic layout: content is typically intended to be formatted on the fly rather than being typeset in a paginated manner in advance (i.e., expecting a particular sized "page"). This core capability is useful, for example, for optimizing rendering onto different sized device screens or window sizes, and it facilitates and simplifies content accessibility.
While it is possible to incorporate more highly formatted content in EPUB — for example via bitmap images or SVG graphics, or even use of CSS explicit positioning and/or table elements to achieve particular visual layouts — EPUB Creators are strongly discouraged from utilizing such techniques. They are not reliable in EPUB since many Reading Systems render content in a paginated manner rather than creating a single scrolling Viewport and since each Reading System might define its own pagination algorithm. If these techniques are necessary to convey the content of the publication, consider including fallbacks [EPUB-33] (e.g., for graphic novels).
In general, it is preferable to achieve visual richness by using CSS Style Sheets without absolute sizing or positioning.
If and when the WG publishes a fxl accessibility note then it is worth referring to it from here
Aural renderings of content are important for accessibility and are a desirable feature for many other users. A baseline to facilitate aural rendering is to utilize semantic HTML designed for dynamic layout. Refer to § 2.10 Text-to-speech for more information on how to use the native facilities that EPUB XHTML Documents include.
Media Overlays [EPUB-33] provide the ability to synchronize the text and audio content of an EPUB Publication. Overlays transcend the accessibility domain in their usefulness: the synchronization of text and audio as a tool for learning to read, for example, being of benefit in many circumstances.
Not all formats are accessible in their native format, and not all users prefer to read in the default format provided. EPUB defines a variety of means for providing fallbacks so that alternate renderings can be made available in these cases.
Publication- and content-level fallbacks are defined in the section on Foreign Resources [EPUB-33]. These fallback mechanisms enable the inclusion of Foreign Resources in an EPUB Publication and ensure compatibility of EPUB 3 content across Reading Systems with varying capabilities (e.g., they allow the inclusion of multiple video formats, and the inclusion of XHTML fallbacks to SVG Content Documents for EPUB 2 Reading Systems).
EPUB 3 adopts a progressive enhancement approach for scripted content, whereby scripting is not allowed to interfere with the integrity of the document (i.e., not result in information loss when scripting is not available). Consequently, although documents that do employ scripting can provide fallbacks [EPUB-33] to further facilitate access to their contents, the documents have to be accessible without them.
EPUB Creators should always implement best practices for accessible scripting in Web documents, such as provided in [WAI-ARIA], and reserve the use of scripting for situations in which interactivity is critical to the user experience.
EPUB has its roots in the interchange format known as the Open EBook Publication Structure (OEBPS). OEBPS 1.0 was approved in 1999 by the Open eBook Forum, an organization that later became the International Digital Publishing Forum (IDPF). Subsequent revisions 1.1 and 1.2 were approved by the IDPF in 2001 and 2002, respectively.
It was realized that a need existed for a format standard that could be used for delivery as well as interchange, and work began in late 2005 on a single-file container format for OEPBS, which was approved by the IDPF as the OEBPS Container Format (OCF) in 2006. Work on a 2.0 revision of OEBPS began in parallel which was approved as the renamed EPUB 2.0 in October 2007, consisting of a triumvirate of specifications: Open Package Format (OPF), Open Publication Format (OPF) together with OCF. EPUB 2.0.1, a maintenance update to the 2.0 specification set primarily intended clarify and correct errata in the specifications, was approved in September 2010. [OPF-201] [OPS-201] [OCF-201]
Work on a major revision of the EPUB specifications began in 2010, with the goal of aligning EPUB more closely with HTML, and in the process bringing new, native multimedia features, sophisticated CSS layout rendering and font embedding, scripted interactivity, enhanced global language support, and improved accessibility. A new specification, EPUB Media Overlays was also introduced, enabling text and audio synchronization in EPUB Publications. To better align the specification names with the standard, the Open Package Format specification was renamed EPUB Publications and the Open Publication Format specification was renamed EPUB Content Documents. The EPUB 3.0 specifications were approved in October 2011. [EPUBPublications-30] [EPUBContentDocs-30] [OCF-30] [EPUBMediaOverlays-30] [EPUBChanges-30]
The EPUB 3.0.1 revision was undertaken in 2013-14. Although introducing mostly minor fixes and updates, it did see the integration of Fixed Layout Documents, which give EPUB Creators greater control over presentation when a reflowable EPUB is not suitable for the content. [EPUBPublications-301] [EPUBContentDocs-301] [OCF-301] [EPUBMediaOverlays-301] [EPUBChanges-301]
EPUB 3.1 was the first minor revision of EPUB 3. The goal of this revision was to better align EPUB 3 with current Web standards. References to important standards were made undated, meaning that whenever they are updated they are legal to use in EPUB 3 content (e.g., the latest version of HTML is always valid to use; a revision of EPUB is not needed). The use of CSS was also clarified, and the use of EPUB-specific properties reduced.
Many EPUB-specific features were also removed from the standard, in particular content switching, triggers, and bindings. This change necessitated a new Package Document version number.[EPUB-31] [EPUBPackages-31] [EPUBContentDocs-31] [OCF-31] [EPUBMediaOverlays-31] [EPUBChanges-31]
The work on EPUB 3.2 was undertaken shortly after EPUB 3.1 to restore compatibility of content to EPUB 3. The change of version number introduced in EPUB 3.1 meant that EPUB Creators, vendors and reading system developers would have to produce, distribute and consume two versions of EPUB content, but the costs of this change outweighed the benefits of the new version. EPUB 3.2 instead keeps all the best parts of EPUB 3.1 but returns and deprecates the removed elements so that a new version number is not necessary in the Package Document. [EPUB-32] [EPUBPackages-32] [EPUBContentDocs-32] [OCF-32] [EPUBMediaOverlays-32] [EPUBChanges-32]
The work on EPUB 3.3 [EPUB-33] was undertaken in 2020-21, and is the first version of the EPUB 3 series published as a W3C Recommendation. EPUB 3.3 does not include any significant technical change to, and is strongly backward compatible with, EPUB 3.2. This means that any valid EPUB 3.2 Publication is also a valid EPUB 3.3 Publication.
The documents themselves have been restructured. The primary motivation for this restructuring, as well as an extensive editorial revision, was to make the documents more readable. Also, as part of the thorough testing regime developed by the W3C EPUB 3 Working Group, this restructuring led to the separation of Recommendations and Working Group Notes (see also the detailed list of documents ). Features specified in the Recommendations are thoroughly tested, are widely implemented in Reading Systems, and they can be considered as interoperable. On the other hand, features specified in Working Group Notes, although they may have some authoring uptakes, still lack support in Reading Systems; as a result, these technologies should not yet be considered stable and interoperable.
The separate section in [EPUB-33] provides a more detailed overview of the changes.