Match the report title.
Look for "PKG_007 mimetype file contents are invalid" or the closest title listed above. If the platform wording is different, keep the original EPUBCheck, KDP, or Kindle Previewer message before choosing a fix.
Use this when the EPUB mimetype file contents are wrong or the file is compressed. Check the ZIP wrapper before you touch chapters, OPF, or navigation files.
The scan shows affected paths and repair decisions. It does not show manuscript text.
Not sure this kind of EPUB should be scanned here? Check unsupported or manual-only EPUB cases.
Scan report titles
Read the scan report
Use the report label, affected file, and repair decision together. A matching title alone is not enough if the file path or EPUB structure points to a different problem.
Look for "PKG_007 mimetype file contents are invalid" or the closest title listed above. If the platform wording is different, keep the original EPUBCheck, KDP, or Kindle Previewer message before choosing a fix.
Use the report's Affected area, Source file, Target file, or Problem type rows before editing content.opf, nav.xhtml, toc.ncx, XHTML, CSS, or image paths.
Repairable means EPUB Fixer found one clear structural change. Manual review or Not supported means use the source project, formatter, or platform workflow instead of guessing.
Handoff summary
Copy the report summary instead of rewriting the EPUB from memory. A useful handoff includes the source file, target file or field, original error, repair decision, and next step.
1. Example report output
The report should focus on the archive wrapper, not on XHTML or OPF content.
EPUBCheck message
ERROR(PKG-007): mimetype file has invalid contents or is compressed.
Root entry
mimetype exists at archive root but contains application/epub+zip plus a trailing newline.
Storage
ZIP method is deflated instead of stored.
Do this next
Rebuild the archive only if the rest of META-INF and the OPF package are intact.
Do not do this
Do not patch random text files or rename a ZIP without checking the root entry order and storage method.
A safe repair means rebuilding the ZIP container so the mimetype entry is exact and stored correctly, then validating again.
2. Next step
PKG_007 is usually safe when the EPUB structure is otherwise intact, but it can hide a broader packaging mistake when the archive was built incorrectly.
Scan first
Use the scan to see whether the mimetype text, storage method, and root package layout are all valid.
Safe repair
Rebuild the ZIP with a correct root-level mimetype file stored uncompressed, then validate again.
Manual review
Stop when files sit under an extra parent folder, META-INF is missing, or the OPF path is also broken.
3. Concrete path example
The issue is often one wrong byte or one wrong ZIP method on the root entry.
EPUBCheck: ERROR(PKG-007): mimetype file has invalid contents or is compressed. Report: Root file: mimetype Contents: "application/epub+zip\n" Storage: deflated Fix decision: safe repair if the rest of the package layout is valid
The mimetype entry should contain application/epub+zip exactly and be stored without compression.
Quick decision
This is often a packaging repair, not a content repair, as long as the rest of the EPUB layout is still coherent.
Scan first
Check the mimetype text, ZIP storage method, META-INF, and OPF path together before rebuilding.
Safe fix
Rebuild the ZIP container with the correct mimetype entry and then validate again.
Stop
Do not treat PKG_007 as isolated when the root folder level, META-INF, or OPF path is also wrong.
Start here
PKG_007 is a ZIP wrapper problem. The chapters can be fine while the root-level mimetype file is compressed or contains the wrong text.
The EPUB wrapper is not packaged like a valid EPUB. The root mimetype entry is wrong even if the book files themselves still exist.
EPUB Fixer can help when the package layout is otherwise intact and the only safe repair is to rebuild the ZIP wrapper with the correct mimetype entry.
Open the EPUB as a ZIP package and locate the root-level mimetype entry.
It should stop when the EPUB also has missing META-INF files, a broken OPF rootfile path, nested parent folders, or broader archive damage that needs full package review.
Common situations
Start with the exact root mimetype entry the archive exposes.
The file exists, but its text is not exactly application/epub+zip.
Rewrite the mimetype file exactly, then rebuild the archive correctly.
A generic archive tool stored the file with compression instead of the required stored method.
Rebuild the ZIP with mimetype uncompressed and first.
Files may sit under an extra parent folder or the root package layout may still be broken.
Review the full package layout instead of treating this as a single-file repair.
Repeated archive edits can fix one packaging rule while breaking another.
Rebuild from a clean EPUB folder structure instead of stacking ZIP edits.
PKG_007: The mimetype file contents are invalid or the file is compressed.
EPUBCheck, Kindle Previewer, or KDP checks the ZIP wrapper and finds that the root-level mimetype file does not contain application/epub+zip exactly or is not stored the required way.
What it means
The EPUB wrapper is not packaged like a valid EPUB. The root mimetype entry is wrong even if the book files themselves still exist.
Common causes include generic ZIP tools, trailing newlines, extra whitespace, wrong text encoding, compressed root entries, and repeated manual rezip attempts.
Before you edit
Do not rename a generic ZIP to .epub and assume it is valid. The mimetype entry has to exist at the root, contain the exact text, and be stored without compression.
Why KDP checks it
The EPUB ZIP wrapper must point readers to the OPF file through META-INF/container.xml and keep packaged resources at the paths the book references.
EPUBCheck checks EPUB 2 and EPUB 3 files against the official rules and reports package, markup, link, and file-reference problems.
Can this be fixed safely?
EPUB Fixer can help when the package layout is otherwise intact and the only safe repair is to rebuild the ZIP wrapper with the correct mimetype entry.
It should stop when the EPUB also has missing META-INF files, a broken OPF rootfile path, nested parent folders, or broader archive damage that needs full package review.
Before: the archive root mimetype file is compressed or contains extra bytes. After: the archive starts with a correct root-level mimetype entry stored without compression, then validation runs again.
Ready to retry?
A scan should show whether the root-level mimetype file exists, what text it contains, and whether the archive stored it without compression.
Upload EPUB to scanFAQ
It means the root-level mimetype entry is wrong. The file contents are not exactly application/epub+zip, or the entry was stored with the wrong ZIP method.
Usually, yes, when the rest of the package layout is still valid and the safe repair is just a correct ZIP rebuild.
Yes. PKG_006 is usually about the mimetype entry being missing or not first. PKG_007 is about the entry contents or compression method being wrong.
No. Start with the archive wrapper because PKG_007 is a ZIP packaging problem, not a chapter or metadata problem.