Introduction
AZW3 is the file extension for Kindle Format 8 (KF8), the ebook format Amazon introduced in 2011 for the Kindle. It replaced the MOBI format’s limited HTML with HTML5 and CSS, so books can have richer layouts, embedded fonts and fixed-layout pages. Books bought from Amazon are usually protected with DRM; AZW3 files without DRM are common in calibre libraries and for sideloading.
Amazon has since moved its store to newer formats, but Kindle devices still read AZW3.
Structure
An AZW3 file uses the same Palm database
container as MOBI: a 78-byte header with the type BOOK and creator
MOBI, a list of records, then
record 0 with the PalmDOC and MOBI headers
and EXTH metadata. The MOBI header’s version is 8. The
text records hold the book’s XHTML, CSS and SVG
as “flows” listed in an FDST record; the XHTML is cut into skeletons and
fragments, which index records describe,
along with the table of contents and guide. Images and fonts are
resource records, referred to by
kindle:embed links. A file made by KindleGen may hold both an older MOBI
version and the KF8 version of the book, separated by a BOUNDARY
record; calibre and KindleUnpack can make a stand-alone KF8 file, and that is what is
usually meant by .azw3.
0PDB header and record listBOOKMOBI, record offsets78 + 8 bytes each…Record 0 PalmDOC header, MOBI header version 8, EXTH, titlevaries…Text records all flows, compressed in 4,096-byte piecesvaries…Index records fragment, skeleton, NCX and guide indexesvaries…Resources images,FONTrecords,RESCvaries…FDST,FLIS,FCIS,DATP, end of filevaries
Not described
Amazon never published KF8. These pages follow calibre and KindleUnpack, and the MobileRead wiki gives only an overview.
Known, not yet covered
- Reference: the APNX side file that carries page numbers (named on the MobileRead wiki).
- Viewer: there is no AZW3 viewer; the file is not recognised, so the explorer shows it as unidentified bytes.
Unknown
- Reference: the RESC record header, the internal layouts of CONT, CRES and CONTBOUNDARY, and the PAGE record, see resources.
- Reference: DATP contents, the base of the fragment tag 6 start value and the target of EXTH 129, see record 0.
- Reference: DRM, and KFX (Kindle Format 10), a different later format.
Links
Software
Developers
- KindleUnpack – tool that unpacks MOBI and AZW3 files into their parts (Python)
Reference
- KF8 – the MobileRead Wiki’s page on Kindle Format 8
- MOBI – the MobileRead Wiki’s description of the container and headers KF8 shares with MOBI
- calibre MOBI and KF8 code – calibre’s reader and writer, the most complete working description of KF8 (Python)