How To Edit An EPub File

eBooks in Epub format are among the most popular reading formats today. So, learning how to properly create and edit them as a self-published author is vital to your continued success. There are loads of resources that will offer you the opportunity of creating EPub files but not many places talk about how to edit an EPub file. 

Today we change that, as we take a deep dive into the world of EPub. We’ll discuss what it is as well as explore multiple ways to get it edited if you find you need to make changes after you’ve made the file.

Let’s get to it!

How To Edit An Epub File

So, How Do You Edit An EPub File?

So, How Do You Edit An Epub File?

To edit an EPub file you have to first convert it back to its original format and then find the required content file that can be edited in a text or HTML editor. This can be done manually or using conversion software, both of which we will discuss in detail below. 

How To Edit An EPub File Manually

How To Edit An Epub File Manually

To get it done manually follow these steps:

  1. Locate the ePub file within the file explorer section of your computer.
  2. Rename the .epub file extension to .zip 
  3. Open the zip file to view its folders, XML files, and XHTML files.
  4. Locate the content file you want then open it in any browser or text editor of your choice to edit. 

You can also copy and paste the text from here into any other word-processing software for more advanced formatting or editing. This is ideal for people who want to either edit an existing epub file, use the content within the epub to create another document, or evolve it further

into another ebook. 

Many publishers find this method useful when republishing public domain books that are available in epub formats to edit and add additional content inside. Once your edits have been made, simply change the file extension from zip and back to epub. 

What File Should You Edit In The EPub?

The package file is the most important file to look for. It describes the entire book. Unfortunately, there is no fixed location for the package file.

However, it is mostly found within the container.xml file, which is located within the META-INF folder. This package file is what you will need to open up in your preferred text editor. 

How To Edit The EPub Package File 

Once you have the package file open, run a search for the term <manifest>. You’ll notice that there is an index or list of items directly under it, ending with </manifest>. This list shows all the assets (images, chapters, etc) within the EPub file, each with an explicitly defined path.

It is important to note that chapters have a media-type value of "application/xhtml+xml", which differentiates them from other asset types. Chapter content (or even titles) cannot be viewed without opening each chapter. 

To open the document in your text editor, use the path defined for each chapter item.

Make the necessary edits.

Don't forget to save it when you're done. It's that simple!

How To Edit EPub Files Using Calibre

How To Edit Epub Files Using Calibre

Calibre is an easy-to-use e-book manager that offers a wealth of features. It acts as an ultimate one-stop e-book tool, giving users the ability to do nearly anything they need to do while creating, editing, and exporting ebooks.

Best of all, it is currently open source, making it totally free to use for both personal and professional use.

With Calibre, you can edit EPUB and AZW3 (Kindle) books using the integrated e-book editor. As you make changes, the editor updates a live preview of the HTML and CSS used within the book files.

Additionally, it contains various automated tools for cleaning and fixing common problems.

Simply select Edit Book from the right-click menu on any book in Calibre to take advantage of this feature.

How Do You Edit Specific Lines In An EPub File Using Calibe?

Using Calibre’s book editor, you can search and replace text anywhere in the current file, across all files, or even in a marked area within the current file. You can perform a normal search or use regular expressions to search. 

To do this, simply:

  1. Use the Search box to begin the Search and Replace function
  2. Fill in the Find & Replace boxes (this will only work when editing a CSS or HTML file).
  3. Choose between Finding the next match, replacing the current match, or replacing all matches.
  4. Navigate through the results in the current file, style files, text files, or all files by using the drop-down menu at the bottom of the box.
    Alternatively, you can search using a normal search (string) regular expression (regex).

To jump to a specific line in the active editor:

  1. Select Search 
  2. Then Go to line.

To count the matches found in a search expression:

  1. Select Search 
  2. Then choose Count all. 

The result will only include what was found in the selected files/regions.

Can You Use Calibre To Add Images or New Fonts Into An EPub File?


To add new fonts, stylesheets, images, etc. from your storage device or computer into the EPub file: 

  1. Click File
  2. Select  New file. 
  3. Next select Import Resource File to import a file OR click “Create A New Blank HTML or Stylesheet
  4. Enter the file name of the file you wish to import.

If adding multiple files into your Epub file at once:

  1. Click File
  2. Then select Import Files Into Book

Can You Use Microsoft Word To Edit An EPub File?

Can You Use Microsoft Word To Edit An Epub File?

Yes, but only after conversion. The ePub format is not currently supported by Word.

Getting your ePub file to be editable in Word requires two steps.

First, download and install the Calibre mentioned above. When Calibre is running, click the Add button to select the ePub file for input, and then click Convert Books.

Select Docx as the output format in the top right corner of the conversion dialog, and click OK. You will find the output file in the Calibre Library folder you designated during installation.

The Docx file can now be opened in Word. 

Note: Converting and editing existing ebooks can breach copyright laws. Be sure to triple-check that the book you are converting or editing is in the public domain or allows conversion if you are not the original owner of the file.