How to Edit an EPUB in Calibre — Complete Guide to Calibre's Book Editor
Calibre has a built-in EPUB editor that lets you modify chapter text, fix formatting, add images, edit CSS, and repair structural issues — without any external tools.
Opening the Calibre Book Editor
To open Calibre's EPUB editor:
- Add your EPUB to the Calibre library (drag-and-drop).
- Right-click the book → Edit book.
- Or press Ctrl+Shift+E.
The editor opens in a separate window with the EPUB's file tree on the left, an editor panel in the center, and a preview panel on the right.
The Editor Interface
- File Browser (left): Lists all files inside the EPUB — Text/ (chapter HTML), Images/, Fonts/, Styles/ (CSS), and the OPF/NCX files.
- Editor (center): Code editor for the selected file. Syntax highlighting for HTML, CSS, and XML.
- Preview (right): Live-rendered preview of the current chapter. Updates as you type (toggle with F8).
- Table of Contents (bottom): Shows the current TOC structure.
Core Editing Tasks
Edit Chapter Text
- Double-click a chapter file in the File Browser (e.g.,
Text/chapter01.xhtml). - Edit the HTML directly in the code editor.
- The preview panel on the right updates in real time.
- Save with Ctrl+S.
Find and Replace Across All Files
- Open Find & Replace with Ctrl+H.
- In the Where dropdown, select All text files.
- Use regex by checking the Regex checkbox.
- Click Replace All to apply changes across every chapter file.
Fix Formatting — Check and Fix
Calibre's editor includes automated fixup tools:
- Tools → Fix HTML — repairs malformed HTML tags and unclosed elements.
- Tools → Pretty Print All Files — re-indents all HTML for readability.
- Tools → Remove unused CSS — strips CSS rules that don't match any element in the book.
- Tools → Compress images losslessly — runs OptiPNG on all embedded images.
Edit CSS Styles
- Open a CSS file from the File Browser (under Styles/).
- Edit rules directly. The preview updates immediately.
- Use Tools → Manage fonts to add or remove embedded fonts.
Edit Metadata (Title, Author, ISBN)
In the editor, click the OPF file (content.opf) in the File Browser and edit the XML directly. Or close the editor, return to Calibre's library, and use the metadata editor (press E) — which is simpler.
Regenerate the Table of Contents
- Go to Tools → Table of Contents → Edit Table of Contents.
- Click Generate from major headings to rebuild from H1/H2/H3 tags.
- Review and adjust entries.
- Click OK.
Calibre Editor Keyboard Shortcuts
| Action | Shortcut |
|---|---|
| Open book editor | Ctrl+Shift+E |
| Save | Ctrl+S |
| Find & Replace | Ctrl+H |
| Toggle preview | F8 |
| Check book | F7 |
| Go to file | Ctrl+P |
| Split file at cursor | Ctrl+Return |
Calibre Editor vs Sigil
Both tools edit EPUBs directly. The main differences:
- Calibre Editor: Integrated into Calibre — convenient if you already use Calibre for library management. Has built-in image compression and "Check book" (F7) for common errors.
- Sigil: Purpose-built editor. Better for long-form text editing, has a WYSIWYG Book View (Calibre editor is code-only). Some publishers prefer Sigil for final polish before distribution.
Converting a PDF to EPUB before editing in Calibre? toolkit.bot generates well-structured EPUB output.
Convert PDF to EPUB →