Suggestions for Kindle Format 8
Amazon's Kindle Format 8 is similar in many ways to the EPUB format, but it is not technically the same. There are two major schools of thought about how to handle these differences: 1) create one EPUB file and give it to every retailer, including Amazon, without a lot of changes or Kindle-specific coding; and 2) create a separate Kindle file from separate source code, usually based on the EPUB source code.
Which option you choose will probably depend on the book you are converting, the standards of your publishing house, and the time you have available. For more complex titles, it can be very helpful to consider creating separate files for each retailer, with tweaks that will make the files work better in each ecosystem. However, if you want to create only one file, that is also an acceptable solution in many cases.
Single-source file preparation
Let's start out with the single-file solution and talk about the differences between EPUB and KF8. As we mentioned above, KF8 is very similar to EPUB. They actually come from the same core Open eBook standard (what was essentially EPUB 1). KF8 files include the same core source files as EPUB: the OPF file and the NCX or HTML Nav doc. KF8 also supports both XHTML 1.1 (used in EPUB 2) and HTML5 (used in EPUB 3), so there are no major differences between KF8 and both reflowable versions of EPUB in use today. (Note, however, that KF8 fixed layout is significantly different than EPUB fixed layout, and usually requires extensive changes to work properly.)
To that end, you do not have to worry about changing those core files in major ways to ensure that they are understood by Amazon's systems. The main differences will be in what formatting works, how HTML and CSS are supported, and other differences that are more stylistic than they are structural.
Note that in addition to actual formatting or support differences, there are some requirements and best practices that are specific to the Kindle platform, as with other retailers. These issues are included in the list below, and will also be flagged in the Amazon section of FlightDeck's Retailer Acceptance Grid for your EPUB file.
Here are the major differences between KF8 and EPUB, and the issues to watch out for when creating a single-source EPUB files:
- When a Kindle .mobi file is created by KindleGen, Amazon's eBook compiler, it contains both a KF8 version of the book and a MOBI7 version of the book. Once the file is in the Kindle store, Amazon determines which version to send to the consumer based on which format their device supports. The Kindle 1, Kindle 2, and Kindle DX only support MOBI7, but all other Kindle devices support KF8.
- Device Defaults: In the MOBI7 format, paragraphs have a small first-line indent and no top or bottom margin. In KF8, the default paragraph formatting is no first-line indent and 1em top and bottom margins. These styles will need to be overridden in the default CSS or with media queries to ensure your file looks the same in both formats.
- While cover images are not required in the EPUB specs, Amazon highly suggests that all books include an interior cover image. That image should be marked in the OPF file using the standard EPUB 2 or EPUB 3 methods.
- KindleGen places the cover image you define at the front of the book, even if you already have an HTML file with the cover image at the front. In order to keep the Kindle from displaying both images, Amazon recommends putting
linear="no" in the spine item for the HTML file. However, this will break the display of the cover image in other reading systems, so we recommend you just let the cover display twice.
- Amazon recommends placing the TOC at the front of the eBook, even if other front matter is moved to the back because placing it in the back of the file can cause issues with the "Last Page Read" functionality.
- While other reading systems resolve interior links by placing the linked location in the middle of the screen, the Kindle system places the linked location at the top of the screen. This can cause problems in some circumstances if the reading system is loading the HTML from that location and the target anchor was placed inside the block level HTML element that applies formatting; for example,
<h1><a id="Chapter1"/>Chapter 1</h1>. In this instance, the chapter heading may display as regular text because the
<h1> element is not loaded. Amazon recommends fixing this issue by placing the anchor outside the block element, like this:
<a id="Chapter1"/><h1>Chapter 1</h1>. This method is acceptable in HTML 5, and thus is fine for EPUB 3, but will generate errors in EPUB 2.
<details> element has been a common suggestion for including accessibility to images and figures in EPUB 3 documents. However, recent changes in the HTML5 spec have removed the
<details> element, so its use is not preferable in EPUB 3. In addition, the
<details> element is not supported in the Kindle format and will be ignored in the KF8 conversion process and invisible to the reader. We recommend instead using the
<aside> element to include long descriptions of images and figures for accessibility.
- It is highly recommended that you include the guide or landmarks section in your EPUB file. Amazon uses the cover, TOC, and start reading location in its reader navigation options.
- The KindleGen conversion software will automatically process images in the EPUB file. There are some specific instructions in the Kindle Publishing Guidelines, but in general it is best to keep your image files under 5MB each, 300ppi, and color (RGB) when applicable.
- EPUB source files must not be larger than 650MB.
- Amazon suggests using percentages instead of ems for CSS properties such as
line-height. This is may contrast with other retailer requirements, but should not cause major issues.
- Some CSS that you may use in your EPUB will not be supported in the Kindle system. See the Kindle Publishing Guidelines for the official list of supported CSS.
- To prevent problems with aspect ratios, Amazon recommends only setting either the width or the height of images as percentages, not both.
- Do not use negative values for the
line-height attribute, as that can throw off the formatting and cause elements to display off the screen.
- Here is what the Kindle Publishing Guidelines have to say about Audio and Video: "KF8 features are not currently supported in Kindle Edition with Audio/Video content. The file delivered to Amazon should be a Mobi 7 EPUB with self-contained audio and video or a Mobi 7 .prc file with self-contained audio and video. (If delivering a .prc, make sure the file was created using the latest version of KindleGen available from www.amazon.com/kindleformat)." This means that if you include embedded media, your file will display with the limited formatting available in the MOBI7 format, not with the formatting available in KF8. (See the Handbook entry on Embedded Media for code examples.)
- KF8 officially supports TTF and OTF files, but KindleGen may throw errors about OTF files that have PostScript information. Please see the Handbook entry on Embedded Fonts for more information on font formats.
- You may want to use media queries to define styles for Kindle devices. This can be done with the
@media amzn-mobi and
@media amzn-kf8. See the Kindle Publishing Guidelines for more information.
Converting EPUB to KF8
If you decide that you want to create a specific file for Amazon so that the differences do not affect the file you give to other retailers, you can provide them with either an EPUB file or a KF8 file. If you decide to give them an EPUB, just be sure you have converted it with KindleGen and tested it on the Kindle devices before delivering it. The basic process includes the following steps:
- Unzip the EPUB, and pull out the OEBPS folder and related files.
- Remove the Cover HTML file, as well as all references to it in the OPF and NCX/HTML Nav.
- Move anchors in front of formatting tags if desired.
- Add backwards compatibility to complex formatting if desired.
- Fix or change any of the other items listed above.
- Rebuild your EPUB file, and run it through KindleGen. Load it on Kindle devices to ensure the conversion works properly and the formatting is working.
- Deliver either the EPUB source or the .mobi output to Amazon.
Back to Handbook