Introduction
MOBI is the ebook format of Mobipocket, a French company whose reader ran on Palm,
Windows Mobile and other early handheld devices. Amazon bought Mobipocket in 2005 and
built the first Kindle’s format on it, so older Kindle books use the same structure, often
with the extension .azw and with DRM. The format has been replaced by
AZW3 and newer Kindle formats, and Amazon no longer
accepts MOBI files for sending to a Kindle.
Mobipocket never published a full specification; what is known comes from reverse engineering.
Structure
A MOBI file is a Palm database (PDB). It starts with a 78-byte header holding the
book’s name, dates, the type BOOK and creator MOBI at offsets
60 and 64, and the number of records, followed by a list giving the offset of each
record. Record 0 holds a 16-byte PalmDOC header (the compression method, the text
length and the number of text records), then the MOBI header starting with the bytes
MOBI, and usually an EXTH block of metadata such as author and publisher.
The book’s HTML-like text follows in records of up to 4,096 bytes, usually compressed
with PalmDOC’s simple LZ77 scheme, then images and index records.
0PDB header name, dates,BOOKMOBI, record count78 bytes78Record list offset and attributes of each record8 bytes each…Record 0 PalmDOC header, MOBI header, EXTH metadatavaries…Text records the compressed book textup to 4,096 bytes each, uncompressed…Image and index recordsvaries
Links
Software
- calibre (Windows, macOS, Linux)
- SumatraPDF (Windows)
- KOReader (e-readers, Android, Linux)
Developers
- KindleUnpack, Python tool that unpacks MOBI and AZW3 files into their parts
Reference
- MOBI, MobileRead Wiki, the most complete public description of the format