Blog · EPUB

How to Organize an EPUB Library

Metadata first, folders second

Reading apps and library managers sort by the metadata inside each book, not by the folder it sits in. If the title says “book (1).epub” and the author field is empty, no folder structure will rescue it. So the first step in organising a collection is making the metadata inside the files right, and only then deciding on file names.

A workable routine

  1. Check for broken books. Run each new book through the validator. A book that fails now will fail again in some app later, and finding out at 11 pm on a train is worse.
  2. Correct title and author. Use the metadata editor. Write authors as people write them on the cover, one author per line, and make the title the book’s real title without suffixes.
  3. Set the language. It drives hyphenation, dictionaries and text-to-speech voice.
  4. Add a cover if there is none, with the cover editor. Covers make a library scannable.
  5. Rename the file consistently, for example Author - Title.epub or Author/Title.epub, whichever your tools prefer.
  6. Keep one master copy and treat edited copies as outputs, so you can always go back.

File names that survive

Duplicates and editions

Two files with the same title are not necessarily the same book. Compare the identifier (ISBN or UUID) and the publisher and date metadata. If you have two editions, keep the newer or better one, and note in the description which edition it is. A text extraction of both, compared with a diff tool, shows quickly whether they differ in content or only in formatting.

Series and omnibus editions

Series information lives in custom metadata that varies between tools, so decide on one library manager for series and let it handle that. If you prefer a series in one file, the merge tool combines several EPUBs into one with a combined table of contents. Keep the individual volumes; merged books are harder to update later.

Backups and versioning

Privacy of your library

A library list says a lot about its owner. Prefer tools that work on the device. The PDFSwift EPUB tools run in your browser and do not upload your books, which is also why they have no accounts and cannot keep a library for you. That is the trade-off: nothing is stored, so the organising system has to be yours.

Naming schemes that work

SchemeExampleGood for
Author - TitleTester, Ada - The Test Book.epubOne flat folder; sorts by author.
Author folderTester, Ada/The Test Book.epubLarge libraries, library managers.
Series awareAuthor/Series/01 - Title.epubSeries readers who want order by number.
Topic firstHistory/Author - Title.epubNon-fiction and study collections.

Choose one and apply it consistently. A rough scheme used everywhere beats a perfect scheme used sometimes.

Finding exact duplicates

Two files with different names can be identical. Compare their checksums. On a Unix-style shell, sha256sum *.epub | sort | uniq -w 64 -d lists files whose contents are the same. Different checksums do not prove they are different books, since an app may have re-saved the file, but identical checksums prove they are the same.

A migration checklist

  1. Copy everything to a new folder; never reorganise the only copy.
  2. Validate each book and set aside the ones with errors.
  3. Repair or replace the failing ones.
  4. Correct metadata in the files, not just in your reading app’s database.
  5. Rename files by your chosen scheme.
  6. Import the new folder into your app and check a sample of books.
  7. Keep the old folder until you have lived with the new library for a while.