Calibre’s great conversion of docx into ebooks

The good people at Calibre have come up with an easy way to convert your docx word files into ebook format using their free ebook management software, which is far more than an ebook library. They recommend that you convert it from docx to epub first (as opposed to from docx to mobi or docx to kindle), and then you can use the epub to easily convert to other formats such as mobi. I used Calibre version 0.9.39 to test the ebook converter. If you do not have word docx version, then you can use the odt format which is found in the free versions of Apache Open Office or LibreOffice. But my quick experiment with an odt file did not produce a great epub, as embedded images were missing and the text appeared in more than one font. But the docx conversion to epub is the quickest and cleanest I have ever done, without the need for any HTML editing. Once I have a correctly formatted docx file, I can produce a perfect epub in 5 minutes, and then convert to mobi in even less. So here is how:

Things to do before to ensure a good conversion:

  1. Ensure that you use styles to format your word docx document. Under no circumstances should you use the tab key or BIU on the formatting toolbar. Set up a novel template with the styles already created and use that to write your novels. When setting up styles, it is best to build from previous styles like a family tree. So for the body of the novel start with normal as your base style, select a font that you can easily read whilst typing, as most ereaders will be able to change this, left margin, no justification for ebooks, and single line spacing. Then build your other styles from this. For the body of my novel, I use only four styles 99% of the time:
    1. A chapter heading style – font size, bold, spacing before and after, para 1 style after
    2. A scene heading style – ***, centred, para 1 style after
    3. Para 1 style – basically no indent, para 2 style follows (this is used for all first paragraphs of a new chapter or scene)
    4. Para 2 style – indented, para 2 style follows (this is used for all other paragraphs)
  2. If you need italics or bold, it should already be built into the style, such as the chapter heading style, or you need to select the bold or italic styles. I use a number of other styles for the front and back matter. So if you don’t know how to use word styles, you should have a quick read up on it and create some in a word template to use for your novels. There is a good basic starter lesson at GCF Learning
  3. Hyperlinks should be created with the target frame set to “Page Default (none)”. This is because there is no need to use a target in an ebook to specify open a webpage in a new tab. When you set up or edit your hyperlinks, in the hyperlink creation window on the right, select: Target Frame > Page Default (none).
  4. Before you convert, switch on the show paragraph marks and check to ensure that where you want a gap, there is an actual gap inserted by the style used and not a paragraph marker. One paragraph mark is fine and will leave you with a normal paragraph break. But any additional paragraph marks will not leave you with additional spacing. Remember to switch show paragraph marks off after you have checked.
  5. Now you’re ready to convert your docx to epub.

The ebook conversion process: (produce epub and mobi)

  1. Open calibre and click Add Books > Add books from a single directory – select and add your docx file.
  2. With the docx file highlighted select Convert books > Convert individually.
  3. Metadata : The conversion window opens with the metadata tab in the left pane selected.
    1. Input format (top left of conversion screen) > docx. Output format (top right) > epub.
    2. Enter title, author name (last name, first name), etc. You can also enter the synopsis in the box on the right.
    3. Select and import your cover image (there may be another image within the Calibre library there, but once you select the cover, the correct one will replace it).
  4. Page Setup: Input profile – for docx it is the default input profile. As you initially want to convert to an epub, the best output profile to choose for a general all-purpose EPUB that will work everywhere is the Sony Reader (The profile description can change if your mouse arrow just touches another profile, so make sure this is what you see in the profile description box: This profile is intended for the Sony PRS line. The 500/505/600/700 etc. [Screen size 590 x 775 pixels.]).
  5. Table of Contents: select this from the left panel of the conversion window. I select ‘Do not add detected chapters to the TOC’ (because I already include a TOC in my word docx). But select the appropriate option from the top 3 for your book. If you want to edit any of the TOC, you should also select Manually fine tune the TOC after the conversion is completed towards the bottom of the screen. Here is a blog post about how to edit the TOC. You can also add the TOC edit button to your toolbar and select it to edit the TOC of an ebook that you have already created.
  6. Epub Out: Here I tick preserve cover aspect ratio.
  7. OK: click this at the bottom of the window, then watch at the lower left of the window as the epub builds.
  8. Open and test the epub: In the main window, right hand pane, click on the epub to open it in the Calibre ebook reader. Test it and all the links. In particular, test all your hyperlinks in the epub.
    1.  I prefer to open and test the epub in Adobe Digital Editions for desktop, which is a free download. Open ADE, click on the library drop down arrow and select add item to library. Browse to the epub and open it. Or if ADE is the default to open epubs, open the path to the epub folder in the right hand pane of Calibre, and double click on the epub. Look through it and test the hyperlinks to satisfy yourself that all is ok. Also click on the bookshelf symbol in ADE to ensure that the cover thumbnail of the epub is displayed.
    2. If you have an epub reader, you can also upload the file to that and test it.
  9. Validate the epub in the online version of epub validator: Just upload the epub file to the website and click validate. If you have followed the above steps, your epub should pass.
  10. What if errors are detected? If you have formatted your docx correctly using styles, you are unlikely to have errors show up in the epub validation (if that is you, then you can ignore steps 10 and 11). But if errors are detected, download and open the epub in Sigil. Then just save it in Sigil, and this will correct any common errors (this is because Sigil currently includes HTML Tidy and runs it on your HTML files before loading them. This usually fixes any problems, but it’s not perfect). You can validate it in Sigil by clicking the big green tick on the far right of the toolbar. But even if it passes, you should still validate in the online validator which may pick up errors that Sigil is unable to detect or correct automatically.
  11. Still errors? If you have followed the steps above, particularly in regard to setting up your word document, you should find your epub passes the online validation. But if there are errors, these are the most likely and what you should do:
    1. vlink= change to id= (warning: attribute ‘vlink’ is not declared for element ‘body’)
    2. link= change to id= (warning: attribute ‘link’ is not declared for element ‘body’) – be careful that you don’t delete xlink= etc, so you may have to do individual find and replace.
    3. clear= changed to id= (warning: attribute ‘clear’ is not declared for element ‘br’)
    4. target=‘_blank’ delete it, as id=‘blank’ will not work either, and there is no need to use this in an ebook to specify open a webpage in a new tab. (warning: attribute ‘target’ is not declared for element ‘a’)
    5. border=’0’ delete it, as id=’0’ will not work either (warning: attribute ‘border’ is not declared for element ‘img’)

From epub to Mobi:

The opinions that I have found so far and my own experience suggests that for kindle ereaders, you will get better results if you convert to the old style mobi format rather than the newer AZW3. However, there is a problem in displaying the thumbnail image of a mobi file converted from Calibre due to some kind of conflict with the Kindle software. The people at Calibre believe it is due to a problem in the Amazon software and advise about it and a work around at this link. I will outline three methods, including the work around, below:

  1. For those of you publishing via Amazon (you should also be able to do this at some of the ebook aggregators such as Draft2Digital), just upload the epub that you created in Calibre and a cover image to your Amazon dashboard, and then download and check the mobi file that is produced there. If you are not ready to publish it or use it to replace an existing ebook, upload as a new ebook, just fill in the title, author name, and upload the files. Then once you have downloaded your copy you can save it as a draft to your Amazon KDP dashboard.
  2. For those of you converting for personal use who do not have access to the Amazon KDP converter, you can convert the epub to mobi as normal if you are okay not seeing a thumbnail cover image.
    1. Open Calibre and select the file to convert.
    2. Convert document > convert individually
    3. Metadata Tab: Input format (top left of conversion screen) > epub. Output format (top right) > Mobi
    4. Page Setup: Output Profile > Kindle. Input Profile > Sony Reader
    5. Table of contents: Select options based on previous advice
    6. Mobi Output: Tick do not add Table of Contents to this book (if you already have a TOC inserted in the document). Mobi file type = old.
    7. OK: Wait until the file has been built, then check it by opening in Calibre’s reader or a kindle. You will note that in Kindle for desktop and some other kindles that the thumbnail image is missing, but otherwise the file should work fine.
  3. If you want to see the thumbnail cover when the mobi is on Kindle for PC and some kindles, then follow step 2 above, but when you get to the Mobi Output step, you should also tick: Enable sharing of book content via Facebook etc. Note that this is a compromise which will disable last read syncing on some devices.

That’s all there is to it. Now if only those smart guys and gals over at Calibre would develop a program to tap into the stories in my head and convert them into ebook format as quickly and as accurately as this current version did with my docx file, then I swear I’d have to propose to one of them immediately.

What’s your favourite ebook converter, and why?


About georgehamilton

George Hamilton likes to know what’s going on around the world, to delve into the customs and practices of different cultures, and this is often a feature of his novels. His tales are based on people's intense personal or family dramas, with major social or political events strongly impacting their story. In addition to World Literature, he also writes multi-genre novels which include: Historical, Suspense/Thriller, and Contemporary. He currently lives in London, England.
This entry was posted in ebooks, Indie Publishing and tagged , , , , , , , , , , , , , . Bookmark the permalink.

9 Responses to Calibre’s great conversion of docx into ebooks

  1. sjtang says:

    This was amazingly helpful, thank you for explaining this!

  2. Jack says:

    I want to convert Arabic text with Calibre, but no matter what I try, the epub always justifies left to right, instead of right to left. I tried aligning the text in Word, then using styles as you recommended, and finally also CSS in the “Look & Feel” options in Calibre.
    Any suggestions?

  3. Pingback: On Self-Publishing: Thoughts and Reflections | Andrea Lundgren

  4. Kelcy says:

    Hi George,
    I use Alkinea ( it’s a free software that converts OpenOffice files to Kindle and ePub. Very easy to use, automatically creates a valid TOC, includes pictures, drop caps, etc. No HTML to learn!
    Good writing!

    • Thanks for suggesting Alkinea, Kelcy. I had never heard of it, but I know there are many writers out there who use LibreOffice and will probably find it useful. When I have a little time I’ll convert one of my docx files to odt and check out how well Alkinea converts it to an ebook.

  5. Katie Elle says:

    If you create your own TOC and tell it not to use detected chapters, does it detect that and create an NCX file? I generally tell it to use H1 to create the TOC.

    • Hi Katie,
      I generally don’t include chapters in my TOC, as many have said just having links to chapters 1, 2 etc is not very useful, unless your chapters have actual titles. But anything you include in your TOC will be detected and included in an NCX file. If you create the epub and then open it with Sigil, you will see the NCX file. The way to create the TOC in your word docx is to bookmark the places you want to link to from the TOC. Then insert the headings, chapters etc at the TOC and hyperlink to the bookmarks. Good luck!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s