Mobileread
AZW? and MOBI# Format
#1  WEricBr 06-14-2022, 01:17 PM
From what I can find, it appears that AZW3 is MOBI 8, but I've seen different references to AZW being MOBI6 and MOBI7.

Can anyone tell me how the AZW? format relates to the MOBI# format?

Also, what is the difference in the MOBI Header between MOBI6 vs MOBI7 and MOBI7 vs MOBI8?

Links to resources would be great if they exist.

Thanks,

Eric
Reply 

#2  jhowell 06-14-2022, 02:14 PM
The MOBI file format has an internal file format version (FFV) number. Versions up to 7 are all based on HTML 3. Higher version numbers indicate that the file includes additional features that were not present in the original Mobipocket e-book format. However since all Kindles support at least up to version 7 the difference between that and lower versions is usually unimportant. Amazon just calls this format MOBI or MOBI7.

File format version 8 (also known as Kindle Format 8 or KF8) was a major change to MOBI, based on HTML 5.

A Master-MOBI file contains two formats in a single file, a MOBI7 part and a KF8 part. It also contains mapping of equivalent content between to two formats, page number information, and higher resolution images.

The newest Kindle format 10 (aka KFX) has a totally different structure and is only loosely based on HTML.


The names beginning with "azw" refer to file extensions used by various Kindle apps and devices. Amazon is not consistent with file extensions across apps and devices so there is not a one-to-one mapping between formats and file extensions.

".azw" was originally used for MOBI7. However some Kindle apps use ".azw" for any Kindle format.

".azw1" is used for Topaz, another proprietary Kindle format.

".azw3" is used for KF8.

".azw4" is used for a MOBI file that contains an embedded PDF document instead of HTML content.

".azw6" is used for HD image container associated with a book in KF8 format.

".azw8", ".azw9", and ".kfx" are all used for KFX.

".mobi" sometimes refers to MOBI7 and sometimes to a Master-MOBI.

".prc" refers to either MOBI7 or KF8.
Reply 

#3  jhowell 06-14-2022, 02:25 PM
I should have added that the calibre software refers to e-book formats by their file extension. The inconsistent usage of file extensions by Amazon can lead to some confusion as to what format a file actually contains.
Reply 

#4  WEricBr 06-14-2022, 03:43 PM
So, is the MOBI header the same for all versions up to offset 204?

From what I can tell (looking at KindleUnpack/DumpMobiHeader_v023.py and other resources, the MOBI header is the same until you get to offset 204, which is:
MOBI6/7 = "first_content'" consisting of 2 bytes
MOBI8 = "fdst_offset" consisting of 4 bytes

Does the KFX have the same header information or is it completely different?

Thanks,

Eric
Reply 

#5  jhowell 06-14-2022, 06:24 PM
Quote WEricBr
So, is the MOBI header the same for all versions up to offset 204?
As far as I know the fields in MOBI header were intended to have the same meaning for all versions. More fields were added over time to support new features so the header can have various possible lengths.

Quote WEricBr
From what I can tell (looking at KindleUnpack/DumpMobiHeader_v023.py and other resources, the MOBI header is the same until you get to offset 204, which is:
MOBI6/7 = "first_content'" consisting of 2 bytes
MOBI8 = "fdst_offset" consisting of 4 bytes
That does appear to be an exception. It seems to me that the value of the field at offset 0xc4 (fdst_flow_count) is 2 or more then it holds the fdst_offset otherwise it is a pair of values.

Kindleunpack is incorrect in assuming that only KF8 can have multiple flows and an FDST record. I have seen that in some dictionaries.

Quote WEricBr
Does the KFX have the same header information or is it completely different?
MOBI files are based on the Palm Pilot PRC file format. KFX is a totally different format, based on Amazon Ion. It has no data structures in common with MOBI.
Reply 

#6  WEricBr 06-15-2022, 10:58 AM
Thank you very much, that clears up a lot of things.

And thanks for the info and link about Amazon Ion.

Thanks again,

Eric
Reply 

#7  Quoth 06-15-2022, 02:28 PM
And prc was also used on Win CE and Symbian. There are two incompatible pdb formats for ebooks on Palm PDA, one was Mobipocket. Some ereader apps can read either. Earlier Palm OS PDAs don't have the Mobipocket application that can read .prc files, but only pdb.
Mobipocket was one of the original ebook sellers for Palm, Symbian, and Windows CE PDAs and smartphones long before the iPhone existed. In about 2005 Amazon bought Mobipocket (maybe same year Sony eInk came out, which used LRF?) and eventually changed to mobi (basic AZW was just Amazon version of DRM on mobi, because Mobipocket DRM was broken). The first Kindle came out in USA in Nov 2007. The iphone came out June 2007 in USA and when it got to Europe still had no copy/paste or 3G. At some stage Amazon killed their previous eBook format that they used before they bought Mobipocket. Later they ended mobi DRM support and eventually removed all the online Mobipocket apps and documentation, though other sites have copies.
Reply 

Today's Posts | Search this Thread | Login | Register