Fix EPUB Chapters & TOC: split chapters, rebuild contents, edit metadata

Fix just the parts of an EPUB you need right now, without learning a new ebook editor.

Quick start

  1. Open the EPUB and look at its structure.
  2. Split or merge chapters.
  3. Check links and download the fixed file.

What this tool produces

The example EPUB opened in this tool. The second shot is the file after Rebuild contents and the book information fix, downloaded and opened again.

The example EPUB in the tool: Chapter 2 appears twice in the contents, Chapter 5 Wrapping up is struck through and marked File missing, the title is Untitled, and the check shows one error and four chapters missing from the contents.
Before · Chapter 2 twice, a missing file, title Untitled, Errors remaining: 1
The fixed EPUB opened again: seven contents entries from Preface to Appendix in order, the title A Practical Guide to Fixing EPUB Files, and the message No broken internal links or missing files.
After · seven entries in order, title set, no errors

Example: before and after

A small example EPUB with a broken table of contents, before and after the fix.

Before · broken contents and book information

Contents

  1. Preface
  2. Chapter 1 Getting started
  3. Chapter 2 (no title)
  4. Chapter 2 (no title, duplicate)
  5. Chapter 5 Wrapping up (broken link to a missing file)

1 broken link · 4 chapters missing from the contents

Book information

FieldValue
TitleUntitled
Author(empty)
Languageko
Publisher(empty)

After · fixed contents and book information

Contents

  1. Preface
  2. Chapter 1 Getting started
  3. Chapter 2 The basics
  4. Chapter 3 In practice
  5. Chapter 4 Troubleshooting
  6. Chapter 5 Wrapping up
  7. Appendix — Glossary

0 link errors

Book information

FieldValue
TitleA Practical Guide to Fixing EPUB Files
AuthorLoopyti Editorial
Languageen
PublisherLoopyti

Made-up sample data, run through this tool.

How to use

  1. Open the EPUB to see its internal files and chapters.
  2. Split or merge chapter files as needed.
  3. Rebuild the table of contents from the current chapters. You can't edit entries one by one, but sub-entries inside a chapter stay.
  4. Change the title, author, language, publisher and cover image.
  5. Check internal links and missing files, then download the fixed EPUB.

Your distributor sent the EPUB back

You uploaded your EPUB, and it came back with a structure error. Here is what the tool does with five common kinds of damage.

Problem in the fileWhat you seeWhat to do
No META-INF/container.xmlMETA-INF/container.xml is missing, so the EPUB structure cannot be read.The file doesn't open. Export it again from your editor; the tool doesn't create container.xml
No OPF fileThe package document (OPF) was not found.The file doesn't open. Export it again
Broken XML in the OPF, such as an unclosed tagThe package document (OPF) could not be read.The file doesn't open. Fix the tag in a text editor or Sigil, or export again
mimetype last or compressedThe mimetype entry’s position, compression or content breaks the EPUB rule, marked Fixed on downloadSelect Download EPUB. The new file ends in -fixed.epub, with mimetype first and uncompressed
Obfuscated font (META-INF/encryption.xml) that the OPF doesn't listFile not listed in the packageThe file opens and can be downloaded. Add the font to the package list or remove it in your editor

If errors remain, the screen says Errors remaining: with the count, and adds You can still download, but readers may not open the file.

After no-container.epub is chosen, the tool shows only the message META-INF/container.xml is missing, so the EPUB structure cannot be read.
An EPUB without container.xml does not open

Matching your distributor's EPUBCheck message

ProblemHow the tool describes itWhat EPUBCheck says
container.xml missingMETA-INF/container.xml is missing, so the EPUB structure cannot be read.RSC_002 "Required META-INF/container.xml resource could not be found."
OPF missingThe package document (OPF) was not found.OPF_002 "The OPF file "…" was not found in the EPUB."
OPF XML brokenThe package document (OPF) could not be read.RSC_005 "Error while parsing file: …"
mimetype order or compressionThe mimetype entry’s position, compression or content breaks the EPUB rulePKG_006 "Mimetype file entry is missing or is not the first file in the archive." (covers a missing or misplaced entry)

The EPUBCheck messages are from the message list in the EPUBCheck repository. The EPUB 3.3 specification also says the mimetype file must not be compressed or encrypted.

When to go back to your source editor

If container.xml or the OPF is missing or broken, the tool can't open the book. A DRM-protected file gets This file is DRM-protected. The tool doesn't remove DRM or decrypt files. A file renamed to .epub that isn't a ZIP gets This is not an EPUB (ZIP) file. Files over 100 MB, over 400 MB unpacked or with more than 5,000 entries don't open either. Zipping the unpacked folder yourself can leave mimetype compressed or out of first place. The tool never changes your original file, but keep a separate copy before editing.

A font-protection file is not DRM

An EPUB with IDPF or Adobe font obfuscation opens normally. Font obfuscation only scrambles embedded fonts, so the tool doesn't treat it as DRM. Any other kind of encryption is refused as DRM. The font and encryption.xml stay in the downloaded file. A font that the OPF manifest doesn't list is flagged. Either add that font to the manifest or take it out.

The status line reads Opened font-obfuscated.epub, and Check and download lists OEBPS/fonts/virtual.otf as File not listed in the package.
The font-obfuscated EPUB opens, with the unlisted font marked Check

Before uploading

  • META-INF/container.xml is present and points at the package document
  • The OPF file is present and parses without errors
  • The mimetype entry is first and stored, not compressed
  • If you split or merged chapters, you selected Rebuild contents
  • The error count is 0, and you have looked at the items marked Check
  • Title, author, language, and publisher are set
  • A copy of the original EPUB is kept apart from the fixed file

If a manuscript you send around as a Hangul file (.hwp or .hwpx) is too big to attach, use Shrink HWP files.

Related tools are on the Documents and Publishing pages.

Files and personal information

Files and anything you enter are not sent to a server. They are processed only in the browser you are using now, and closing the window clears what you entered.

The tool never changes your original file. Still, keep a separate copy of the original EPUB before editing.