How to Make an Ebook – From Kindle/mobi ebook to Epub

This guide is split up into three phases: a prep, task, and wrap phase as suggested by some time management experts.


Epub Formatting Kindle to Epub Prep Phase

NOTE: This Epub formatting guide will use a Kindle file you may have made here or elsewhere as the foundation. If you want to start with epub formatting from scratch, head to the other epub formatting guide on my website for that.

Step 1: Ready the Kindle version folder of your book or project, the same folder we used to create the Kindle book.

  • This will be the base from which we will create our epub file. It’s basically the same except for a few tweaks.

Step 2: Create new ePub Folder

  • Right click on the Desktop screen and click New Folder. Name it whatever you want, but the way I do it is to name it with the title of book or its initials and add “epub” at the end.
  • Some people create an ibooks version and a general epub version (I do that). iBooks doesn’t approve books with names of other retailers in the source file so if say, your back matter asks for reviews for different sites that accept epubs or if you’re advertising books from different sites than it’s best to create separate iBooks and general epub editions. Name them appropriately if so.
  • Save on the Desktop for easy referral. This makes the file a lot easier to find for the formatting program. This Tutorial assumes you saved it to the Desktop.

Step 3: Create Directory in ePub Folder

  • It’s easier than it sounds. Follow these instructions exactly or else there might be formatting issues. Make sure to capitalize or not capitalize when needed to.
  • Inside ePub Folder, create a new folder titled: OEBPS
  • Inside ePub Folder, create another folder named: META-INF

Step 4: From the Kindle version folder, copy and paste the Font, images, stylesheet, Text, opf file, and toc.ncx file into the OEBPS Folder.

  • Everything found in the Kindle version folder should be in the OEBPS folder.
  • We will modify this in the Task Phase.

Step 5: Create container.xml file

  • Open Notepad++ and create a file named container.xml. Don’t forget the file extension.
  • Head to bbebooksthailand.com (scroll down to the bottom of website, click Developers link, click on Epub 2.0.1 Boilerplate), copy template. You can also copy and paste this one (use Kindle for PC to copy and paste):

    <?xml version=”1.0″ encoding=”UTF-8″?>

    <container version=”1.0″ xmlns=”urn:oasis:names:tc:opendocument:xmlns:container”>

    <rootfiles>

    <rootfile full-path=”OEBPS/insertnamehere.opf” media-type=”application/oebps-package+xml”/> </rootfiles>

    </container>

    Modify the rootpath to the name of your opf file (third pacman symbol line). Since the file path is the same, put your file name after OEBPS/ in OEBPS/insertnamehere.opf.

Step 6: Create mimetype file.

  • Open Notepad++, create a new file and save as mimetype. The mimetype should be among the META-INF and OEBPS folders and not inside them.
  • Make sure it’s just the word “mimetype” (without quotations) – Notepad adds a .txt file extension at the end. Get rid of it.
  • Make sure there’s no .txt file extension. It wont work if it’s a txt file.
  • In the first line of mimetype file, put in these words:

    application/epub+zip

    Has to be exactly 21 characters. Copy it exactly with no misspellings of errors.

  • The application/epub+zip can also be found at the bbebooksthailand.com site also under Developers and Epub 2.0.1 Boilerplate.

Step 7: We have now created the ePub Folder!

Step 8: Download and install zip.exe into your computer.

  • This will allow us to create epub files using command line DOS.
  • Found at stahlworks.com. in the line where it says “to create zip files on the command line.”
  • There are tutorials on the internet on how to  use the command line. Make sure you know how to use the command line because we’ll be using it to create the epub file.
  • Put zip.exe program in the Computer File or wherever you wish. I like to put it in the computer file for easy reference.
  • You can put the program wherever you want, but then you’ll have to direct the command line to wherever it is you put it, possibly having to scour through more folders.

Step 9: Download Adobe Digital Editions

Step 10: Prep phase is complete. Optional break here.

Epub Formatting Kindle to Epub Task Phase

Step 1: Create Cover HTML file

  • Unlike Kindle, ePub needs the cover specifically as an html file.
  • Open Notepad++, create cover html. Name it something like part0.html so as not to mess with the numbering of the html files but you can also name it however you want.
  • This html file needs a specific epub Doc type declaration. This Doc type declaration should only be for the cover page html. Use the regular Doc type declaration for all other html files:

    <?xml version=”1.0″ encoding=”UTF-8″ ?>

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN” “http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”>

    <html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>

    <head>

    <meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=utf-8″ />

    <title>My eBook</title>

    <style type=”text/css”>

    body {text-align: center; padding:0; margin: 0;}

    div {text-align: center; padding:0; margin: 0;}

    img {padding:0; margin: 0; height: 100%;}

    </style>

    </head>

    <body>

    <div><img src=”cover.jpg” alt=”Cover for My eBook” /></div>

    </body>

    </html>

    If you named your cover other than cover.jpg, then go and change cover.jpg whatever your cover name is: insertcovernamehere.jpg.

  • Save this file in the Text folder inside the OEBPS Folder along with the other html book files.

Step 2: Alter HTML Table of Contents if needed. Mine tend to look like the Kindle versions unless you changed anything. I don’t put the cover page in the Table of Contents for the epub version. The NCX Table of Contents will include the Cover, but we’ll do that later.

Step 3: Modify opf file

  • Open the opf file in Notepad++
  • Get new uuid number for epub version.
  • Put new uuid number in the allotted slot.
  • Add cover html file into the manifest, spine by following the next set of instructions:
  • Add this to the Manifest:

    <item id=”part0.html” media-type=”application/xhtml+xml” href=”Text/part0.html” />

    If you named it other than part0.html, then insert the name of your html on the quoted parts of item id and href.

    Add this to the spine:

    <itemref idref=”part0.html” />

    Again, change name of the html file if needed.

    Add this to the Guide:

    <reference type=”cover” title=”Cover” href=”Text/part0.html” />

    Modify if needed especially if you named it other than “cover” on reference type and part0.html. The “cover” points to the cover of your epub.

Step 4: Modify ncx file

  • Open the ncx file in Notepad++.
  • Put new uuid number in the allotted slot.
  • In the navMap, add the cover html as the first in the Play order.
  • Re-number the playOrder to correspond with the new order. The epub NCX should have one more in the Play Order compared to the Kindle NCX Table of Contents.

Step 5: Open command line program and run zip.exe

  • Click on the Start Button (the windows logo on a PC) and on the search bar, type cmd.
  • The command line DOS program opens up.

Step 6: Input commands to make epub file (the commands are different depending on where put zip.exe. The tutorial here assumes you put in the computer file. If you did put it somewhere else, change the command line directory accordingly)

  • Type cd Desktop. Should look like this:
  • Type cd name of your folder. The command depends on the name of your epub folder. For this ebook, it looks like this:
  • Type dir/w. This will list the contents of the file. Example:
  • Type c:\zip\zip.exe nameofebook.epub -DX0 mimetypeType exactly except for the name of your epub book, usually the title of the ebook or a variation of it.
  • Next, type c:\zip\zip.exe insertnameofebookhere.epub -rDX9 META-INF OEBPS
  • If all goes well, you have now created your epub ebook. Head to Troubleshooting if you’re having trouble.

Step 7: Check the directory folder for epub book.

  • The created epub book should be in the directory of your book’s epub folder along with the mimetype and the META-INF and OEBPS folders.

Step 8: You have made the epub!

Epub Formatting Kindle to Epub Wrap Phase

Step 1: Look over epub on Adobe Digital Editions

  • Double check your work. Make sure there are no issues.
  • If you find typos, you have to correct it in the source file.
  • You’ll have to run the command line DOS again to create a new epub file if you made any changes.

Step 2: Double check Links

  • Make sure there aren’t any dead outside or internal links. When you click on a link, it should take you where you need to go. If there’s any problems, it can be something as simple as typing the wrong thing in the link. It is so easy to be careless and make such an error. I’ve done it, but it’s an easy fix.
  • You’ll have to run the command line DOS again to create new epub file if you make any changes.

Step 3: Validate on Epub Validator. If it checks out, continue on to Step 4. If not, see Troubleshooting.

Step 4: Hooray, epub is finished!

Step 5: Upload on e-retailer websites

  • iBooks, Nook, and Kobo are the big ones for epub.
  • I recommend Draft2Digital if you’re using an aggregator to upload your epub to the various retailers all at once. They take 10% off of royalties for the convenience.
Loading