Sunday, 18 November 2012

How to format ebooks for Kindle KF8

When I realized Ice Diaries' formatting was not changing size/fonts correctly on the Paperwhite Kindle, I did some research and reformatted all my books using Kia Zi Shiru's method you can find here. It worked for me. I'm writing my own version hoping it may help other indie writers. Be warned, this is an exacting fiddly process that took me a day the first time - the second was quicker. If you want to see what the end product looks like by this method, download Ice Diaries' sample, or better still buy it :o)

IMPORTANT NOTE: to demonstrate without fusing Blogger, I have changed pointy brackets for square, i. e. < for [, and > for ]. If you are going to format my way, I'd advise pasting this post into Word and changing the brackets so you can copy and paste the codes into your HTML document. Print it, and you can cross off each stage as you go.
  • Make a new copy of your book in Word and call it 'TITLE for formatting'. Make sure the chapter headings are consistent, and the text is single-spaced. Remove any extraneous spaces at the ends of paragraphs by selecting the whole text, centre justify the selection and then left justify the selection. All the extra spaces will disappear. Do a Search and Replace replacing two spaces with one. Mark each pagebreak PB on its own line. 
  • To format italics, go to Search and Replace. Leave the search box blank, but in the Find/Replace dialogue box, under the Replace box, is a More button. Click it, then click Format at the bottom of the box. From the list that pops up select Font, and from that dialogue box, under Font Style, select Italic. In the replace box put:
    [I]^&[/I] (remember to change the brackets)
    Click Replace All.
  • Download Libre Office and Notepad++  which are free.
  • Copy your Word document into Notepad++ in order to strip the formatting.
  • Copy the text from Notepad++, open a new document in Libre Office and paste it in. Libre Office is good because unlike Word, it produces nice clean HTML. Close the Notepad++ file without saving, as you have finished with it now.
  • Change the character set that LibreOffice uses for HTML, under Tools, Options, Load/Save, HTML compatibility. In the lower right there is Character set with a drop down menu next to it. Change this to Western Europe (ASCII/US).
  • Go to File, Save As and save as TITLE html, as an HTML Document (Writer) (.html) from the drop down menu. When asked if you are sure, you are.
  • At this stage, your whole text should show as Default in the top left box. If it doesn't, Select All and change it to Default.
  • Go through the text making changes. Select the chapter headings and change them to Heading 1 in the box in the top left corner which otherwise says Default. I use H1 for the title on the title page, too. Don't bother centring at this point.
  • Select each chapter title, if you have them, and change them to Heading 2.
  • I change my name on the title page and Contents to bold.
  • Put in bold and underlined in the text as required.
  • Table of Contents: Amazon requires this at the front of the book. Highlight the heading Chapter 1 at the start of your first chapter, go to Insert and click on Bookmark. Type in Chapter 1 and OK. Do this for all your chapter headings.
  • Go to your Table of Contents list. Click on Chapter 1. Go to Insert, Hyperlink. In the pop-up screen click on Document. Click on the circle with a dot on the second row, which opens a new pop-up. Click the + sign next to Bookmarks, and select Chapter 1. Click Apply, then Apply in the other window. Do this for all your chapters.
  • Select the title CONTENTS and add a bookmark; call it TOC. Bookmark where you want the book to start; call it Start. This is for Kindle navigation.
  • To add links to your website or other books, highlight, click Insert, Hyperlink, and click on Internet. Paste the URL of the site you want the link to go to, and click Apply.
  • Click File, Preview in Web Browser to check your links work. Don't worry that it looks kind of plain.
  • Open Notepad++, click File, Open and open your Libre document, 'TITLE html'.
  • Add your title in line 5, between the tags. Delete lines 7 and 8.
  • Look at the first of your [P] tags (Paragraph tags, in your normal text). Anything between the [P and the last ] can be cut; copy the whole tag and go to Search and Replace. Paste the whole tag in the top line, [P] in the bottom, and Replace all
  • Do the same for [H1] and [H2] tags, but leave the [A] tags well alone, as they are your link tags.
  • Go to everything coloured green between [STYLE] and [/STYLE], delete what is there and paste the following - but remember to change the square brackets in the code to < and >:


p { text-indent:1.2em;} { margin-top:0em; margin-bottom:0em; }

.center { text-indent:0em; text-align:center; }

.noindent {text-indent:0em;}

* {

margin: 0;

padding: 0;



  • Now to add the page breaks. Do Search and Replace all, replacing [P]PB[/P] with [mbp:pagebreak/]
  • Centre lines you want centred: to do this, add  class="center" between the first tag. So [P] becomes [P class="center"] (note there's a space after P) and [H1] becomes [H1 class="center"]. Do [H1] and [H2] all at once with Replace all. Woohoo!
  • If, like me, you like the first line of a chapter or scene with no indent, then you need to change [P] to [P  class="noindent"] where you want no indent. You will have to do each individually, I'm afraid.
  • Save, and open Kindle Previewer on the KDP Upload page. Open your book and check every single page. Looks good? Then email the file to your own Kindle for a final read-through and check. If you find any problems, go back to the Notepad++ version and tweak.
  • You're done. Pat yourself on the back and have a stiff drink.


  1. Oh heck, my brain hurts just looking at this - please can I go straight to the drinking bit?

  2. Huh!

    It's actually quite straightforward. I'd print off the instructions, do one step at a time then cross it off. The main thing is to be careful and precise, as HTML code won't work if there's a wrong character or space.

  3. That's great, thanks so much. I'm just gearing up to format my novel and I'm a bit worried about the new Kindles. Thanks again!


  4. Good luck, Maia!

    Although it's fiddly and time-consuming (I can see why many writers would prefer to pay a formatter) it's also rewarding. And if any alterations are needed later, such as adding links to a new book at the end, you can do it yourself.

  5. Done it and ready to upload soon. Also finished cover - well, a while ago ! Finally ready to publish my first novel ! Will you read it Lexi ?

  6. Sorry, forgot to mention almost halfway through Ice Diaries. Loving the feel and atmosphere of the winter wasteland......I remember when you posted about the unshaven, bad boy hero becoming attractive to Tori. I like the development of a bond between them, nicely paced. I was worried about it becoming stereotypical - but its not, well done !

  7. Good luck with the book, Mick. Exciting, publishing your first.

    I'm not getting the time to read much at the moment - I'm blaming writing and formatting. The last few books I started I haven't finished. Must try harder...

  8. It takes a special kind of person to share info like this with those who need to know.

    In my book I have mentioned Tim Berners-Lee because he shared info that changed the world. It seemed the least I could do.

    Just be careful we don't all call our heroines Lexi as a thank you for the info.

    Nearly everyone I know is writing or thinking of writing. I hope we can generate more readers!

  9. I have to admit, Anna, that one reason I did this blog post is purely selfish. If I didn't write it all down, by the time I needed to format the next book I'd have forgotten it.

  10. Let us hope the goalposts stay still for as long as it takes us to write the next book.

    Still, the last line of your instructions should still be relevant.

  11. The heights of generosity to share this, Lexi. My mum was well impressed, although she said it gave her eye strain. The drinking bit is all right, I suppose, but I would propose a round of fish and brown rice crunchies as the perfect way to celebrate a job well done!

  12. Tell your mum reformatting six books gave me twitches in my eye and an aching arm. For me, fish and crunchies just wouldn't hack it :o)