MOBI File Documentation
Summary
A Mobipocket eBook is a reflowable e-book stored in the .mobi format, a Palm Database container that holds the book text as compressed HTML. Its MIME type is application/x-mobipocket-ebook. To read one, open it free in Calibre, which also displays the metadata and cover. MOBI is retired, so convert it to EPUB for current readers and phones.
Technical details
| Full name | Mobipocket eBook |
|---|---|
| File extension | .mobi |
| MIME type | application/x-mobipocket-ebook |
| Format type | Palm Database (PDB)-based e-book container wrapping PalmDOC-compressed HTML; may carry DRM |
| Category | eBook files |
| Developer | Mobipocket SA; acquired by Amazon 2005; retired |
| Introduced | 2000; dropped from Send to Kindle 2022 |
| Container / base format | Palm Database, PDB |
| Byte order | Big-endian |
| Magic number | hex 42 4F 4F 4B 4D 4F 42 49 “BOOKMOBI” at offset 60 |
| Compression | PalmDOC / no compression; HUFF/CDIC in some |
| DRM | Optional, Amazon account-locked |
| Open standard | No |
| Related extensions | .azw .azw3 .prc .epub .pdb .kfx |
| Specification | MobileRead Wiki — MOBI |
What is a MOBI file?
MOBI is the e-book format created in 2000 by the French company Mobipocket SA. A .mobi file stores a whole book as a single package: the text, its formatting, the cover image, any inline pictures, and the metadata that names the author and title. The text itself is HTML, compressed and split into fixed-size chunks so a reader can page through it and reflow it to any screen width.
The format never used a bespoke container. Instead it reused the Palm Database (PDB) file that ran on Palm OS handhelds, which is why a MOBI and a plain Palm database share the same on-disk skeleton. That decision shaped everything about how a MOBI is laid out, and it is the reason the format outlived the hardware it was born on. When Amazon bought Mobipocket in 2005, it built the first Kindle format on top of MOBI, so an early Kindle book is a MOBI with Amazon’s wrapper around it.
The Palm Database (PDB) container: name, type and creator
Every MOBI begins with a 78-byte PDB header. The first field is a 32-byte database name, written in ASCII and padded with zero bytes when the name is shorter. This name is usually a truncated form of the book title, sometimes with a fragment of the author’s name. Because it varies from book to book, it gives you no reliable signature at the start of the file.
The reliable marker sits further in. At offset 60 (0x3C) the PDB header carries a 4-byte type field and, at offset 64, a 4-byte creator field. For a Mobipocket book these are “BOOK” and “MOBI”, which read as the eight ASCII bytes “BOOKMOBI” when placed side by side. Tools test those eight bytes to recognise the format.
Offset Size Field
0 32 Database name (ASCII, zero-padded)
32 2 Attributes
34 2 Version
36 4 Creation date (seconds since 1904)
40 4 Modification date
44 4 Backup date
48 4 Modification number
52 4 App info offset
56 4 Sort info offset
60 4 Type = "BOOK"
64 4 Creator = "MOBI"
68 4 Unique ID seed
72 4 Next record list ID (0)
76 2 Number of records
The dates are stored as a count of seconds since 1 January 1904, a Palm OS convention rather than the Unix epoch. Every multi-byte value here, and everywhere else in the file, is big-endian.
The record-info list and record 0
A PDB file is a flat list of records. Right after the 78-byte header comes a record-info list, one entry per record. Each entry is 8 bytes: a 4-byte offset that points at where the record starts in the file, then a byte of attributes and a 3-byte record ID. The reader walks this list to find each record without scanning the whole file.
Record-info entry (8 bytes each):
4 Record data offset (absolute, from start of file)
1 Record attributes
3 Unique record ID
Record 0 : PalmDOC header + MOBI header + EXTH header
Records 1..N: book text (PalmDOC-compressed HTML)
Records N+1..: cover and inline images, index
Last (if DRM): DRM voucher
Record 0 is special. It carries no book text at all. Instead it holds three stacked headers that describe the rest of the file: the PalmDOC header, then the MOBI header, then, in newer files, the EXTH header. A program reads record 0 first to learn how the text is compressed, how many text records follow, and what the metadata says.
PalmDOC compression and the 4096-byte text records
The book body lives in records 1 through N as HTML. Before storage that HTML is compressed, most often with the PalmDOC scheme, a simple LZ77-style back-reference pass combined with byte-pair packing of common character pairs. Some MOBI files use the heavier HUFF/CDIC compression instead, and a few store the text with no compression.
Whichever scheme is used, the text is cut into records of at most 4096 bytes each, and compression operates inside those record boundaries rather than across the whole book. That record size is recorded in the PalmDOC header. Splitting the text this way lets a reader decompress and render one screen’s worth of content at a time, which mattered on the memory-starved handhelds the format was designed for and still keeps large books responsive.
The MOBI and EXTH headers: metadata and cover
The PalmDOC header at the front of record 0 states the compression type, the total uncompressed text length, the number of text records, and the 4096-byte record size. Immediately after it sits the MOBI header, which starts with the 4-byte identifier “MOBI”. It gives the header length, a MOBI type code, the text encoding, a unique ID, and a file version. The encoding is a code page number: 65001 means UTF-8 and 1252 means Windows Latin-1.
The EXTH header follows the MOBI header and begins with the identifier “EXTH”. It is a list of typed metadata records, each tagged with a numeric type. Common types include author (100), publisher, description, ASIN, and the cover offset (201), which points at the image record holding the cover. This is where a reader gets the author and title it shows in a library view, separate from the truncated name in the PDB header.
Record 0 layout:
PalmDOC header : compression, text length, record count, record size (4096)
MOBI header : "MOBI", header length, type, encoding (65001=UTF-8 / 1252), version
EXTH header : "EXTH", then typed records:
100 = author
201 = cover offset
... = publisher, description, ASIN
Images, index and the DRM voucher
After the text records come the image records. The cover and every inline picture each occupy their own PDB record, stored as ordinary JPEG or GIF data, and the EXTH cover offset and in-text markers tell the reader which record to pull for a given image. An index may follow, used for navigation and search.
If the book is protected, a DRM voucher is stored as well. Amazon-purchased AZW and MOBI files are locked to an account, so a generic reader refuses to open them and conversion is blocked until the protection is removed. This is a rights restriction, not malware: a .mobi file holds text, images and metadata, and contains no executable code.
MOBI, AZW and AZW3: the Kindle lineage
MOBI, AZW and AZW3 all share the Palm Database skeleton described above, which is why the same tools can often read all three. MOBI is the original Mobipocket format. AZW is essentially a MOBI with Amazon’s early Kindle DRM added. AZW3, introduced in 2011 as the KF8 format, is the newer Kindle container: it carries richer styling, closer to modern EPUB with more CSS and HTML features, while still riding on the PDB structure. Compared with the others, MOBI is the oldest and the most limited in layout.
The format is now retired. Amazon’s KF8/AZW3 and EPUB superseded it, and in 2022 Amazon stopped accepting MOBI through Send to Kindle, making EPUB the format you send instead; new Kindle content uses KFX. You still meet .mobi files as old downloads, backups of early Kindle purchases, and free books from sources such as Project Gutenberg. For those, converting to EPUB with a tool like Calibre keeps them readable on current devices. Full field-by-field details are on the MobileRead MOBI wiki.
FAQ
Why does “BOOKMOBI” appear at offset 60 and not offset 0? Because the first 32 bytes of a PDB file are the database name, which varies per book. The type and creator fields that identify the format live at offsets 60 and 64 in the PDB header, and together they read as “BOOKMOBI”.
What is the EXTH header in a MOBI file? It is the metadata block inside record 0, marked by the identifier “EXTH”. It stores typed records such as author, publisher, description, ASIN and the cover offset, which is how a reader knows the author and cover to display.
MOBI vs AZW3 — what changed? AZW3 (KF8) is the newer Kindle format. It supports more CSS and HTML-style layout for better-looking pages, while MOBI is limited to the older PalmDOC-era HTML. Both sit on the PDB container, but AZW3 replaced MOBI for styled content.
Why is MOBI text split into 4096-byte records? The Palm Database stores content as records, and PalmDOC compression works within a fixed record size of 4096 bytes. Splitting the book this way lets a reader decompress and show one section at a time instead of the whole file.
References
- MobileRead Wiki — MOBI format
- Library of Congress — Mobipocket / MOBI format
- Calibre — e-book reader and converter
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.