How to Reduce EPUB File Size — Image Compression, Font Subsetting, and More
Large EPUB files load slowly on e-readers and can exceed publishing platform limits (KDP: 650 MB, Draft2Digital: 300 MB). Here's how to reduce EPUB file size by 50–80% without losing quality.
Why EPUB Files Get Large
EPUB files are ZIP archives. The biggest contributors to file size:
- Uncompressed images: PNG screenshots, high-resolution cover art, and embedded diagrams. A single 4K PNG can be 5–10 MB.
- Embedded fonts: Full OpenType or TrueType font files can be 300 KB–2 MB each. Multiple weights add up.
- Unoptimized HTML/CSS: Usually small, but large tables or inline styles add bytes.
- Duplicate assets: The same image embedded multiple times (common in auto-converted PDFs).
- Rasterized pages: A converter that could not extract text and saved every page as an image. The result is a scanned PDF in EPUB clothing — huge, unsearchable, and it will not reflow.
Publishing platform limits to know: KDP 650 MB, Apple Books 2 GB (but recommends <200 MB for performance), Kobo 2 GB, Draft2Digital 300 MB.
Find What Is Taking the Space
An EPUB is a ZIP file. Rename it to .zip, extract it, and the largest files in OEBPS/ or EPUB/ are the problem — almost always in images/ or fonts/:
cp book.epub book.zip
unzip book.zip -d book-contents
du -sh book-contents/*/images/* # which images are large
du -sh book-contents/*/fonts/* # font sizes
As a rule of thumb: a text-only novel or report should be 50–500 KB; text with a few diagrams 500 KB–3 MB; an illustrated textbook 3–20 MB. Anything over 50 MB almost always contains rasterized pages or unoptimized images.
Method 1: Calibre — Lossless Image Compression
Calibre's built-in editor compresses images without quality loss:
- Right-click the EPUB in Calibre → Edit book.
- Go to Tools → Compress images losslessly.
- Calibre runs OptiPNG and other lossless compressors on all embedded images.
- Save the file.
This typically reduces PNG images by 20–40% with no visible quality loss. For a book with many diagrams, this alone can cut the EPUB size in half. Right-click → Polish books does the same recompression and also removes unused files, without opening the editor.
Command-line alternative on the extracted folder, then repack with mimetype first and uncompressed:
jpegoptim --max=85 book-contents/*/images/*.jpg
optipng -o5 book-contents/*/images/*.png
cd book-contents
zip -X0 ../book-optimized.epub mimetype
zip -rX9 ../book-optimized.epub . --exclude mimetype
Method 2: Convert PNG Images to JPEG
For photographs and covers (not line art or text), JPEG is far more efficient than PNG:
- In Calibre's editor, open each PNG image from the Images/ panel.
- Export → save as JPEG at 85% quality.
- Replace the PNG with the JPEG in the file list.
- Update references in HTML files from
.pngto.jpg.
A 3 MB PNG photograph often compresses to 200–400 KB as JPEG at 85% quality — an 8x reduction with no perceptible difference on e-ink screens.
Method 3: Subset Embedded Fonts
Font subsetting removes unused characters from embedded font files, keeping only the glyphs actually used in the book:
# Install pyftsubset (part of fonttools)
pip install fonttools
# Subset a font to only Latin characters used in English text
pyftsubset font.ttf --unicodes="U+0020-007E,U+00A0-00FF" --output-file=font-subset.ttf
A full Latin/Cyrillic/Greek OpenType font at 400 KB often subsets to 40–80 KB for an English-only book — a 5–10x reduction. Update the font reference in the EPUB's CSS after replacing.
Method 4: Remove Unused Fonts
If the EPUB embeds fonts but the target platform substitutes its own (Kindle, Kobo, Apple Books all have good system fonts), removing embedded fonts entirely saves the most space:
- In Calibre's editor, open the Fonts/ folder in the file list.
- Delete all font files.
- Update the CSS to remove
@font-facedeclarations and fallback to system fonts.
Without opening the editor: Convert books → Look & Feel → Remove all embedded fonts does the same thing during a conversion. This is appropriate for trade fiction and nonfiction. For textbooks, poetry, or books with special typography, keep the fonts.
Method 5: Resize Oversized Images
E-readers have small screens — a 3000×4000 px image wastes space. Resize to screen resolution:
- Standard e-readers: 1264×1680 px (Kobo Libra 2, Kindle Paperwhite)
- Tablets (Apple Books, Kindle Fire): 2048×2732 px
- Cover image: 1600×2560 px minimum per KDP recommendation
# Batch resize all images in a folder using ImageMagick
mogrify -resize 1264x1680">" *.jpg
The > flag only downsizes — images smaller than the target are left unchanged.
Method 6: Remove Unnecessary Metadata
Auto-converted EPUBs often embed large <metadata> blocks with hundreds of Dublin Core fields. Clean these up in Calibre's metadata editor or directly in the OPF file. Small gain but every byte counts.
If the EPUB Is Made of Page Images
If the file list shows one large image per page and almost no text in the XHTML files, the PDF-to-EPUB conversion rasterized the pages (Calibre does this on complex PDFs). No amount of image compression fixes that — reconvert with a tool that extracts the text. toolkit.bot performs text extraction with layout analysis, so the output contains real text; files are typically 95–99% smaller than a rasterized conversion.
Checking EPUB Size After Optimization
After optimizing, verify the EPUB still validates:
java -jar epubcheck.jar book-compressed.epub
Then check the size reduction:
ls -lh book.epub book-compressed.epub
Converting a PDF to EPUB? toolkit.bot generates compact EPUBs with optimized image handling.
Convert PDF to EPUB →