Ebook Formatting the Easy Way

So I kind of take the whole DIY indie publishing to the extreme compared to a lot of authors. I do my own editing and proofreading, create my own covers, and format my own books. It helps that I have a background in each of those areas, through various jobs I’ve held over the years (I copyedited for a small publisher and I’ve done some freelance copyediting; I have a background in print design for a national magazine, including cover design; and I’ve done plenty of web design and coding, so hand-coding the HTML files for formatting is easy, if also tedious). Now I realize that  not everyone is going to have the skills (or the desire) to do all of the above on their own. Personally, I enjoy doing it, and until someone complains about a lack of editing or bad formatting or a crappy cover, I’m going to keep doing all of those things myself.

But I’ve been looking for a better way to format my ebooks. While I know how to format and code by hand, it’s still a long, tedious process. It’s not exactly what I’d call “fun”. And the constant tweaking it seemed to require to get the books absolutely perfect was getting time-consuming.

I’m about to publish my first full-length novel (The Steam and Steel Chronicles have all been novellas), and the prospect of having to format an ebook roughly three times longer than the ones I’ve done before wasn’t appealing. I wanted to find a shortcut that would make it easier and faster to create perfectly formatted ebooks.

I think I’ve found the solution, and since it requires very little hand coding or other technical know-how, I decided to write up a tutorial (note: I wrote this tutorial at 1 AM, so if any of it doesn’t make sense, let me know and I’ll try to clarify). While you might not have the skills necessary to proofread your own books or design your own covers, I’m pretty confident that nearly anyone who can format a manuscript in a word processor can format their own ebooks using two simple, free tools.

First things first: you’ll need a clean manuscript copy of your book. This means that basically all the formatting should be removed other than italics and scene breaks. If you have to (and if you don’t mind redoing any italics you might have), save the whole thing as a plain text file. That will strip basically all but the most basic formatting from your file.

Now that you have a clean file, you’ll need to go download two free pieces of software. The first is Sigil, which is an open source, WYSIWYG (What You See Is What You Get) ePub formatter. The second is Calibre, a free ebook library manager and converter. These two simple bits of software are all that are required to create both ePub and MOBI book files (ePub works for Barnes & Noble’s PubIt! and Apple’s iBooks, while MOBI is what you’ll need for Kindle). Both programs are available for Mac, Windows, and Linux systems.

The first thing you’ll want to do is start a new project in Sigil. You’ll get an interface that looks like this:

You need to create a separate file for each chapter in your book. Open up your cleaned-up manuscript file, and copy and paste your first chapter into the Sigil window. Make sure you’re in WYSIWYG mode (you’ll see in the top row that the open book is highlighted, not the book with brackets or just the brackets), and not in code mode.

For your chapter title, you’ll want to format it as a Heading 1 (which creates an “H1” tag in the HTML). Place your cursor anywhere within the title, and then click on the drop-down menu in the upper left and select Heading 1. You’ll see that your title is now larger and bold.

One thing you may notice about Sigil is that rather than indenting each paragraph, it adds extra space between them. Don’t worry about this right now. We’ll be using Calibre later to get rid of those extra spaces and add indents.

Create a new item for chapter two (right click under the Text folder and select “Add new item”), and repeat the process. Do this for each chapter, and don’t forget to format your chapter titles as Heading 1. You might also opt to center your titles, which is done the same way you’d do it in a word processor (the second row of icons in the toolbar are almost all exactly like word processor controls, with the exception of the last two, the broom and the green check mark).

Now that you have all of your chapters in Sigil, it’s time to add things like front matter, acknowledgements, and a cover. To do this, first add a new item like you did with the chapters. For simplicity sake, right click on the new item and rename it as “Cover”. Drag and drop it to the top of the file list. Then right click on it again and go to “Add Semantics”, and then click on “Cover”. This tells the ePub reader that this is your cover. (Sorry, the image below shows adding semantics for the title page rather than the cover, but you can see where you’d select cover instead.)

Now, go to Insert, and then select “Image”. Find your cover image and place that on the Cover page.

For your front matter, do the same as you did for the cover, creating a new file, renaming it and moving it to the top (just below the cover file). Under “Add Semantics”, select the appropriate page type and then enter the appropriate information in the file. For my own books, I keep things simple, only adding a title page that includes the name of the book, my name, a copyright statement, and a “Published by” statement. I also include links to my Twitter account, website, and publisher website. You can format these things by using the Heading 1, Heading 2, Heading 3, etc. in the upper left drop down menu.

I also like to add an acknowledgements page to the end of the book. You do this in the same way, but just leave it at the bottom of the file list rather than moving it to the top.

So, now you have all of your material in the correct format within Sigil. Time to create your table of contents. Go to “Tools” and select “TOC Editor”. You’ll see every heading in your book listed here, with a check box next to each one. Uncheck the boxes beside any of your front matter headings, but leave the chapter headings. This creates the interactive table of contents the ebook reader will use.

The final thing you need to do is edit the Meta information for your book. Click on “Tools” and then “Meta Editor”. Enter the title, author, and language of your book in the dialogue box and click okay.

You may want to validate your ePub file at this point to make sure there are no errors. To do this, just click on the green check mark in the toolbar.

When you have all of this completed, make sure you save your file again (you should make a habit of saving regularly throughout the ebook formatting process, just in case your computer crashes, your power goes out, etc.).

Now, at this point the whole process to this point only took me about an hour.

Go ahead and look at your ePub file in an ereader (I use Adobe Digital Editions on my computer, but any ePub reader will work). Make sure that there’s nothing strange going on with your formatting (remember, we’ll be taking care of the extra space between paragraphs and line indents in Calibre, so don’t worry about those). If everything above was done properly, you should have a perfectly readable ePub file.

Next, open Calibre and import your book (you can just drag and drop the ePub file you created into the main window in Calibre).

Right-click on the book and go to “Edit metadata” and then “Edit metadata individually”. Here, you should see most of the fields already filled in and your cover displayed. The only field you want to add is the Publisher field (if you have a publishing company set up). Click OK.

Right-click on the book again and go to “Convert books” and then “Convert individually”. Make sure “EPUB” is selected in the “Output format” drop down. You can verify your metadata here, too. Then click on “Look & Feel”. Here you’ll want to check the box next to “Remove spacing between paragraphs” and enter an Indent size of 1.5 em. You might also want to adjust the “Minimum line height” (I prefer 140.0% over the standard 120.0%).

Next, click on “Page Setup”. Here you can choose your input profile and output profile. I leave the Default Input Profile selected and then generally choose iPad for the Output profile, because it uses a larger cover image size.

Click on “Structure Detection” next. Under “Insert page breaks before (XPath expression):”, click on the magic wand. Then select h1 from the “Match HTML tags with tag name”.

Click on “Table of Contents” and then under “Level 1 TOC (XPath expression):” click on the magic wand and again select h1 from the “Match HTML tags with tag name”. UPDATE: One of my readers (see the comments) has since tried the conversion without doing this step and confirms that it seems to work fine.

You shouldn’t need to adjust the standard settings on any of the other option pages. When you’re done with all of these, click on OK. The dialog box will disappear, but if you look at the lower right of the main Calibre window, you’ll see that there’s a Job processing with a spinning wheel.

You can then right-click on the book title again and choose “Save to disk” and then “Save ONLY ePub format to disk”.

Open up your new ePub file and make sure all the formatting is correct. At this point, I sometimes tweak the formatting to get it just right (open it back up with Sigil to do this), but that requires HTML and CSS code editing. If you know how to edit code, now is the time to make adjustments. If you don’t, then you’ll probably just want to leave the ebook as-is. You might find that Calibre has re-inserted TOC elements that weren’t in the original ePub file that you imported (like your title page elements). You can edit those back out using Sigil, with the TOC Editor. Honestly, I think you can leave the TOC stuff blank in Calibre, since it’s already been defined with Sigil, but I’m not sure and I didn’t feel like experimenting with it late last night when I was converting the ebook. If anyone can confirm this, let me know in the comments. I’ll check next time I’m doing a conversion and update this if the above isn’t necessary. But in either case, it doesn’t really hurt anything.

When you’re happy with the way your ePub file is displaying, then re-import it to Calibre (if you made changes) and output to MOBI using the same process you used for ePub, but with “MOBI” selected in the “Output format” dialog box.

Open up your exported MOBI file with the Kindle app and make sure all the formatting is as it should be.

That’s all there is to it! Even without tweaking the code at all, you can create a very well-formatted, very readable ebook using only free tools.

A More Advanced Formatting Option

Now, if you want to add some slightly fancier formatting to your ebook, you’re going to need to know some very basic HTML and CSS. If you’ve never used either, I’d recommend doing a few tutorials to get a feel for how they work before you start tweaking your ebooks. If you decide to dive right in, then let me first warn you that it’s a good idea to always work from a copy, so that if you foul things up, you’ll still have your original.

One thing you’ll notice with my ebooks is that the first four words of each scene are done in small caps, and the lines aren’t indented. This is a pretty easy one to do, though it’s time-consuming. This should be done in your original ePub file, before you convert it with Calibre the first time.

All you do to achieve this effect is capitalize the first four words (manually, not with CSS), and then add <small> tags around the letters that would be small caps (so leave out the first letter of the sentence, as well as the first letter of any proper nouns). Voila! That’s all there is to creating small caps.

Now, to get the first paragraph to be flush left rather than indented, you’ll need to create a new CSS class after Calibre has done it’s conversion. All I do is create another “Calibre#” class, in numerical order from the highest class already created. In this case, that was “Calibre9”. Copy and paste your “Calibre1” class (or whatever your main paragraph class is) and rename it “Calibre9”. Then, delete the text-indent element. All you have to do from there is go through and change all the non-indented paragraphs from “Calibre1” to “Calibre9”. Like I said, it’s not a complicated thing to do, but it can be time-consuming.

There’s nothing that says you have to make this change, though, so don’t worry about it if you’re not comfortable editing the CSS and HTML of your files.

If you have questions about the process or run into any problems, let me know in the comments and I’ll try to help. Because Sigil and Calibre are both free, open source programs, they’re not without their glitches. Take time to play around in each, using the WYSIWYG features to create more complex ebook layouts. Just make sure you thoroughly test your files when you’re done to make sure you haven’t created features that don’t work (or don’t look very good) in the final product. Make sure you also validate you ePub file, too! If it’s not validated, you won’t be able to sell it on some platforms, including the iBooks store.

If you found the above useful, the best thanks you can give me is to buy one of my books, or recommend them to a friend!

I don't get paid for the content on this site, so if you find it useful, consider a donation.

60 thoughts on “Ebook Formatting the Easy Way

  1. I tried it without the ToC step in Calibre, and it seems to work fine (checked on iBooks, Adobe Digital Editions, and Kindle). I’m going to keep playing with it to find my own favorite tweaks. :) Thanks!

    • That’s great to hear! I’ll update the post when I’m back at my computer rather than on my phone.

  2. Thanks for the awesome tutorial, Cameron. I’ve had a little trouble in the past with stray code creeping into my ebooks, so I’m going to try this for my next book. Consider this page bookmarked :)

  3. Cameron,

    This is a great tutorial, and I’ve never tried using SIGIL before. I usually do everything in XHTML on my text editor. One trick I’ve found with Calibre is to preserve the aspect ratio on your cover. If you open your EPUB file in Adobe Digital Editions the cover gets all stretched out.

    In the conversion menu on Calibre, click on EPUB output and then check “Preserve Cover Aspect ratio”. It’s off by default.

    Not long ago, I made some video tutorials of eBook formatting if you’re interested.

    • Thanks for the link Paul. I’d never used Sigil prior to this last book (I always hand-coded everything, too), but wanted to find something that was quicker and easier for non-tech people. Plus, it cuts down on the time necessary to properly format the book, which is a big deal to me. I’d much rather spend three hours formatting a book than six or eight.

  4. Hi Cameron,
    This is my first trip into the ebook world, so you can safely say that much is confusing. I have found I have to know the answer BEFORE I ask it, and that makes things even more confusing. Ok, so here’s goes -:)

    My ebook is a short guide of 32 pages cover to cover. So, I am not looking to make it available on Kindle or any other reader right now. My plan is to make it available as a pdf. and downloadable to their pc once payment is received on my end. In the Output Profile and Input Profile what should I indicate? Anything else I need to know that I nave not asked, please let me know. Thanks for this tutorial, and especially for answering and any input.


  5. Pingback: Left Brain Exercise: eBook Formatting « Judith Gaines

  6. First off, thank you for this wonderful post!

    I got Sigil up and running (love it) but I can’t get Calibre to download on either one of my computers. I contacted the Calibre guys, and even with their suggestions (turn off security, etc), it didn’t work–do you know of any other software similar to Calibre?

    • I haven’t personally used anything similar to Calibre. Sorry. Maybe someone else will come along with an idea for you, though.

  7. Oh, thank you for this. I did successfully manage to encode the first half of my book through XHTML and CSS, but it took foreeeeeeeeeeever, and I’m hoping using Sigil may ease the process. I’m going to try this tonight.

    Thanks for putting this up!

  8. Pingback: Merrily We Roll Along « S.P. Blackmore

    • There’s no reliable way to do so with ebooks. Best case scenario, the reader changes it to the default text, and worst case scenario, half of the text gets changed by the reader and half of it doesn’t, making for a very unattractive reading experience (and sometimes affecting the overall readability of the text). If you have a book where you need to control the font, then I’d recommend only releasing it in PDF format. That’s the only sure-fire way to control fonts.

  9. This in an amazing tutorial. Can i ask for extra help? The spaces between the paragraphs don’t disappear even if i check the “Remove spacing between paragraphs” option in Calibre. What could I be doing wrong? I use iWork Pages to create the ePub, edit in Sigil and open in Calibre. Hope to hear from you!

    • I haven’t used Pages much for converting to ePub, but all I can guess is that rather than adding <p> tags around each paragraph, it’s adding two <br /> in between each paragraph. As far as how to remove those, the only way I can think of is to open the file in a text editor like TextWrangler (where you can see the code itself) and then do and find and replace. But what you’ll need to do with that is to search for the pair of <br /><br /> and replace them with </p><p>. You may have to add some paragraph tags in manually, too, or remove some that end up in their extraneously. The other option might be to export as HTML rather than ePub (and use Sigil to convert it) and see if that takes care of the problem.

      • Thanks Cameron. I’ve decided to abandon Pages (it messes up the ePub too much) and decided to work from scratch using Sigil. It’s amazing. Together with Calibre, my formatting woes are over. Well so far. :) Thanks so much for sharing this tutorial!

        • Yeah, that was the same issue I ran into the one time I tried to use Pages for ePub: it was just full of extraneous code that did nothing but cause problems. From what I’ve heard InDesign does a reasonably good job of formatting ePubs, though I haven’t really tried it myself (I only use InDesign for print layouts).

          • Hi Cameron,

            About the “flush left” coding, I’m a bit confused. Your article said you do it after Calibre? From Sigil I export the book to Calibre then to .mobi format.

            Help! :)


          • You use Calibre to convert your initial file into epub, then take it to Sigil to edit the code, then put it back into Calibre to export the final version to formats other than epub (.mobi, etc.).

          • Okay, I kind of figured it out. But how do you know what Calibre# to choose? I just keep replacing the numbers until something works. Although, it does make the paragraph flush-left but then…it adds a space before the second paragraph. The rest of paragraphs are fine. It’s just the space between the first two paragaphs. What could I be doing wrong? :)

      • Hi Cameron, thanks for sharing these useful tips. Instead of using Calibre, I’ve tried another free converter kitpdf.com which is a good alternative, free service and fast conversion, if you ever need alternative tools. Thanks!

  10. Pingback: Kinstant Formatter - Too good to be true?

  11. Hi Cameron-
    Thanks for the tutorial. I’m about to do my first eBook and was planning on using InDesign, since that’s what I’ll be using for the printed copy. We’ll see how that goes, or if I end up just copying the text over to Sigil.

    Do you also generate your own ISBN number, or do you get that from the vendor sites that sell your book?

    • I bought a block of 10 ISBNs a few years ago and am still using those (I only use them for the ePUB versions of my books). I haven’t decided yet whether I’ll buy more when I use them up or just start using the ones provided by the various platforms.

  12. I cant get my Sigil page to look like the one that you show. I don’tknow if it is in code mode or what? I am really really new at this. Very confusing. I have tried to do it step by step. Thanks for any help. You have done a great tutorial, I just can’t get it. I feel really stupid.

    • There are three views in Sigil, including a “normal” mode that shows the formatted text, and code view that shows the code, and split view that shows both. There are icons in the toolbar to switch between the three views. Hope that helps!

  13. Hi Cameron,

    I can’t seem to download Sigil. I have a powerbook g4 and that wouldn’t take it, so I tried to download Sigil on a Macbook and it downloaded but then wouldn’t open.

    Can you help?

    Many Thanks


    • I really don’t know why it might not have worked. The only advice I can give is to make sure you’re downloading the correct version and that it’s compatible with your OS.

  14. Pingback: RoW80 Check-In: June 10th/June 11th. « L.S. Engler

  15. Great instructions but I find I need some clarification.
    Here is the first issue:
    7. Create new item for chapter 2. Right click under Text folder,. Select “Add new item”. [But I find only “Add existing file” This takes me to folders where I can select the txt file for the whole book, but I want only chapter 2. I double click on the file but nothing changes in Sigil. Don’t I have to save Chapter 1 as a file? How do I do that? Where is “Add new item”? Need very specific instructions as where to click on these items. Like you say “] ”
    Right click under the TXT folder” Under the TXT folder ”
    That would be “Section 0001.xhmtl” Is that what I click on? If so it gives me the “Add existing file” option not “Add new item”.

    Before that is ” Make sure you’re in WYSIWYG mode (you’ll see in the top row that the open book is highlighted, not the book with brackets or just the brackets), and not in code mode.” I see in the top row “untitled.epub*” is that what you are referring to?

    I am sure I will find other questions. Thanks for any help. Rod

  16. Pingback: The Bunnies Have Arrived! « L.S. Engler

  17. Thank you so much for this. The idea of formatting our ebook was beyond daunting but with this guide I’m sure we can do it.

    Thank you again.

  18. Hi Cameron,

    If I just want to format and then output it as a PDF can I do that? I am a newbie to this.. and what I was planning on doing is painstakingly using Word and fighting with it to make it work.
    Also: Can I insert images in the SIGIL formating process.


    • If you’re just going to do a PDF, I would do it in Word or some other word processor or layout program. This is really overkill for doing a simple PDF.

      And yes, you can add an image with Sigil.

  19. Thanks for this advice, Cameron. I followed it to the letter and have now published my first short novel ‘North End’ on Amazon. Thanks again.

    • Footnotes are the bane of my existence when it comes to formatting ebooks. The best workaround I’ve found is to change them to endnotes (either for the entire book or each chapter). Then, insert a superscript number in the text for each endnote, and hyperlink it to the anchored note at the end. It’s a huge pain to do, but seems to work best as far as device cross-compatibility goes.

  20. This guide was a HUGE help. Working in Sigil gets exhausting (going back through add the italics I needed and whatnot), but this guide was clear and concise, and I got all the formats I needed! Thanks!

  21. Hope this isnt a dumb question, but if your manuscript is in InDesign and you can export to an ePub, do you need to do anything else to it?

    • Not a dumb question at all! Theoretically, you shouldn’t have to do anything, other than possibly import it into Calibre to convert it to other formats (if you want to). But there are too many variables to say for sure. I’d say test it on a couple different devices and go from there.

  22. Hi Cameron –
    I am wondering – do these tools work on all eReaders? I had someone try to format my book (he lives abroad) and it looked great for him on his Kindle Previewer on his PC, but when I viewed it on my Kindle Touch, it was awful. So does these tools produce codes that works on most versions of EReaders, or have you had any complaints from readers with the formatting?

    Thanks for this detailed, very clear post by the way, I feel a little clearer about the whole process and I didn’t feel that way even after trying to watch videos on YouTube regarding these tools. Your tutorial definitely did the trick – thank you!


    • I haven’t run into formatting issues with the major e-readers using this method, but I haven’t tested them on everything yet. Usually, if they work fine on the device itself, then the computer app versions work fine, but the reverse isn’t necessarily true.

  23. First of all, thank you so much Cameron for creating this incredibly helpful guide. I got so much out of it, and your information really closed the gap in terms of what I needed to learn to create my ePub book.

    I’ve run into one problem though. The advice you give to use Calibre to create auto indents for the first line of each paragraph basically ruined the formatting of every bulleted or enumerated lists in my book. The first character of line 1 of every bullet is to the right of any text wrapped beneath it. I tried to take my ePub book back into Sigil and re-do my bulleted lists, but this gets ugly and has a scary tendency to create validation problems (I think by knocking a or other HTML coding element out of place).

    I know the right way to handle this is probably to introduce a special bullet style into my ePub’s CSS. But maybe there’s a better and simpler way that somebody knows about.

    My guess is that this would be easiest handled if Calibre introduces a feature to adjust bullets accordingly if a value above zero is put into its “Indent size:” option. But until this happens, does anyone have any idea of a painless way to restore proper formatting to my bullets? If this has to be done through modifying CSS, I’d really appreciate any spoon feeding anyone can provide. I’m out of my depth here!

    • As far as the indents go, you have to make sure your lists are formatted properly. That means they need to be identified as lists in the HTML (either ordered/numbered/”ol” or unordered/bulleted/”ul”), rather than paragraphs. That should solve the problem. Sorry for the delay in replying!

  24. Cameron, This article is a pot of gold, and thank you for being so detailed. I’m about to begin the eBook formatting process now, but I have a question: I’m formatting poetry (80-100 pages), which is, ironically, a bit trickier to format than novels. Do you think the strategy would be to consider each poem a “chapter” (using your guidance above)? Do you have any advice regarding formatting poetry versus novels? A poem’s structure on the reader has to follow, a bit more closely, its structure on a page. Anyway, great post! Any advice/thoughts you have would be greatly appreciated.

    • I would do each poem as a separate chapter. I would probably also use line breaks (and double line breaks) rather than paragraphs, as it would be more likely to maintain formatting across devices.

  25. Pingback: Not a Tutorial: Linking to Superior Tutorials Because Mine Just Wasn’t as Good « The Unchained Scribe

  26. Hi Cameron,

    Great article – i did not know about Sigil. I will have to tell my husband he has competion now :-)
    He created a tool for me call Ultimate Ebook Creator that I’ve been using for 4 months now. It’s pretty cool because you don’t need any 3rd party software. And the formatting is probably the best I have found.

    Let me go tell him – probably p** him off but hey that’s me right!!


  27. Hi Cameron – great advice – thanks for sharing. Maybe I’m missing something, but how to know the page count? Surely this will depending on the size of the page and text you set up in Word right? So what should be the page setup and document setup in Word – page size, margins, point size etc?

    • Page count is irrelevant in ebooks, because the reader has control over things like font size, margins, and spacing, which changes the page count (or screen count, more accurately). Don’t worry about things like that, as you want your readers to have control.

  28. [My original post didn’t go through.] Just want to acknowledge that I appreciate you sharing your background of varied experience, how and why you choose to “do it all.” I, too, enjoy being able to do many or all parts of a project, but this is not one I thought I’d be taking on soon. A friend who doesn’t have the money to pay for the tediousness involved in what I thought this process might be has asked me to do this for her, and I’m glad to be able to do so with these instructions. The feeling of looking down an abyss of unknown while the person you’ve promised something to is saying, “I know you’ll do great!” gets a little old. lol This really helps me to at least structure my time with some level of real expectation.

    Thanks again!

  29. Hey Cameron:

    I really liked your article and thanks for teaching the New Authors about Sigil and Calibre as they are practically essential for doing a Modern EBook .

    Granted my own method is similar but I do my basic writing on Abiword and save the book file in HTML then I use ECUB to do my compiling and build my TOC.

    After that I use Sigil for my final editing and code check but I dont use Caliber to convert to MOBI as Amazon will do that for you if you like, But I do run the finished Book File thru FB Reader to make sure it reads ok and only after that do I send it on to Amazon,.

    But I really liked your article and good luck with your new book……

    C. Edward Royce.

  30. Hi Cameron:
    I’ve managed to get just about everything properly reformatted for my e-book, but I am having problems with the italic and bold italic versions of New Times Roman. I tried to find the solution on other tutorials and such, but the solution they suggested. Using ‘New Times Roman Italic’ in the font-family didn’t work completely. It only made the formatting so that it was italic, but not NTR. It fixed one issue but not both. I still haven’t fixed the bold italic one either. Any suggestions? Any idea what I am missing?

  31. My purpose is to publish for Kindle. I am already using Ultimate Ebook Creator. I am a little bit in doubt about image formatting within the content. Do you think that I’ll not get any image alignment and positioning issue with MOBI for Kindle?

  32. Pingback: An Introduction to Self-Publishing | S C Clarke

Leave a Reply

Your email address will not be published. Required fields are marked *