viewhack

Read a .mobi or .azw3 Kindle book without a Kindle

You have a Kindle-format book, a Project Gutenberg download, an author's review copy or a Calibre export, and no Kindle app or Calibre on this phone or work computer. Drop it here: its title, author and cover, the table of contents, and every chapter with its pictures, with search and a text-size control.

The book is read on your device. It is not uploaded, and nothing in it is fetched or run.

What it shows

What is inside a .mobi or .azw3 file

A Kindle book is a PalmDB database, a format from 1990s Palm organisers: a 78-byte header with the book's short name in its first 32 bytes, the type and creator code BOOKMOBI at byte 60, and a table of 8-byte entries giving where each record starts. Record 0 holds the headers. Its first 16 bytes are the PalmDOC header: the compression type, the text length, the number of text records, the record size (4096 bytes of text each) and the encryption field. After them comes the MOBI header with the text encoding (65001 for UTF-8, 1252 for Windows-1252), the format version and the numbers of the first picture record and of the index records.

The EXTH block after the MOBI header holds the metadata as numbered records: 100 is an author, 101 the publisher, 103 the description, 104 the ISBN, 106 the publication date, 113 the ASIN, 201 the cover picture, 503 the full title and 524 the language. Record 121 marks a combo file: tools like kindlegen wrote a MOBI 6 book for old Kindles, then a boundary record, then a complete KF8 copy for newer ones. This page shows the KF8 part, which keeps more of the layout.

The text records are compressed one by one. Type 2 is PalmDOC, a simple LZ77 scheme: a byte from 0xC0 up stands for a space and one character, and two bytes from 0x80 copy 3 to 10 bytes from up to 2047 bytes back. Type 17480 is HUFF/CDIC, a Huffman code over a dictionary of phrases, used by Amazon's older tools for store books. Each record can end with extra bytes (for multibyte characters cut at the record edge and for the Kindle's navigation data) that must be cut off before decoding; the MOBI header's extra-data flags say which. In a MOBI 6 book the result is one HTML stream split into chapters by <mbp:pagebreak/>, with links written as byte positions (filepos=). In KF8 it is several flows (the HTML, then stylesheets and SVG pictures), and the HTML is stored as skeletons with fragments to be slotted in, which this page reassembles into chapter files the way a Kindle does.

Files it opens

.mobi
Mobipocket and older Kindle books (MOBI 6), and the KF8 or combo files that Project Gutenberg, kindlegen and Calibre also name .mobi.
.azw3
KF8, the Kindle format from 2011 on, as Calibre and Project Gutenberg write it.
.azw and .prc
Older names for the same MOBI format. A DRM-free .azw opens; one bought from the Kindle store is usually DRM-protected and is named as such.
.pdb (PalmDOC)
Plain-text e-books from Palm handhelds (type TEXtREAd), shown as their text.
Why these files still turn up
Amazon stopped accepting .mobi through Send to Kindle in 2022 and asks for EPUB instead, so many people now hold .mobi and .azw3 files that no current app of theirs opens.

DRM-protected books

If the encryption field in record 0 is not 0, the book's text records are encrypted with a key tied to the Kindle account or device it was bought for. This page says so plainly and shows only what is not encrypted: the title, author and other details from the headers, and the cover. viewhack cannot and will not remove DRM. Read such a book in a Kindle app or on a Kindle.

What this cannot do