EPUB Error: Duplicate ID Attribute in EPUB
What causes this error?
HTML requires every id attribute value to be unique within a single document. When conversion tools generate EPUB chapters from a template, they often copy the same structural id values (like "header", "section1", "content") into every chapter file. Each individual file fails validation because the same id appears more than once within that document. This also breaks anchor-link navigation: if two elements share an id, a link to #section1 is ambiguous.
How to fix it
- Run EPUBCheck or BookKraft's EPUB Validator to get a list of all files and lines with duplicate IDs.
- In each flagged file, locate the duplicate id attributes — chapter templates often repeat ids like "header", "nav-bar", or "content".
- Rename each duplicate so it's unique within the file — a reliable pattern is chapter-specific prefixes: "ch01-header", "ch02-header", etc.
- If any internal anchor links use these ids (href="#section1"), update them to match the new renamed ids.
- Re-validate to confirm all id values are unique within each document.
Common questions
Do id values need to be unique across the whole EPUB or just within one file?
Within one file only — EPUB chapters are separate HTML documents, so the same id value can appear in chapter01.xhtml and chapter02.xhtml without conflict. The error only fires when the same id appears twice inside a single file.
Why do conversion tools create duplicate IDs?
Most tools generate chapters from a shared template with hard-coded structural ids. When the template is applied to every chapter without renaming those ids, each resulting file fails HTML uniqueness requirements.
Check your EPUB before uploading
The free EPUB Validator catches structure, metadata, and navigation errors — no signup, no Java, runs in the browser.
Validate Your EPUB Free →Building your EPUB correctly from the start prevents most of these errors before they happen. See the EPUB formatting guide for the full workflow: manuscript cleanup, TOC, front matter, EPUB 3.0 generation, and validation.
Platform rejection guides: Why Apple Books rejects ebooks
Tool comparisons: Scrivener alternative for ebook production