Compress Large EPUB Files
For an EPUB larger than an online tool's upload limit, start with a local copy. Epublys accepts 5MB per file on free and 30MB total per operation on Pro. A 200MB book needs a local editor or an unzip-and-inspect workflow first. This guide explains how to find the large assets, change only what you can afford to lose, and rebuild a readable EPUB.
Choose lossless repacking or lossy image optimisation
Repacking the ZIP can change its compression without changing book content. Removing genuinely unused files also avoids changing the pages that reference retained assets. Resizing images, JPEG re-encoding and PNG palette reduction change image data and can lose detail. Keep the original and compare text, line art, small labels and photographs at the sizes your readers use.
There is no reliable reduction percentage for every EPUB. An already-compressed novel may barely shrink; a book containing oversized photographs can behave differently. Measure the before and after sizes of your own file and review the result before accepting it.
Step 1: Inspect the EPUB locally
An EPUB is a ZIP archive. Work on a copy and extract it into a new directory:
cp book.epub book-inspect.zip
unzip book-inspect.zip -d book-inspect
find book-inspect -type f -exec du -k {} + | sort -n | tail -20
The list shows the largest extracted files in kilobytes. Images, embedded fonts, audio or video may dominate. Extracted size is not the same as compressed ZIP size, so use this to locate candidates rather than to predict final savings.
Open META-INF/container.xml to find the package document's path. The book may use OEBPS/, OPS/ or another layout. Use the paths actually present in your EPUB rather than assuming every file has the same folder structure.
Step 2: Optimise the images that need it
Resize and re-encode photographs
Choose a resolution that still works for the intended screen or print use. Test on a separate file before replacing an embedded asset. For example, with ImageMagick installed:
magick photo.jpg -resize '1500x1500>' -quality 80 photo-small.jpg
This example limits the long edge to 1500 pixels without enlarging smaller images and uses JPEG quality 80. Those are trial settings, not a guarantee of invisible changes. Zoom into fine detail and compare both copies.
If you change a PNG to JPEG, update its filename and media type in the OPF manifest and every XHTML, CSS or SVG reference to it. Do not leave the old PNG embedded alongside the new JPEG. JPEG does not retain transparency and can blur small text or hard edges, so keep diagrams and line art in a suitable lossless format when needed.
Quantize palette PNGs
A palette tool such as pngquant can reduce colour count for suitable diagrams and screenshots. Palette reduction is lossy too: inspect gradients, colour distinctions and labels. If it makes an image harder to understand, keep the source instead.
JPEG and PNG are widely supported choices. A smaller image format is not automatically a compatible replacement for every reader or EPUB version; check conformance and your target readers before changing formats.
Step 3: Check fonts and unused assets
Read the CSS @font-face rules and chapter references before removing a font. A weight used only in a heading or one chapter is still used. When removing a file, update the OPF manifest and any references to it. Do not discard bold or italic just because a different book did not need them.
For large CJK fonts, using a subset font containing only the characters in the book can help. Tools such as pyftsubset from fonttools do that locally. Check the font's licence, preserve any font-obfuscation requirements, and test every character after subsetting. The Epublys compressor does not subset fonts.
Use an EPUB editor for these changes if you are unsure which files are referenced. A missing asset can make a book smaller by breaking it.
Step 4: Repack with mimetype first
The root mimetype file must contain application/epub+zip, be the first ZIP entry and be stored without compression. From the extracted directory, write a new output name:
cd book-inspect
zip -X0 ../book-compressed.epub mimetype
zip -rX9 ../book-compressed.epub . -x mimetype '*.DS_Store' 'Thumbs.db'
cd ..
Use a fresh output path: ZIP can update an existing archive and leave old entries behind. The second command includes the book's actual directory layout rather than assuming it lives under OEBPS. Repacking does not recover damaged files or fix the links you changed.
Step 5: Validate and compare the result
Run EPUBCheck on the rebuilt EPUB:
java -jar epubcheck.jar book-compressed.epub
For an initial package and file-reference check, the Epublys validator accepts 5MB free or 30MB total on Pro. It does not replace full EPUBCheck. Open the final file in your destination reader, follow its TOC, and inspect pages containing edited images and fonts.
Record the original file size, final size, settings and anything you changed. Those measurements describe your book; do not assume the same reduction for other files.
Use the browser compressor when the file fits
For files within the upload limit, the EPUB compressor provides three separate controls:
- Optimise images: the web UI can resize supported images in your browser before upload. JPEGs and opaque PNGs are re-encoded as JPEG; PNGs with transparency remain PNG. Choose the quality and maximum dimension, and compare the output: resizing and JPEG re-encoding can lose detail. API and MCP compression do not offer this browser image step.
- Compression level: Low, Medium and Maximum select Deflate effort levels 3, 6 and 9. Text, XHTML, CSS and the OPF are repacked; already-compressed images, fonts and media use STORE. This setting does not change picture quality.
- Strip unused assets: removes files the reference scan identifies as unused and updates the manifest. Check the output, especially for unusual EPUB navigation or media structures.
The free website allows 3 tool operations per day. A text-only EPUB may show little or no saving because ZIP already compresses its text. Keep the original when the result is not smaller or loses something you need.
A desktop alternative
Calibre's conversion tools provide image and output settings for a local workflow. Its EPUB editor also lets you replace assets and update references. Review a conversion carefully: rebuilding the book can change styling as well as file size.
- Upload an EPUB to KDP — check store requirements and preview before publishing.
- Send an EPUB to Kindle — choose a delivery method that accepts your file.
- Fix EPUB errors — diagnose package and reference failures.
Try it now — free
Compress EPUB files for Kindle, Kobo, and KDP limits. Free online compressor — strips unused assets, repacks the ZIP, optional in-browser image optimization.
Compress EPUB Files →