EPUB Metadata and Cover Editor
Operator: Abdulla Al Fahad. How tools are built and checked
An e-reader shows what the EPUB's package file says: a wrong author sort name files the book under the wrong letter, a missing series number leaves a trilogy out of order, and a cover that is a 40 KB thumbnail looks soft on a tablet. All of that lives in one XML file, the OPF, plus one image, so it can be fixed without touching a single chapter.
Key features
- Title, any number of people with a role (author, editor, translator, illustrator and eight more) and a sort-as name, language, publisher, date, subjects, description and rights
- Series name and number, written as an EPUB 3 collection and as the calibre:series tags that Calibre, KOReader and other Calibre-based apps read
- Identifiers with a type (ISBN, UUID, DOI, URL, other) and an ISBN check-digit test; the book's main identifier cannot be removed
- Cover replacement from a JPEG, PNG, GIF or WebP, converted to the type of the old cover file when they differ, optionally scaled down, or added as a new cover if the book had none
- A structure check of the mimetype entry, container, manifest and spine, run on the file you open and again on the one you save
What changes inside the EPUB
An EPUB is a ZIP whose first entry must be a stored, uncompressed file named mimetype that holds application/epub+zip with no extra field in its ZIP header. META-INF/container.xml points to the OPF, the package document, whose metadata element holds the Dublin Core fields (dc:title, dc:creator, dc:identifier and so on) and whose manifest lists every file the book uses.
EPUB 3 attaches a creator's role and sort name as separate meta elements that refine the creator by id, and requires a dcterms:modified timestamp; this page refreshes that stamp when you save. EPUB 2 puts the same information in opf:role and opf:file-as attributes on the dc:creator element. The page writes whichever form the book already uses, and marks an ISBN as urn:isbn: in EPUB 3 or as an opf:scheme attribute in EPUB 2.
How it works
The OPF is read with a small tag scanner that remembers where every element starts and ends. Saving splices new text into those positions, so elements the page does not manage, such as dc:source, links, custom meta tags and the manifest, keep their exact bytes, comments and line breaks. A list such as authors or subjects is rewritten in place at the position of its first old element. Refinements of a removed creator are removed with it, new people get fresh ids that cannot collide with any id in the file, and the identifier named by unique-identifier is always kept.
The ZIP is written with mimetype first and stored. Entries other than the OPF and the cover keep their contents; when the original used DEFLATE, the compressed bytes are reused as they are. The saved file is opened again, parsed and checked, and its entry count is compared with the original's before the download starts.
Common use cases
- A reader finds that 4 books by the same author file under 'Mara' on a Kindle-style library screen, and fills in the sort-as name 'Quill, Mara' on each.
- A small press replaces a 300 x 450 px cover in 12 backlist titles with a 1600 x 2400 px version, scaled so the long side stays at 2400 px.
- A librarian adds ISBN 978-1-4028-9462-6 and the language tag pt-BR to an EPUB 2 file whose identifier was only a random UUID.
How to use this tool
- Drop an .epub onto the page, or press Load a sample EPUB.
- Read the structure check; errors that were already in the book are listed and carried over.
- Edit the fields, add or remove people and identifiers, and choose a new cover if you want one.
- Press Save EPUB. The edited file is named after the original with -edited added.
Example
Load a sample EPUB, then add series 'Salt Road Trilogy' number 1, sort name 'Quill, Mara', Ana Ruiz as illustrator, ISBN 978-0-306-40615-7, date 2024-05-01 and a new cover
The sample is EPUB 3 with 7 files: mimetype, container.xml, content.opf, nav.xhtml, two chapters and images/cover.jpgAfter saving
Two files are rewritten, OEBPS/content.opf and OEBPS/images/cover.jpg, and the other 5 are copied as they were. The OPF gains a belongs-to-collection entry with collection-type series and group-position 1, matching calibre:series tags, role and file-as refinements for both people, urn:isbn:9780306406157, and a new dcterms:modified time. The saved file reads back with no errors or warnings.Common pitfalls
The structure check is not EPUBCheck. It tests the mimetype entry, container, manifest and spine, but not the validity of chapter markup, the navigation document's contents or accessibility metadata.
An EPUB 3 book can carry several titles, such as a main title and a subtitle. Only the first dc:title is editable here; the others are left as they are.
Some reader apps cache covers by book id; after replacing a cover you may need to remove and re-add the book.
Saving refreshes the dcterms:modified stamp in an EPUB 3 book, so its recorded modification time changes even when you only fix a typo.
- Put the surname first in the sort-as field ('Quill, Mara'); readers sort on it instead of on the displayed name.
Common errors and how to fix them
- The first ZIP entry is "META-INF/"; an EPUB must start with an entry named mimetype
- The book was zipped by a tool that wrote its folders first. Saving moves mimetype to the front and stores it, which is the repair.
- The package document is encoded as utf-16
- Re-save the book in an EPUB tool as UTF-8; this editor only rewrites UTF-8 package files.
- has a damaged ZIP structure and could not be opened
- Try the file in an ordinary ZIP tool. If that fails too, the download was cut short or the file is damaged; fetch or export it again.
- unpacks to more than 400 MB, far beyond a normal file, so it was refused as a possible decompression bomb
- The entries inflate to more than 400 MB in total, which is far above any ordinary book. Open the file in an ordinary ZIP tool to see which entry is oversized, or use a clean export of the book.
- is 30000 x 30000 pixels (900 megapixels). Covers over 64 megapixels are not opened
- The cover image is read from its header before any pixels are decoded, so a huge file is refused rather than freezing the tab. Resize it, for example to 2400 px on the long side, and choose it again.
- Manifest item "cover" points to OEBPS/cover.jpg, which is not in the package
- The book lists a file it does not contain. Choose a new cover: it is written to the path the manifest names, so the reference works again.
Series fields across readers
There is no single series field every reader agrees on. EPUB 3 defines belongs-to-collection with a collection-type of series and a group-position; Calibre and many apps built on its data read calibre:series and calibre:series_index. For an EPUB 3 file this page writes both, so the series survives a trip through either kind of library. For EPUB 2 only the Calibre tags are written, since EPUB 2 has no collection element.
Cover size and format
A cover is an ordinary image listed in the manifest. The page keeps the image type of the existing cover file, so a PNG chosen for a .jpg cover is re-encoded as JPEG at quality 0.92 and a JPEG chosen for a PNG cover becomes a PNG. The optional scale box limits the long side in pixels and never enlarges an image. When a replaced cover was declared only by a cover meta element, or was found by its file name, the manifest item also gets the cover-image property in EPUB 3, which reading apps that ignore the meta element need. A book without a cover gets images/cover.jpg, .png, .gif or .webp, a manifest item with the cover-image property in EPUB 3, and a cover meta element that EPUB 2 readers look for.
Frequently asked questions
Does saving change my chapters or fonts?
No. Only the OPF, and the cover image if you chose one, are rewritten. For every other entry the content is carried over, and the result lists how many files were copied as they were.
Why did my file need its mimetype moved?
The EPUB container rules require mimetype as the first stored entry so that a program can recognise the file from its first bytes. Some zip tools sort entries alphabetically or compress it. Strict readers refuse such a file; saving writes it in the correct form.
What happens to metadata fields this page does not show?
They stay exactly as they were. Only the fields shown on the page are touched, and only when you change them.