EPUBCheck errors PKG-006, PKG-007 and PKG-005 concern the EPUB container’s mimetype entry. It must be first in the ZIP archive, stored without compression, and contain exactly application/epub+zip without a newline or ZIP extra field. Rebuilding a copy with the correct order and options can resolve these packaging errors. Use EPUBCheck for the ebook. If you also publish a print edition, ProofSlip checks that separate PDF; it does not validate EPUB files.
The rules below come from the EPUB 3.3 specification and the EPUBCheck message bundle on GitHub, both checked on 28 October 2026.
Publishing a print edition too? Check its PDF separately on your PC.
Get it fromMicrosoft
What do PKG-005, PKG-006 and PKG-007 mean?
| Code | EPUBCheck message | What is wrong |
|---|---|---|
| PKG-006 | Mimetype file entry is missing or is not the first file in the archive. | The file is absent, or another file comes before it in the ZIP |
| PKG-007 | The content of the mimetype file must be the string “application/epub+zip” | Wrong text, or extra whitespace or a newline |
| PKG-005 | The mimetype file has an extra field of length … The use of the extra field feature of the ZIP format is not permitted for the mimetype file. | The zip tool added an extra field to the mimetype entry |
The message bundle names these codes with an underscore, such as PKG_006, while reports usually show a hyphen. They are the same message. You may see several at once, because a careless rezip often breaks the order and adds extra fields in one go.
What does EPUB 3.3 require of the mimetype file?
Section 4.3.3 of EPUB 3.3 sets out the rules:
| Requirement | Rule in EPUB 3.3 |
|---|---|
| Position | MUST be the first file in the OCF ZIP container |
| Contents | The string application/epub+zip, encoded in US-ASCII |
| Whitespace | MUST NOT contain leading or trailing padding or whitespace |
| Byte order mark | MUST NOT begin with U+FEFF |
| Compression | MUST NOT be compressed or encrypted |
| ZIP header | MUST NOT include an extra field |
The spec also says the whole archive may use only stored (uncompressed) and Deflate-compressed entries, and must not use ZIP encryption or split archives. So the rest of the book can be compressed normally. Only the mimetype file needs special treatment.
Why do these errors appear after editing an EPUB?
Most of the time the EPUB was fine when it came out of the authoring tool. The errors appear after someone unzips the book, fixes a typo in a chapter, and zips the folder again. A general-purpose zip tool has no idea about EPUB’s rules:
- It adds files in its own order, usually alphabetically or by folder, so
META-INFmay come beforemimetype. That gives PKG-006. - It compresses every file, including
mimetype. - It stores extra attributes, such as file times, in a ZIP extra field. That gives PKG-005.
- A text editor saved the file with a newline or a byte order mark. That gives PKG-007.
Check the companion print PDF for font, image-resolution and page-box issues.
Get it fromMicrosoft
How do you rebuild the EPUB correctly?
The reliable method uses Info-ZIP’s zip command, which is available on Linux, on macOS, and in WSL on Windows. Work in the unpacked folder that contains mimetype, META-INF and your content folder. The content folder here is called OEBPS; use whatever your book uses.
- Fix the mimetype file contents. It must be exactly 20 bytes:
application/epub+zipwith no newline at the end. In PowerShell you can check withFormat-Hex mimetype; the last byte should be thepofzip, not0Dor0A, and the first byte should be61, the letter a, not a byte order mark. - Keep the original EPUB and choose a new output name. The commands below use
book-rebuilt.epub, which must not already exist. This avoids updating an old archive while preserving your original. - Add the mimetype file first, stored, with no extra fields:
zip -X0 book-rebuilt.epub mimetype
- Add everything else, compressed, still without extra fields:
zip -rX9 book-rebuilt.epub META-INF OEBPS
- Run EPUBCheck again.
In the Info-ZIP manual, -0 means compression level zero, which stores the file, and -X, also written --no-extra, means do not save extra file attributes. The -r option recurses into folders and -9 is maximum Deflate compression for the rest of the book. If your book has other folders or files at the top level, list them in step 4 too, but never list mimetype again.
Which fix goes with which code?
| Code | Quick fix |
|---|---|
| PKG-006 | Build a new output archive with mimetype added first, keeping the original |
| PKG-007 | Rewrite mimetype as exactly application/epub+zip, no newline, no byte order mark |
| PKG-005 | Rebuild with -X so no extra field is stored for mimetype |
| All three | Re-export from your authoring tool if you can, otherwise rebuild with the two commands above |
If the errors remain, confirm that the output name did not exist before the first command. Running zip against an existing archive updates it instead of starting fresh, so an incorrect first entry can survive. Keep the original EPUB and retry with another new output name.
Can I avoid unzipping the EPUB at all?
Yes, and that is the safest choice. If your authoring tool, such as your layout program or e-book editor, can export the EPUB again after you make the change there, it will normally build the archive correctly. Manual rezipping is mainly needed when you edited the files by hand.
What should you check after EPUBCheck passes?
EPUBCheck tells you the file is valid. It does not tell you every link goes where you meant, every image has meaningful alt text, or the cover and metadata are what the store expects. Our guides to EPUBCheck broken link errors RSC-007, RSC-008 and RSC-012 and checking an EPUB before uploading to KDP, Apple Books and Kobo cover the next steps.
For a separate print edition, ProofSlip checks the print PDF on your Windows PC. Its current published workflow is PDF preflight, not EPUB or Word validation:
| Print-PDF area | What ProofSlip checks |
|---|---|
| Fonts | Whether fonts used for visible text are embedded |
| Images | Effective resolution at the placed size |
| Page geometry | Page size, trim and bleed boxes |
| Color | Color spaces, spot colors and output intent |
| Report | Graded findings with PDF or HTML report output |
The PDF is opened read-only and nothing is uploaded. Keep this check separate from EPUBCheck and the ebook store’s own validation; a PDF preflight result says nothing about whether the EPUB passes.
Frequently asked questions
Can I fix PKG-006 by renaming files?
No. The problem is the order inside the ZIP archive, not the names. Rebuild the archive with mimetype added first.
Does the mimetype file need a newline at the end?
No. EPUB 3.3 forbids trailing whitespace, so a newline at the end causes PKG-007.
Can the rest of the EPUB be compressed?
Yes. Only the mimetype file must be stored uncompressed. Other entries may be stored or Deflate-compressed.
Will any zip tool make a valid EPUB?
Not by default. Most zip tools do not put the mimetype file first, store it uncompressed and leave out extra fields unless you tell them to.
Does ProofSlip validate an EPUB?
No. The current published app checks print PDFs. Use EPUBCheck and your ebook platform’s validation for the EPUB, and ProofSlip only for a separate print PDF.
Try ProofSlip
ProofSlip is a one-time purchase with a free trial in the Microsoft Store; the listing shows the current price and system requirements. If the book also has a print edition, check that PDF separately before sending it to a printer. More detail is on the ProofSlip product page.
Check your print PDF and export a preflight report without changing the original.
Get it fromMicrosoft
Last updated 28 October 2026. Published by Automata Labs, a software company in Canada.