← toolkit.bot

How to Edit an EPUB File — Sigil, Calibre, and VS Code

An EPUB is a ZIP archive containing HTML, CSS, and image files. You can open and edit one in several ways depending on what you need to fix — from a simple heading tweak to a full layout overhaul.

What's actually inside an EPUB?

An EPUB file renamed to .zip can be extracted with any archive tool. Inside you'll find:

Option 1: Sigil (best dedicated EPUB editor — free)

Sigil is purpose-built for editing EPUB files. It is free, open source, and available for Windows, Mac, and Linux.

Best for: fixing heading structure, editing body text, correcting chapter titles, updating metadata, cleaning up CSS styling.

Option 2: Calibre's built-in editor

If you already have Calibre installed, it includes an EPUB editor.

  1. Right-click any book in your Calibre library
  2. Choose Edit book
  3. The editor opens with a file tree, HTML/CSS editor, and preview panel
  4. Similar to Sigil but with tighter Calibre integration (metadata syncs to your library)

Calibre's editor is less polished than Sigil for heavy editing but convenient if you're already in Calibre managing your library.

Option 3: VS Code or any text editor (manual)

For quick edits, you can work directly with the unzipped files:

  1. Rename book.epub to book.zip
  2. Extract the ZIP
  3. Edit the HTML/CSS files in VS Code (install the EPUB Viewer extension for preview)
  4. Re-ZIP the folder — but be careful: the mimetype file must be the first file in the archive and must not be compressed

The re-zipping step is fiddly. On macOS/Linux:

cd extracted_epub_folder
zip -X0 ../fixed.epub mimetype
zip -rX9 ../fixed.epub * --exclude mimetype

On Windows, use 7-Zip: add mimetype first with no compression, then add the rest.

Common things people edit in EPUBs

When manual editing is not the right tool

Manual editing in Sigil works well when you know exactly what to fix. It becomes impractical when:

In those cases, consider Premium Verification — a human reviewer reads the full EPUB, applies fixes, and returns a publication-ready file within 24–48 hours.

Need an EPUB from a PDF first? Start with a free conversion.

Convert PDF to EPUB →

Related guides