Kindle formatThe Amazon Kindle format is very basic HTML with a small amount of support for Cascading Style Sheets (CSS). The converter built into the DTP website will accept books in Word and some other formats, but those books invariably turn out with off-the-wall formatting, missing images, and other unacceptable issues.

Amazon suggests that authors and publishers do the conversion to HTML themselves, but many of them have never even seen HTML code, much less formatted a book with it. For those of you who do not already know or are not interested in learning HTML, my eBook conversion services are available. For those of you who are trying to make the process work yourself, here are some pointers and hints on how to format text for the Kindle.

Step 1: Converting the document

If you have a word processing document, like Microsoft Word, or a PDF file, the easiest way to work with the document is to convert it into HTML. Before you do that you might want to go through the file and take out any page numbers, extraneous images, and other content that will not show up in the final Kindle book. Then go ahead and save the file as HTML. For example, in Microsoft Word, go to File | Save As, and save the document as “HTML Filtered.” The filtered mode will remove much of the extraneous Word-specific code that is usually included in files saved as regular HTML. save from e-mail as HTMLIf you do not have Word or Adobe Acrobat, you can get the HTML from these types of files using the View as HTML setting found in some e-mail programs (notably Google’s Gmail), which converts many files automatically when they are e-mailed. download HTMLAnother option is to go ahead and upload your source file to the DTP and download the HTML it creates. You can do this on the left side of the Preview page.

Other document formats will require their own processes. Adobe InDesign can save as HTML in some cases, as can Quark, Microsoft Publisher, and other layout programs. If you don’t have a digital file for the book, but you do have a hardcopy, you will have to scan the book and have an Optical Charater Recognition (OCR) program read the text for you. Most flatbed scanners come with a simple OCR program, but scanning each page individually can become tedious quickly. You should consider having the entire book scanned and OCR’d by a professional.

Step 2: Cleaning up the code

HTML is a very simple language to learn. All of the formatting in an HTML document is marked by “tags”. Tags consist of text enclosed in angle brackets, like this: <p>. There are great tutorials online that can help you learn HTML. Start with the W3C Tutorial.

Once you know the basics of HTML formatting you will need to look at the HTML file for your book. It is likely that you will see a lot of bloat in the document: extra tags that are not needed, <span> tags inside every paragraph to assign formatting to the text, inline CSS styles, etc. I suggest you remove as much of this as you can and get your file down to a minimum level of formatting.

An example of messy code saved from Microsoft Word can be found here. The same file, cleaned up, can be found here.

Step 3: Formatting the book

Now, I am obviously not going to give away all of my secrets, but I will pass along some pointers about the Kindle and which tags/formatting it will use and which it will ignore. The official list can be found on the DTP website.

Something important to note is that the Kindle does not support the use of margins in traditional ways. This makes some formats, like poetry and blockquotes, hard to achieve, but not impossible. See my Quick Tip: Margins blog post for more information on how to make margins work in your book.

You can use a stylesheet to format your book, and I do suggest that you use CSS as much as possible. There are some CSS rules, however, that are not supported at all or somly supported minimally in the Kindle, in addition to margins: different fonts, font sizes, and colors are a few. The best control over font sizes can be achieved using heading tags (<h1>, <h2>, <h3>, etc.). The <big> and <small> tags are not as robust as they are in HTML, but you will find that they allow you to adjust the size up or down a couple of sizes. The font-size property in CSS is essentally useless, too.

Use the custom <mbp:pagebreak /> tags to mark pagebreaks in the text. I suggest you include one in front of every chapter or section.

The Kindle has built-in bookmarks for the Table of Contents and the start of the book's content. Use the following anchor tags to mark those places in your book: <a name="TOC"/> and <a name="start"/>.

Images uploaded to the Kindle will be resized to fill the screen appropriately. Images larger than 450px by 550px are rescaled. However, as long as the image has an aspect ratio of 9:11 it seems to be rescaled to fit the screen of the Kindle perfectly, filling up the entire reading area.

When you are finished formatting your book you should upload it to your shelf and look at the Preview, or, even better, upload it to a Kindle to look at the final result. Be aware that while the DTP book viewer provides a decent representation of what the book will look like on the Kindle, there are still quite a few differences.

If you have images in your book, the best way to get them on your Kindle with the HTML file is to create a Mobipocket .prc file and copy that to the device. To do that:

  1. Create a new folder on your computer and copy your HTML and all image files there.
  2. Install the Mobipocket Creator program on your computer.
  3. Start a new project and point it to the HTML file in that new folder.
  4. Build the project; it should save the images in the PRC automatically.
  5. Look at the file in the Mobipocket reader just to make sure it came out okay.
  6. Upload the .prc file in that new folder to your Kindle via the USB cable.

Common Problems

Here are a few common issues you may run into as you format and proof your final book:

1. Conversion failed, no reason given.

This is most likely due to some invalid code in your HTML document. Use an HTML validator (like this one at the W3C website) to find out where the errors are. Be aware that the custom <mbp:pagebreak /> and similar tags will generate an error in any validator. To get around that, place them in comments before running the validator (<!--mbp:pagebreak /-->) and remove the comments before uploading the book again.

2. Text not formatted in the Preview window.

This is probably due to a stylesheet not being uploaded with the HTML file. The best way to upload a book is to zip up the HTML, the CSS, and any image files, then upload the zip file. Also, make sure that your CSS file is linked to the HTML file with the link tag (<link rel="stylesheet" type="text/css" href="styles.css"></link>) or that the CSS is placed in the header of your HTML in <style> tags.

Other solutions to common problems can be found on the DTP forums. If you run into something that is not answered well there, please feel free to drop me a line and will try to provide a clear response.

I am so pleased I discovered Joshua Tallent and his formatting services. Nothing irks a reader more than a poorly formatted book--in any medium. Joshua knows what an ebook needs to look like and provides high-quality work at a very reasonable price. I look forward to working with him on future projects.

Leslie H. Nicoll
Publisher, Bristlecone Pine Press
an imprint of Maine Desk LLC

see all

Valid XHTML 1.0 Strict