The EXTH block holds a book’s metadata: author, publisher, ISBN, cover, Amazon’s
identifiers and reading options. It follows the
MOBI header in record 0, starting
at 16 + headerLength, and is there only when bit 6 (0x40) of the
header’s exthFlags is set. It is a list of typed records, so a reader can
skip any type it does not know. All numbers are big-endian.
EXTH header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 4 | char[4] | identifier | Always EXTH. |
4 | 4 | UInt32 | headerLength | The length of the EXTH block from identifier to the end of the last record, not counting the padding after it. |
8 | 4 | UInt32 | recordCount | The number of records that follow. |
12 | … | records | recordCount records, one after another. | |
| … | 0–3 | bytes | padding | Zero bytes up to a multiple of 4. |
EXTH record
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 4 | UInt32 | type | What the record holds: see record types. |
4 | 4 | UInt32 | length | The record’s whole length, including these 8 bytes. |
8 | length − 8 | bytes | data | The value. Text is in the MOBI header’s textEncoding with no terminator; numbers are big-endian, usually 4 bytes. |
A type may appear more than once: several authors give several records of type 100, several subjects several of type 105.
Record types
The names are those used by the MobileRead Wiki and KindleUnpack; the OPF column gives the element of the source package the value came from when the book was built. “Unknown” means that the type has been seen in files but its meaning is not public.
DRM (1–4)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 1 | DRM server ID | text | Identifies the DRM server. |
| 2 | DRM commerce ID | text | Identifies the sale. |
| 3 | DRM ebookbase book ID | text | The book in the DRM system. |
| 4 | DRM ebookbase dep ID | text | Unknown; related to the DRM system. |
Publication (100–112)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 100 | author | text | An author; one record each. OPF dc:creator. |
| 101 | publisher | text | OPF dc:publisher. |
| 102 | imprint | text | The publisher’s imprint. |
| 103 | description | text | The blurb, often HTML. OPF dc:description. |
| 104 | ISBN | text | OPF dc:identifier with the ISBN scheme. |
| 105 | subject | text | A subject or keyword; may repeat. OPF dc:subject. |
| 106 | publishing date | text | OPF dc:date, usually as ISO 8601. |
| 107 | review | text | A review. |
| 108 | contributor | text | OPF dc:contributor; calibre writes its own name and version here. |
| 109 | rights | text | OPF dc:rights. |
| 110 | subject code | text | OPF dc:subject given as a BISAC code. |
| 111 | type | text | OPF dc:type. |
| 112 | source | text | OPF dc:source; calibre stores its book ID here. |
Kindle store and layout (113–132, 150)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 113 | ASIN | text | Amazon’s identifier for the book. Without it, some Kindles list the book as a personal document. |
| 114 | version number | UInt32 | A version number; meaning unknown. |
| 115 | sample | UInt32 | 1: the book is a sample. |
| 116 | start reading | UInt32 | The position in the uncompressed text where the book opens the first time. |
| 117 | adult | text | yes when the book is marked adult. |
| 118 | retail price | text | The suggested price, for example 4.99. |
| 119 | retail price currency | text | The currency of 118, for example USD. |
| 120 | TSC | text | Unknown. |
| 121 | KF8 boundary offset | UInt32 | In a joint file, the record number of the KF8 part’s record 0: see AZW3. |
| 122 | fixed layout | text | true for a fixed-layout book. |
| 123 | book type | text | For example comic. |
| 124 | orientation lock | text | none, portrait or landscape. |
| 125 | resource count | UInt32 | The number of resource records (images, fonts and the like) in the KF8 part. |
| 126 | original resolution | text | The size the pages were designed for, for example 1072x1448. |
| 127 | zero gutter | text | true: no gutter between facing pages. |
| 128 | zero margin | text | true: no page margins. |
| 129 | metadata resource URI | text | Points at a resource holding more metadata; details unknown. |
| 130 | offline sample | UInt32 | Unknown. |
| 131 | metadata record offset | UInt32 | Unknown. |
| 132 | region magnification | text | true: panels or regions of a fixed-layout page can be magnified. |
| 150 | lending enabled | text | Whether the book may be lent. |
Dictionary, cover and creator (200–209, 300)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 200 | dictionary short name | text | A short name for a dictionary. |
| 201 | cover offset | UInt32 | The cover image is record firstImageRecord + this value. |
| 202 | thumbnail offset | UInt32 | The thumbnail image is record firstImageRecord + this value. |
| 203 | has fake cover | UInt32 | Non-zero when the cover was generated rather than supplied. |
| 204 | creator software | UInt32 | The program that built the file: 1 mobigen, 2 Mobipocket Creator, 200 KindleGen for Windows, 201 KindleGen for Linux, 202 KindleGen for Mac. Other tools often copy these values. |
| 205 | creator major version | UInt32 | That program’s major version. |
| 206 | creator minor version | UInt32 | Its minor version. |
| 207 | creator build number | UInt32 | Its build number. |
| 208 | watermark | bytes | A watermark; contents unknown. |
| 209 | tamper-proof keys | bytes | Used by Kindles and the Android app to derive book-specific DRM keys. |
| 300 | font signature | bytes | Unknown; related to fonts. |
Usage limits and lending (401–453)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 401 | clipping limit | UInt8 | The percentage of the text that may be copied as clippings, usually 10. |
| 402 | publisher limit | UInt32 | Unknown. |
| 403 | unknown | bytes | Unknown. |
| 404 | text-to-speech disabled | UInt8 | 1: text-to-speech is not allowed; 0: allowed. |
| 405 | ownership type | UInt8 | 1 for a rented or borrowed book. |
| 406 | rental expiration | 8 bytes | When a rented or borrowed book expires; format not documented. |
| 407 | unknown | 8 bytes | Unknown. |
| 420 | multimedia content reference | bytes | Unknown. |
| 450 | locations match | UInt32 | Unknown; Kindle locations. |
| 451 | full story length | UInt32 | Unknown; seen in samples. |
| 452 | sample start location | UInt32 | Unknown; seen in samples. |
| 453 | sample end location | UInt32 | Unknown; seen in samples. |
Kindle document data (501–547)
| Type | Name | Data | Meaning |
|---|---|---|---|
| 501 | CDE type | text, 4 bytes | How a Kindle files the book: EBOK a book, EBSP a sample, PDOC a personal document. |
| 502 | last update time | text | When the book was last updated. |
| 503 | updated title | text | The title; readers prefer it to the full title in record 0. |
| 504 | CDE content key | text | Usually a copy of the ASIN. |
| 505 | Amazon content reference | text | Unknown. |
| 506 | title language | text | The language of the title. |
| 507 | title display direction | text | Writing direction of the title. |
| 508 | title pronunciation | text | How to say the title, for example in kana for Japanese. |
| 509 | title collation | text | The title as it should be sorted. |
| 510 | secondary title | text | A subtitle. |
| 511 | secondary title language | text | Its language. |
| 512 | secondary title direction | text | Its writing direction. |
| 513 | secondary title pronunciation | text | How to say it. |
| 514 | secondary title collation | text | How to sort it. |
| 515 | author language | text | The language of the author’s name. |
| 516 | author display direction | text | Its writing direction. |
| 517 | author pronunciation | text | How to say it. |
| 518 | author collation | text | How to sort it, for example “Wells, H. G.”. |
| 519 | author type | text | Unknown. |
| 520 | publisher language | text | The language of the publisher’s name. |
| 521 | publisher display direction | text | Its writing direction. |
| 522 | publisher pronunciation | text | How to say it. |
| 523 | publisher collation | text | How to sort it. |
| 524 | language | text | The book’s language as a language tag, such as en or en-GB. OPF dc:language. |
| 525 | primary writing mode | text | For example horizontal-lr, horizontal-rl or vertical-rl. |
| 526 | NCX ingested by software | text | Unknown. |
| 527 | page progression direction | text | ltr or rtl, as in the OPF spine. |
| 528 | override Kindle fonts | text | true: the book’s own fonts are used. |
| 529 | compression upgraded | text | Unknown. |
| 530 | soft hyphens in content | text | Unknown. |
| 531 | dictionary input language | text | For a dictionary, the headword language as a tag. |
| 532 | dictionary output language | text | The definition language as a tag. |
| 533 | font converted | text | Unknown. |
| 534 | Amazon creator info | text | Unknown. |
| 535 | creator build tag | text | The build of the tool that made the file, for example a KindleGen 2.7 build string. |
| 536 | HD media containers info | text | Describes the high-resolution image container that can go with the book. |
| 538 | resource container fidelity | text | Unknown. |
| 539 | HD container MIME type | text | Unknown. |
| 540 | sample for special purpose | text | Unknown. |
| 541 | Kindletool operation information | text | Unknown. |
| 542 | container ID | UInt32 | Appears to be a Unix time. |
| 543 | asset type | text | Unknown. |
| 544 | unknown | text | Unknown. |
| 547 | in memory | text | Seen in files from KindleGen 2.9; meaning unknown. |
Types 121 to 132 and 500 onwards came with Kindle Format 8, but KindleGen also writes many of them into the version 6 part of a joint file.
Example
An EXTH block with three records: the author, the language and the cover offset. The block is 53 bytes long, so three zero bytes of padding follow it.
00000000 45 58 54 48 00 00 00 35 00 00 00 03 00 00 00 64 EXTH...5.......d
00000010 00 00 00 13 48 2E 20 47 2E 20 57 65 6C 6C 73 00 ....H. G. Wells.
00000020 00 02 0C 00 00 00 0A 65 6E 00 00 00 C9 00 00 00 .......en.......
00000030 0C 00 00 00 00 00 00 00 ........
| Bytes | Meaning |
|---|---|
45 58 54 48 | EXTH |
00 00 00 35 | headerLength 53 |
00 00 00 03 | 3 records |
00 00 00 64 00 00 00 13 48 2E 20 47 2E 20 57 65 6C 6C 73 | type 100, length 19: author “H. G. Wells” (8 + 11 bytes) |
00 00 02 0C 00 00 00 0A 65 6E | type 524, length 10: language en |
00 00 00 C9 00 00 00 0C 00 00 00 00 | type 201, length 12: cover offset 0, so the cover is the first image |
00 00 00 | padding to 56 bytes, not counted in headerLength |