# EPUBCheck PKG-004: corrupted ZIP header, how to fix it

Source: https://epubcc.com/epubcheck/pkg-004/ (updated 2026-11-04)

EPUBCheck PKG-004 is a fatal error message: “Corrupted EPUB ZIP header.” The ZIP structure of the EPUB is damaged, so EPUBCheck cannot list or read its files. It is a fatal error: nothing inside the book can be checked until the archive is rebuilt, and reading apps usually refuse to open it.

- Official message (EPUBCheck 5.4.0): Corrupted EPUB ZIP header.
- Default severity: Fatal error

## Typical causes

- A truncated download or transfer.
- A tool that wrote the ZIP incorrectly or was interrupted while writing it.
- A file edited in place by a program that does not understand ZIP archives.

## How to fix it

1. Get a fresh copy of the EPUB or export it again from its source.
2. Rebuild the archive with the mimetype file first and stored uncompressed, for example from the folder that contains the book: zip -X0 book.epub mimetype and then zip -rX9 book.epub META-INF OEBPS (use your own folder names).
3. Run EPUBCheck again on the rebuilt file and fix any message that appears next: a damaged archive can hide other problems until it can be read.

## When it's not this

If the first bytes are not a ZIP at all (a renamed file), EPUBCheck reports PKG-003 instead.

## Sources

- EPUB 3.3, §4.3.2 ZIP file requirements: https://www.w3.org/TR/epub-33/#sec-zip-container-zipreqs (read 2026-11-04)

Message text and severity: EPUBCheck (W3C, BSD-3-Clause). Explanation: EpubCC.
