EPUB Annotations 1.0

W3C First Public Working Draft

More details about this document
This version:
https://www.w3.org/TR/2026/WD-epub-anno-10-20260224/
Latest published version:
https://www.w3.org/TR/epub-anno-10/
Latest editor's draft:
https://w3c.github.io/epub-specs/epub34/annotations/
History:
https://www.w3.org/standards/history/epub-anno-10/
Commit history
Editors:
Laurent Le Meur (EDRLab)
Ivan Herman (W3C)
Feedback:
GitHub w3c/epub-specs (pull requests, new issue, open issues)
public-pm-wg@w3.org with subject line [epub-anno-10] … message topic … (archives)

Abstract

This document defines a profile of the Web Annotation Data Model [annotation-model] by specifying a subset of the terms, and adding terms deemed useful to satisfy the entries in the EPUB Annotations Use Cases and Requirements [epub-anno-ucr] document.

Status of This Document

This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C standards and drafts index.

This document was published by the Publishing Maintenance Working Group as a First Public Working Draft using the Recommendation track.

Publication as a First Public Working Draft does not imply endorsement by W3C and its Members.

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 a work in progress.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent that the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 18 August 2025 W3C Process Document.

1. Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key words MAY, MUST, MUST NOT, OPTIONAL, RECOMMENDED, and SHOULD in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

2. Introduction

This section is non-normative.

This section defines a profile of the Web Annotation Data Model [annotation-model], as used for EPUB Annotations.

In the Web Annotation model, the core structure is the Annotation object, which contains properties defining the annotation's Body and Target. EPUB Annotations reuse the same model with some restrictions specified in this document. Subsequent sections provide more formal definitions for the terms used by this specification.

Note

This document does not define how annotations are created, stored, or synchronized in a reading system.

2.1 Relationship to URL

To be consistent with EPUB 3.4, this specification refers to the [url] standard for terminology and processing related to URLs expressed in EPUB publications and in Annotations Objects. The additional constraints expressed in EPUB 3.4 also apply. Note that this is a difference with the Web Annotation Data Model which uses the term IRI [rfc3987]. This difference does not alter the structure of the Data Model used by this specification.

3. Annotation

3.1 Annotation Object

The Annotation object retains the following annotation properties from the Web Annotation object [annotation-model]:

Name Description Format Required?
id The identity of the annotation. A uuid formatted as a URN is RECOMMENDED. URL Yes
type The RDF structure type. It MUST be "Annotation". string Yes
motivation The motivation for the annotation's creation. "bookmarking" | "commenting" | "highlighting" No
created The time when the annotation was created. ISO 8601 datetime Yes
modified The time the annotation was modified after creation. ISO 8601 datetime No
creator The creator of the annotation. This may be a human, an organization or a software agent.
Creator object No
target The target content of the annotation. Target object Yes
body The annotation body. Body object No
Note

The [annotation-model] specification is fairly open ended as for the value of, for example, the body property. This specification restricts the value by defining specific classes that must be used, see the definitions for Creator, Target, and Body below.

Note

The type of annotation should be considered when determining the value of the motivation property. An annotation with a Body structure corresponds to a "comment". An annotation without Body structure corresponds to a "highlight" if its Selector defines a range of characters, a space in an image or a time period, and a "bookmark" if it does not.

Editor's note

We should specify whether a property may appear at most once (body, target) because that is also part of the profile definition. This can be a separate column ("cardinality") or be added to the description. This remark may be valid for all the tables in the document.

Issue 2926: Annotations: adding a "replying" motivation? Spec-Annotations

Should we add a "replying" motivation for annotations that are replies to other annotations?

Issue 2884: Target is not necessarily a specific segment, but we say it is Spec-Annotations

Section

No response

Describe the problem

In the section titled "Subset of the Web Annotation Data Model" we say:

The Target of an EPUB Annotation is the content being annotated, which is a specific segment in a document within the EPUB package defined by its relative Source URL and a Selector.

However, we do not require the target to be a specific segment in a document, unless we are including the entire document with no range specified as a "segment in" that document. I am actually not sure why we need to define target here at all? There are a lot of nuances (for instance, I am not sure from this definition if selector is required), and this is just a list of changes from web annotations, which is really only interesting to people that know what is in web annotations, and hence are likely aware of how target is used.

Describe the fix or new feature you propose

I propose deleting the second sentence of this bullet point.

3.2 Creator

The Creator object of an annotation is a person, an organization or a software agent.

This document defines the following creator properties:

Name Description Format Required?
id The identity of the creator. URL Yes
type Type of the creator. It MUST be "Person", "Organization" or "Software". string Yes
name The name of the creator. string No

3.3 Target

The Target object of an annotation associates the annotation with a specific segment of a resource in the current publication.

This document defines three target sub-properties:

Name Description Format Required?
source The identity of the target EPUB resource. URL Yes
selector The segment of the target EPUB resource that is annotated. Array of Selector objects No
meta Indications that help locate the segment in the resource. Meta No

A Target with no Selector indicates that the annotation applies to the entire target resource.

3.3.1 Source

The target resource MUST be identified by the URL of an existing resource in the EPUB package. It MUST be one of the item/@href values of the manifest element as defined in [epub-34].

3.3.2 Selector

An annotation refers to a segment of a resource, which is identified by one or more Selectors. The nature of the Selectors and methods to describe segments depend on the resource type. Providing more than one Selector allows an annotation software to choose the most accurate selector from those it can handle and helps to accommodate evolutions on the annotated resource.

Several annotation selectors are specified in the Web Annotation Data Model. This specification retains selectors (with possible restrictions) deemed useful for annotating EPUB publications, and details on how to use these selectors.

3.3.2.1 Fragment Selector

The Fragment Selector object uses the fragment part of an URL defined by the representation's media type. This object is identical in structure to the Fragment Selector defined by Web Annotation Data Model, except that it restricts the media types it may use.

Name Description Format Required?
type The RDF structure type. It MUST be "FragmentSelector". string Yes
value The contents of the fragment component of an URL that describes the selection. The selector MUST have exactly 1 value property. string Yes
conformsTo Provides the reference to the specification that defines the syntax of the URL fragment in the value property. The selector SHOULD have exactly 1 conformsTo link to the specification that defines the syntax of the fragment and MUST NOT have more than 1. One of the URL strings listed in the table below. No

The following URLs are the specifications that define the semantics of fragments, and hence may be used with the conformsTo property. Other URLs MUST NOT be used.

Name Fragment Specification Description
HTML http://tools.ietf.org/rfc/rfc3236 [rfc3236]. Example: namedSection
Media http://www.w3.org/TR/media-frags/ [media-frags]. Example: xywh=50,50,640,480 or t=10,20
SVG http://www.w3.org/TR/SVG/ [svg11]. Example: svgView(viewBox(50,50,640,480))
Text fragment https://wicg.github.io/scroll-to-text-fragment/ [scroll-to-text-fragment]. Example: :~:text=an%20example,text%20fragment
Caution

This selector, used with text fragments, must be used with great care when the number of characters that can be copied from the publication is constrained by the publisher.

Note

The integration of text fragments into the specification is AT RISK. The reason is two-fold:

  1. The specification is currently a Draft Community Group Report. While there is an activity to include it into the HTML Standard [html], this is still ongoing. It may not be finalized by the time this specification goes to Recommendation. See also whatwg#11895.
  2. The integration of text fragments selector in reading systems is very challenging: the absence of a standard API in web browsers makes mapping a text fragment to a DOM Range difficult. Rebuilding a DOM range from a textual range using tree walking is suboptimal, and the existing polyfills are not well-maintained. This fragment specification cannot be retained unless a public API is defined and implemented in major web browsers. See also whatwg#8282
3.3.2.2 CSS Selector

This section is non-normative.

One of the most common ways to select elements in the HTML Document Object Model is to use CSS Selectors [CSS3-selectors]. This specification reuses the CssSelector, as defined in the Web Annotation Data Model specification, but lists it here for an easier readability.

Name Description Format Required?
type The RDF structure type. It must be "CssSelector". string Yes
value The CSS selection path to the target. The selector must have exactly 1 value property. string Yes
3.3.2.3 Text Position Selector

This section is non-normative.

This Selector describes a range of text by recording the start and end positions of the selection in the stream. Position 0 would be immediately before the first character, position 1 would be immediately before the second character, and so on. This specification reuses the TextPositionSelector, as defined in the Web Annotation Data Model specification, but lists it here for an easier readability.

Name Description Format Required?
type The RDF structure type. It must be TextPositionSelector. string Yes
start The starting position of the segment of text. The first character in the full text is character position 0, and the character is included within the segment. Each TextPositionSelector must have exactly 1 start property, and the value must be a non-negative integer. non-negative integer Yes
end The end position of the segment of text. The character is not included within the segment. Each TextPositionSelector must have exactly 1 end property, and the value must be a non-negative integer. non-negative integer Yes

The text must be selected and normalized in the same way as for the Text Quote Selector before counting the number of characters to determine the start and end positions.

Issue 2927: Annotations: the details of the text position selectors may be underspecified Spec-Annotations

See: https://w3c.github.io/epub-specs/epub34/annotations/#text-position-selector

This is an "inherited" class, but seems to be underspecified on how to get to the right position. Some text may have to be added specifying that:

  • if the selector is part of a refinement, it should use the innerText of the previously selected HTML fragment; otherwise
  • it should use the innerText of the <body>
3.3.2.4 Refinement of Selection

It may be easier, more reliable, or more accurate to specify the segment of interest of a resource as a selection of a selection, rather than as a selection of the complete resource. This is accomplished by having selectors chained together, where each refines the results of the previous one.

The Web Annotation Data Model specification defines the refinedBy property. This specification restricts the possible values of the property to include only those selectors that are specified by, or listed in this specification.

Name Description Format Required?
refinedBy The relationship between a broader selector and the more specific selector that SHOULD be applied to the results of the first. A Selector MAY be refined by 1 or more other Selectors. If more than 1 is given, then they are considered to be alternatives that will result in the same selection. "FragmentSelector" |
"CssSelector" |
"TextPositionSelector"
No

This selects "q" from "quick" as start position and "x" from "fox" as end position in the following HTML snippet:

<div id="intro">
    <p>Some text.</p>
    <p>The quick <em>brown</em> fox jumps over the lazy dog.</p>
    <p>The lazy <em>white</em> dog sleeps with the crazy fox.</p>
</div>

3.3.3 Meta

The Meta object… T.B.D.

Issue 2852: Define the Meta object Spec-Annotations

The Meta object (ie, class) is currently undefined...

3.4 Body

The Body object of an annotation contains plain text, style, and optional tags.

This document specifies the following sub-properties:

Name Description Format Required?
type The body type. It MUST be “TextualBody”. string Yes
value The textual content of the annotation. string Yes
format The media-type of the annotation value; "text/plain" by default; "text/markdown" is recommended. [RFC6838], [RFC7763] No
color The color of the annotation; yellow by default. "pink" | "orange" | "yellow" | "green" | "blue" | "purple" No
highlight The style of the annotation; solid background by default. "solid" | "underline" | "strikethrough" | "outline" No
language The language of the annotation. [BCP47] No
textDirection The direction of the text; left-to-right by default. "ltr" | "rtl" No
tags Free text categorizing the annotation. Array of string No
Note

Read “Best practices for Reading Systems” about using tags in an annotation.

Issue 2854: Use the JSON-LD keywords for international texts Spec-Annotations

Section

https://w3c.github.io/epub-specs/epub34/annotations/#body

Describe the problem

The Body object uses the language and textDirection terms for international texts. This is inherited from the Web Annotation spec, which was created when text directionality was not properly handled in JSON-LD. However, JSON-LD now has the @language and @direction keywords that properly covers this, see String Internationalization.

Describe the fix or new feature you propose

I would propose to rely on the JSON-LD spec, possibly aliasing the language and direction terms to the keywords.

4. Annotation Set

An Annotation Set is an unordered collection of annotations.

An Annotation does not contain information about its associated publication. If a set of annotations is shared as a detached file, it is mandatory to also export information that will help find the associated publication even if the publication is not adequately identified.

Note

The AnnotationCollection defined in the Web Annotation Data Model does not provide an adequate structure for sharing annotations either as a detached file or as a file embedded in a Zip package. The AnnotationCollection provides a way to retrieve annotations via a REST API and is, therefore, intrinsically paginated.

The AnnotationSet contains:

Name Description Format Required?
id The identity of the annotation set. A uuid formatted as a URN is RECOMMENDED. URL Yes
type It MUST be AnnotationSet. string Yes
generator The agent responsible for the generation of the object serialization. Generator No
about Information relative to the publication. About Yes
generated The time when the set was generated. ISO 8601 datetime No
title A title to help identifying the set. string No
items The annotations of the set. Array of Annotation objects Yes
Issue 2929: Different terms for the same notion? Spec-Annotations

There two terms, namely name and title that appear in our annotation spec meaning, more or less, the same thing: giving a human readable identification of some sort to a resource. We have

4.1 Generator

The Generator object contains information relative to the software from which the serialized annotation has been produced.

Name Description Format Required?
id The identity of the generator software. The recommended value is the GitHub URL of the application source code. URL Yes
type The RDF type. It MUST be "Software". string Yes
name The name of the generator software. string Yes
homepage The home page presenting the generator software. URL No

4.2 About

The About object contains information relative to the publication. Such metadata is intended to help associate an annotation set with a publication:

Name Description Format Required?
dc:identifier Publication identifiers. An ISBN is preferred. Array of strings No
dc:title The title of the publication. string No
dc:format The media type of the publication. string No
dc:publisher The name of the publisher. string No
dc:creator The author(s) of the publication. array of strings No
dc:date The release year. calendar year using four digits No
Note

All properties are from the Dublin Core Vocabulary [dcterms], also referenced in the Web Annotation Data Model as well as in the EPUB package document metadata.

5. Serialization

Following the Web Annotation Data Model [annotation-model] specification, EPUB Annotations are expressed as a "shape" of JSON-LD [json-ld11] (a variant of JSON [ecma-404] for linked data). The shape is informally defined through a JSON Schema [json-schema]; see 7. JSON Schema for further details. The media type of this format is application/ld+json;profile="http://www.w3.org/ns/anno.jsonld"

This specification introduces a dedicated file extension for serialized AnnotationSets: .annotation.

Following the requirements of JSON-LD, each annotation file (whether a single annotation or an annotation set) MUST start with a context declaration referring to the following, EPUB Annotation specific context: https://www.w3.org/ns/epub-anno.jsonld. This context file imports (using the imported contexts feature of JSON-LD) the "core" context file of the Web Annotation Data Model [annotation-model], i.e., https://www.w3.org/ns/anno.jsonld. The EPUB Annotation specific context file contains terms extending, an sometimes overriding the terms in the core annotation context file, as defined in this specification.

Note

Implementations that do not rely on the linked data aspects of annotations may rely on bespoke processing based on the shape of the annotation or the annotation set. Such implementations may safely ignore the context declarations and are not required to dereference the respective URLs.

6. Embedding annotations in EPUB

The OPTIONAL my.annotation file in the META-INF directory holds an AnnotationSet.

6.1 Best Practices for Reading Systems

This section is non-normative.

Editor's note

This section being informative, the MUST, SHOULD, etc, keyword are not appropriate here. At the minimum, they should be turned into lower case.

6.1.1 Displaying filtered annotations

Reading systems should enable filtering by motivation, color, highlight mode, tag and creator. For instance, a user can display "blue" annotations only or “teacher” annotations only. Filtering on multiple criteria is a plus.

6.1.2 Using multiple selectors

It is recommended that Reading Systems export multiple selectors, including at least one precise selector (e.g. CssSelector + TextPositionSelector), and one selector resistant to content modifications (e.g., based on text fragments).

When displaying an annotation, a Reading System is free to use the most precise Selector available. It will select an alternative Selector as a fallback in case the preferred one does not return a correct position in the publication: this can happen if the publication has been modified after the annotation has been created.

Not all selectors are equally easy to implement. Reading Systems MAY choose to support only a subset of the selectors defined in this specification.

The W3C Publishing Maintenance Working Group is expected to define one or more selectors reading systems are required to implement, as a lingua franca.

6.1.3 Exporting annotations as a detached file

When a user decides to export an annotation set from a reading system, they SHOULD be proposed to filter the annotations by tags (multiple choice). “Annotations with no tag” and “All annotations” SHOULD be proposed as options. The advantage of this practice is that, for instance, a user can export personal annotations (usually with no tag) and leave “teacher” annotations unexported.

They MAY enter a title for the annotation set (empty by default). Such a title SHOULD become the exported filename.

They MUST be able to choose the directory in which the annotation set will be stored.

The file extension MUST be .annotation .

The application may propose alternative formats at export time: an HTML or markdown format with human-friendly references to the location of each annotation may be handy.

6.1.4 Exporting annotations in a publication

When a user decides to export a publication from the Reading System, they SHOULD be prompted to embed the annotations associated with the publication.

If the user decides to embed annotations in a publication, they SHOULD be prompted to filter the annotations by tags (multiple choice).

6.1.5 Importing annotations

To simplify associating annotations with a publication, a Reading System MUST offer a way to select a publication before selecting an annotation set. The drag and drop of an annotation set into a Reading System MAY also be proposed, but identifying the proper publication from the metadata in the annotation set is more complicated.

When importing an annotation set, a Reading System SHOULD display a message with the title of the annotation set and the number of annotations in the set. The Reading System MUST offer the user the choice to abort the import.

Each annotation is uniquely identified. If during the import of an annotation set, one or more annotations are re-imported, the Reading System MUST offer to the user the choice to override existing annotations or abort the import of the annotation set.

6.1.6 Dealing with colors

This document specifies a closed set of six colors chosen because of their extensive support in well-known reading systems. However, most existing reading apps offer a smaller set to their users.

If an application imports annotations with a color it does not support, it should display them with a neutral color. The recommended neutral color is grey.

Some applications may support colors not in the set defined by this specification (e.g. brown). In this case, a 1-to-1 substitution at export time is required (e.g. brown to orange).

Note

We didn't spot applications with more than six annotation colors.

7. JSON Schema

T.B.D.

8. Privacy Considerations

T.B.D.

9. Security Considerations

T.B.D.

A. Index

A.1 Terms defined by this specification

A.2 Terms defined by reference

B. Issue summary

C. References

C.1 Normative references

[annotation-model]
Web Annotation Data Model. Robert Sanderson; Paolo Ciccarese; Benjamin Young. W3C. 23 February 2017. W3C Recommendation. URL: https://www.w3.org/TR/annotation-model/
[BCP47]
Tags for Identifying Languages. A. Phillips, Ed.; M. Davis, Ed. IETF. September 2009. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc5646
[ecma-404]
The JSON Data Interchange Format, 2nd edition. Ecma International. 1 December 2017. Standard. URL: https://www.ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf
[epub-34]
EPUB 3.4. Matt Garrish; Ivan Herman. W3C. 12 February 2026. W3C Working Draft. URL: https://www.w3.org/TR/epub-34/
[json-ld11]
JSON-LD 1.1. Gregg Kellogg; Pierre-Antoine Champin; Dave Longley. W3C. 16 July 2020. W3C Recommendation. URL: https://www.w3.org/TR/json-ld11/
[json-schema]
JSON Schema: A Media Type for Describing JSON Documents. Austin Wright; Henry Andrews; Ben Hutton; Greg Dennis. Internet Engineering Task Force (IETF). 10 June 2022. Internet-Draft. URL: https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema
[media-frags]
Media Fragments URI 1.0 (basic). Raphaël Troncy; Erik Mannens; Silvia Pfeiffer; Davy Van Deursen. W3C. 25 September 2012. W3C Recommendation. URL: https://www.w3.org/TR/media-frags/
[RFC2119]
Key words for use in RFCs to Indicate Requirement Levels. S. Bradner. IETF. March 1997. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc2119
[rfc3236]
The 'application/xhtml+xml' Media Type. M. Baker; P. Stark. IETF. January 2002. Informational. URL: https://www.rfc-editor.org/rfc/rfc3236
[RFC6838]
Media Type Specifications and Registration Procedures. N. Freed; J. Klensin; T. Hansen. IETF. January 2013. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc6838
[RFC7763]
The text/markdown Media Type. S. Leonard. IETF. March 2016. Informational. URL: https://www.rfc-editor.org/rfc/rfc7763
[RFC8174]
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words. B. Leiba. IETF. May 2017. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc8174
[scroll-to-text-fragment]
URL Fragment Text Directives. Nick Burris; David Bokan. W3C. URL: https://wicg.github.io/scroll-to-text-fragment/
[svg11]
Scalable Vector Graphics (SVG) 1.1 (Second Edition). Erik Dahlström; Patrick Dengler; Anthony Grasso; Chris Lilley; Cameron McCormack; Doug Schepers; Jonathan Watt; Jon Ferraiolo; Jun Fujisawa; Dean Jackson et al. W3C. 16 August 2011. W3C Recommendation. URL: https://www.w3.org/TR/SVG11/

C.2 Informative references

[CSS3-selectors]
Selectors Level 3. Tantek Çelik; Elika Etemad; Daniel Glazman; Ian Hickson; Peter Linss; John Williams. W3C. 6 November 2018. W3C Recommendation. URL: https://www.w3.org/TR/selectors-3/
[dcterms]
DCMI Metadata Terms. DCMI Usage Board. DCMI. 20 January 2020. DCMI Recommendation. URL: https://www.dublincore.org/specifications/dublin-core/dcmi-terms/
[epub-anno-ucr]
EPUB Annotations Use Cases and Requirements. Laurent Le Meur. W3C. 24 February 2026. URL: https://www.w3.org/TR/epub-anno-ucr/
[html]
HTML Standard. Anne van Kesteren; Domenic Denicola; Dominic Farolino; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[rfc3987]
Internationalized Resource Identifiers (IRIs). M. Duerst; M. Suignard. IETF. January 2005. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc3987
[url]
URL Standard. Anne van Kesteren. WHATWG. Living Standard. URL: https://url.spec.whatwg.org/