07 / Optimize · EPUB → Smaller EPUB

EPUB compressor

Optimize images and review optional cleanup.

Reduce an EPUB’s size by optimizing its images, with controls for format, quality and maximum width. Compare the size report before keeping the new copy. Optional cleanup can also remove repeated headers, page numbers and empty paragraphs; leave text cleanup off when you want the chapter content preserved unchanged.

  • EPUB 2 or 3, up to 100 MB
  • JPEG, PNG, WebP and GIF images
  • Runs in this tab, never uploaded
All tools
Opening your workspace…

At a glance

EPUB Compressor quick specs

Verified
Input
DRM-free EPUB 2 & EPUB 3 (.epub)
Output
Smaller EPUB with re-encoded images and optional cleanup
Scope & limit
Up to 100 MB per book; JPEG, PNG, WebP and GIF images
Processing
Local in your browser — files never upload
Price & account
Free; no sign-up or install required
Key boundary
Text-only books shrink minimally; largest savings come from oversized images

From file to finished

How to compress an EPUB file

  1. Open a DRM-free EPUB with Choose an EPUB, drop it on the page, or press Try a sample; the app bar shows the title, file size and resource count.

  2. Leave Re-encode images ticked and choose Format, Quality (30–100, default 80) and Max width in pixels; 0 keeps every image at its original width.

  3. Tick the cleanups you need. Empty blocks and Font de-obfuscation start on; Running heads & page numbers starts off and needs at least three chapters before a line counts as repeated.

  4. Press Compress EPUB and watch the progress line name each image, then the packaging count; the button is disabled until the run finishes and there is no cancel button.

  5. Read the report and the status line, press Download EPUB, then open the file and check that the images and chapter text you kept still display.

Formats and inputs

Supported EPUB formats and inputs

EPUB is already a ZIP-based container, so zipping it again is rarely the main saving. Large raster images are the useful target here. JPEG and WebP re-encoding can lose detail; PNG ignores the quality control. A text-heavy EPUB may barely shrink. EPUB 2 and 3 can contain SVG artwork or obfuscated fonts that require different handling from ordinary JPEG or PNG pictures.

InputSupportWhat to expect
EPUB 3 with JPEG or PNG artworkBest fitEvery raster image in the manifest is a candidate, the cover included, and the report counts them before any replacement. Photos and plates usually account for most of the file.
EPUB 2 with a JPEG cover and platesWorksThe same re-encoding applies; EPUB 2 has no requirement that would block a rebuilt archive, and files you do not change keep their original bytes.
EPUB with WebP imagesWorksKeep format re-encodes WebP to WebP; choosing WebP explicitly does the same. A browser that cannot decode a WebP image skips it silently, leaving the original in place.
Animated GIFPartialThe canvas keeps the first frame, so a re-encoded GIF loses its motion and is written as PNG under Keep format. Untick Re-encode images when the animation matters.
Text-only EPUB with no raster imagesPartialThe run continues with cleanup and re-packaging only, shows a note about missing images and reports 0 of 0, so the size may stay the same or grow slightly.
SVG, AVIF or HEIC artworkNot supportedOnly JPEG, PNG, WebP and GIF are re-encoded. Vector covers and modern formats are copied untouched and never appear in the image count.
DRM-protected EPUBNot supportedEncryption beyond font obfuscation is refused at open, before the editor appears, with a message naming DRM. This page does not remove protection.
Digitally signed EPUBNot supportedThe book opens, but pressing Compress EPUB stops because rebuilding the archive would invalidate the signature. Use an unsigned copy from the seller.

What it can do

What EPUB Compressor can do

Shrink the images that make the file heavy

The page reads the package manifest and re-encodes every JPEG, PNG, WebP or GIF it lists, one at a time, showing the file name and its place in the queue. An image is written back only when the new bytes are smaller than the old ones, so already-tuned artwork stays exactly as it was. Images the manifest does not list, including files hiding in the archive, are never touched.

Set the width and quality trade-off

Format offers Keep format, JPEG, WebP and PNG. Quality runs from 30 to 100 and starts at 80; it applies to JPEG and WebP, while PNG output ignores it and stays lossless. Max width caps the pixel width and leaves 0 to keep the original size, with height following the same ratio. JPEG output paints transparency white, and Keep format writes GIF and PNG sources as PNG.

Remove running heads and page numbers

Tick Running heads & page numbers to compare the first three and last three text blocks of every chapter. A line counts as a running head when its normalized text, with digits and Roman numerals masked, appears in at least three chapters and is no longer than 160 characters. Standalone page numbers such as 12, iv or – 12 – are removed at those edges too. The switch is off by default.

Drop blank paragraphs left by converters

Empty blocks is on by default. It scans paragraphs, divs and headings that contain nothing but spaces, then removes them, which clears the vertical gaps that HTML-to-EPUB converters leave between scenes. A block is kept when it carries an id or name attribute, an image, an SVG or a line break, so anchors, separators and picture wrappers survive the pass.

Read what changed before you keep the file

The report lists the before and after sizes, the saved percentage, how many images were optimized out of the candidates found, and counts for empty blocks, headers, page numbers and font entries. A larger result is labeled as re-packaging overhead rather than lost content. A notes list sits under the stats and warnings fold into a collapsible count, so a silent no-op is visible instead of hidden.

After you run it

What you get from EPUB Compressor

Compare the final size and cleanup counts with the changes you intended. A completed rebuild can be larger or save nothing; the report distinguishes that outcome from a failed run, and the download still needs a reading check.

What you getWhat it means
A status line: Done. 24.6 MB → 18.2 MB (26.0% smaller).The two sizes come from the source bytes you opened and the finished Blob; the percentage is the difference divided by the source size, rounded to one decimal.
Compression report: Before, After, SavedThe same three numbers in a table, with a minus sign when the archive grew. That row is the fastest check that the run saved anything at all.
Images optimized 12 of 31The right number is every raster image the manifest lists; the left number is how many were replaced by smaller bytes. A zero on the left is a result, not an error.
Counts for empty blocks, headers, page numbers, fontsEach cleanup reports how many items it removed. Page numbers only appear when the header switch was on and at least one matched.
Notes and warningsSpace saved is stated with a unit; a larger rebuild is labeled as re-packaging overhead; font entries are described as index changes, not rewritten fonts.
One download named after the bookThe file is title.epub with characters file systems reject replaced by dashes. Your original file is untouched, so you can compare both or delete the new one.
A warnings list when something was skippedWarnings are folded under a count. A book with no raster images or an unreadable encryption document says so here instead of failing the run.

When people reach for it

Common EPUB Compressor use cases

A smaller reading copy is useful for transfer limits, device storage and image-heavy books. Compare the destination’s requirements first: a transfer copy can tolerate different compromises from an archive master, print source or illustrated reference edition.

If you need to…What this tool does
Fit a photo-heavy novel onto a small e-readerChoose WebP, quality 70 and a 1200 px width; the report shows how many plates were replaced and the new total size, and the chapter text is not reflowed.
Get a scanned book under an upload limitSet JPEG at 1600 px and quality 75, then read the status line: it reports the old and new size and the percentage saved before you download.
Remove the chapter title and page number stamped on every pageTick Running heads & page numbers; a line repeated in at least three chapters is removed at the edges, and the report counts headers and page numbers separately.
Clean blank paragraphs after converting HTML to EPUBLeave Empty blocks ticked; spacer paragraphs disappear while ones holding an image, a line break or an id stay, and the report counts what went.
Ship a proof without the font encryption indexKeep Font de-obfuscation ticked to remove font records from encryption.xml; the fonts keep their bytes, and the report counts the entries it removed.
Find out why a smaller EPUB did not shrinkRun it once and read Images optimized 0 of 24: the artwork was already tuned, so try a lower quality, WebP output or a width cap before assuming the tool failed.

Why use it

Why compress an EPUB without losing text

Compression is a trade between file size, image detail and compatibility with the destination reader. Use this tool when you can inspect that trade-off, rather than relying on a promised percentage that may not fit the contents of your book.

Match the reading copy to its destination

A phone copy and an archive master need not use the same image dimensions. Keeping the original lets you prepare a smaller transfer copy while retaining full-detail artwork for later printing, editing or a larger screen.

Avoid treating every EPUB as an oversized picture book

A novel made mostly of text has little image data to reduce. The report helps distinguish that case from a photo-heavy book, so you can stop adjusting quality when images are not the reason for the size.

Make content cleanup a separate decision

Removing repeated margins may improve a converted book, but it changes chapter content rather than just image bytes. Decide whether that cleanup belongs in this edition before judging the result solely by its saved percentage.

Compare a saving against readable artwork

A lower byte count can hide damaged map labels, diagrams or fine comic lettering. Check representative pages in the receiving app and keep the compression report as context, rather than assuming the smallest output is the best copy.

When it does not work

Why EPUB Compressor may fail

Most surprises are not crashes: the run finishes, but the size or the image count is not what you expected. These are the branches that produce those outcomes, with the message or number the page shows.

  • The book has no raster images

    The run still builds a new archive but adds the note “This book has no JPEG, PNG, WebP or GIF images to optimize.” Only cleanup and re-packaging can change the size, and the image count reads 0 of 0.

  • None of the images got smaller

    Every candidate was left byte for byte as it was, because the re-encoded file was not smaller. The report reads Images optimized 0 of 31 and the archive may be slightly larger; lower quality, WebP or a width cap is the next attempt.

  • The rebuilt archive is larger

    A ZIP can grow even when no image changes: text entries are re-deflated at level 6, images are stored uncompressed and the original may have used a stronger setting. The note calls this re-packaging overhead, not lost content.

  • The EPUB is digitally signed

    Pressing Compress EPUB stops with Digitally signed EPUBs cannot be edited here. Use an unsigned copy to avoid invalidating its signatures. The book opened, but a byte change would break the signature it carries.

  • The EPUB is protected

    Opening stops with This book contains DRM-protected or unsupported encrypted content. These tools open DRM-free EPUBs only. Font obfuscation is accepted, because those font bytes are copied unchanged.

  • The file is over 100 MB

    The picker refuses it with Choose an EPUB smaller than 100 MB, before reading anything. Large illustrated books can need more memory than the tab can safely use, so the cap is deliberate.

  • The encryption document cannot be parsed

    The run continues and adds META-INF/encryption.xml could not be read; font entries were left untouched. Images and chapter cleanup still run, so you can keep the book and skip the font switch next time.

Repair paths

How to fix common EPUB Compressor issues

Match the line you saw to the cause, then take the shortest route to a useful file. When the fix needs a different tool, the row says so instead of suggesting another pass here.

What you seeLikely causeWhat to do
This book has no JPEG, PNG, WebP or GIF images to optimize.No raster image is listed in the package manifest.If no raster image is declared, inspect the source package or use an editor. Image compression cannot reduce text, SVG or font data through this pass.
Images optimized 0 of 24; size unchanged or largerThe artwork is already compressed, PNG ignored the quality value, or the width cap is too high.Choose WebP, drop quality to 70 or lower, and set Max width to 1200 or 1600; run again and compare the Saved percentage.
Done. 8.0 MB → 8.3 MB (3.8% larger)No image shrank and the rebuilt ZIP compresses less well than the original.Keep the original, or lower quality or width until at least one image reports smaller; re-packaging alone will not shrink the book.
Digitally signed EPUBs cannot be edited here.A META-INF/signatures.xml file protects the archive.Ask the seller for an unsigned edition; this page will not strip the signature, because the rebuilt archive would no longer verify.
This book contains DRM-protected or unsupported encrypted content.Encryption other than the two font-obfuscation methods was found.Open a DRM-free copy; this page does not bypass protection, and converting a protected file needs the seller’s app.
META-INF/encryption.xml could not be read; font entries were left untouched.The encryption document is malformed or not XML.Untick Font de-obfuscation and run again to compress the images and clean chapters, or repair the package in an EPUB editor.
Choose an EPUB smaller than 100 MB.The selected file is above the input cap.Downsample the images or split the book in a desktop editor first, then open the smaller file here and compress it.

Plain-language notes

Key EPUB compression terms explained

Only the terms that change a decision on this page appear here: what counts as an image, what the two numeric controls do, and why a rebuilt ZIP can be larger.

Raster image

A picture stored as pixels, such as a JPEG photo, a PNG screenshot, a WebP plate or a GIF. These four media types are the only files this page re-encodes; SVG is markup, not pixels, and is copied unchanged.

Re-encode

Decode the original image in the browser, draw it to a canvas at the chosen width, then encode a new file at the chosen format and quality. The original bytes are kept unless the new file is smaller, so re-encoding is a comparison, not an overwrite.

Quality

The 30 to 100 slider that becomes the encoder’s quality argument, from 0.3 to 1.0 with 0.8 as the default. It changes JPEG and WebP output; PNG ignores it, so a PNG chosen for lossless output can still be bigger than the source.

Max width

A pixel ceiling for the image width; the height is scaled by the same ratio. Zero keeps the original dimensions. A cap only helps when the source is wider than the number you enter, so 1200 changes a 2400 px plate and does nothing to an 800 px one.

Running head

A line a printed book repeats at the top or bottom of every page, such as the book title or chapter name. Here it is a leaf block in the first or last three of a chapter whose normalized text appears in at least three chapters.

Leaf block

A paragraph, div or heading that does not wrap another block element. The scanner collects these so an outer div is not counted as a header as well as the paragraph inside it; only leaf blocks are tested for repetition or emptiness.

Font obfuscation

A light scrambling of embedded fonts tied to the book identifier, not DRM. The font switch deletes those records from META-INF/encryption.xml and drops the file when no records remain, but it does not rewrite or decrypt the font bytes.

Re-packaging overhead

A rebuilt ZIP is not the original archive: text entries are re-deflated at level 6, images are stored, and directory data is regenerated. That can add bytes even when every image is unchanged, which is why the report can show a small negative saving.

Manifest item

An entry in the OPF that lists a resource and its media type. The image pass starts from this list, so a JPEG that sits in the archive but is not declared in the package is never offered to the encoder and never appears in the count.

Reader compatibility after image conversion

A format the browser can encode is not a promise that every e-reader can display it. Test a WebP-based result on the intended device; JPEG or PNG may be the safer choice for a mixed-device audience.

Other ways to do it

EPUB Compressor vs. alternatives

A compressor is one step in a larger job. These routes make more sense when the book needs a validator, a batch run, or new images rather than smaller ones.

OptionBetter whenTrade-off
Calibre’s Polish books or Edit bookYou already keep a library and want lossless image tweaks plus a package check on dozens of files.A desktop workflow offers package editing and cleanup alongside image work. Compare the available optimization settings and keep the original before running collection-wide changes.
A script using Pillow and zipfileYou compress the same way every week and want the output checked into a release pipeline.It runs outside the browser, needs Python and a backup, and you write the OPF-aware replacement and ZIP ordering yourself.
Resize images before building the EPUBThe source artwork is 4000 px wide and the reader screen is far smaller, so one pass in an image editor saves more than re-encoding.Prepare the artwork separately and update package references if names or formats change. A scripted image workflow can help when source preparation is repeated.
Leaving the book as it isThe file opens quickly, fits the device and you only read it once.It stays large, and a store or email service may reject it; but no image is re-encoded and no chapter is rewritten.

Your files and this tool

Privacy, accuracy and EPUB Compressor limits

The book is opened with the browser File API, its images are decoded from local blob URLs, and the download is assembled in memory. No part of the book is posted to this site.

  • The EPUB is read from the file picker and parsed in the tab; image bytes never leave the machine, and the new archive is a Blob created by the page.
  • This compressor does not persist the loaded book or result in localStorage or IndexedDB. Reloading clears that session; the shared site analytics tag can set its own cookies independently of document processing.
  • Pressing Try a sample fetches the bundled reading sample from this site; every other byte comes from the file you chose, so the site can still request page assets, analytics and the optional sample.
  • The source file is never written back. The download URL is revoked 60 seconds after it is created, and Start over disposes the open book.
  • Compression is not a DRM removal and not a validator: protected books are refused, and no EPUBCheck run happens, so a damaged package stays damaged.

A little more detail

Frequently asked questions about EPUB Compressor

How much smaller will my EPUB get?

It depends on how much of the file is raster images and how far you are willing to drop quality or width. A photo-heavy book can shed a large share; a text-only book has no image candidates, so the report reads 0 of 0 and the archive may only change by re-packaging bytes. The percentage is measured after the run, not predicted.

Does compressing lower the image quality?

JPEG and WebP output is lossy, so any quality below 100 discards some detail, and 30 keeps the least. PNG output is lossless and ignores the slider, which is why a PNG can come out larger and be discarded. Nothing is overwritten: an image is kept only when the new bytes are smaller, and the original book remains.

Is the text changed?

The text is not reflowed or re-encoded, and chapter files are copied as they are unless a cleanup runs. Empty blocks is on by default and removes paragraphs with no visible text; running heads removes lines repeated across three chapters and standalone page numbers. With both switches off, chapter files are copied from the original bytes.

Is my book uploaded anywhere?

No. The chosen file is processed in this tab and the new EPUB is built in memory. Site assets, the shared analytics tag and an optional sample can still use the network, but those requests do not contain your book. The conversion has no server-side history; download the result and retain your original before closing the page.

Which images does the tool touch?

Only items the OPF manifest declares as image/jpeg, image/png, image/webp or image/gif, and only if the file exists in the archive. SVG, AVIF and HEIC are not candidates, and a JPEG that sits in the ZIP without a manifest entry is never seen. A candidate that fails to decode is skipped without a message.

What do quality and max width actually do?

Quality is passed to the encoder as 0.3 to 1.0 and affects JPEG and WebP only. Max width is a pixel ceiling: a wider image is scaled down with its height in proportion, and 0 leaves the size alone. A width cap does nothing to images already narrower than the number, so combine it with a format or quality change.

Should I choose JPEG, PNG or WebP for an older e-reader?

Choose for the receiving app as well as for size. JPEG suits photos, PNG can preserve sharp diagrams and transparency, and WebP may give useful savings but needs support on the target reader. Test an exported book on that device before compressing a whole collection. Keep the original, because neither a browser preview nor a smaller file proves compatibility or preserved detail.

Why is the downloaded file larger?

The output is a fresh ZIP: entries are re-deflated at level 6, images are stored without compression and directory data is rebuilt. If no image got smaller, those packaging bytes can exceed the saving. The report labels the result as re-packaging overhead, and the fix is to lower quality or width until at least one image shrinks.

Can I cancel a run, and is my original safe?

There is no cancel button: the Compress EPUB button stays disabled while the queue runs, and Start over is disabled too. Closing or reloading the tab ends the run, and the parsed book is dropped. The original file is never written to, so a stopped run costs only time, and the download is a new file you can delete.