Book Structure
Generated Code
About the OPF TOC Generator
Creating an EPUB eBook requires precise XML structure. The OPF (Open Packaging Format) file is the heart of your eBook, defining its metadata, file list (manifest), and reading order (spine). Additionally, the Table of Contents (TOC) is crucial for navigation, often requiring both an NCX file (for older readers) and an HTML5 Navigation Document (for EPUB 3).
This OPF TOC Generator Online simplifies the process. Instead of manually writing error-prone XML, simply list your chapters, and our tool instantly generates the valid code snippets you need. It's designed for authors, publishers, and developers who want a fast, reliable, and free solution.
How to Use This Tool
- Add Chapters: Click "Add Chapter" to create new entries. Enter the title (e.g., "Chapter 1") and the filename (e.g., "chapter1.xhtml").
- Import Structure: Have a list of chapters? Click "Import Text" and paste your list to auto-populate the tool.
- Reorder & Organize: Use the arrow buttons to move chapters up or down. (Indentation features coming soon for nested TOCs).
- Generate: Click the "Generate Code" button.
- Copy & Paste: Switch between tabs (Manifest, Spine, Guide, NCX, Nav) and copy the code into your respective project files.
Tips for a Perfect EPUB Structure
- Consistent IDs: Ensure the IDs in your manifest match the `idref` attributes in your spine. Our tool handles this automatically.
- Semantic HTML: For the EPUB 3 Navigation Document, use the `
- Backward Compatibility: Even if you are building an EPUB 3, it's good practice to include an NCX file for older eReaders that don't support the new navigation standard.
Frequently Asked Questions
What is an OPF file?
The OPF (Open Packaging Format) file is an XML file that describes the contents, metadata, and structure of an EPUB eBook. It tells the eReader what files are in the book and in what order to display them.
Do I need both NCX and Nav files?
For maximum compatibility, yes. The NCX file is used by EPUB 2 readers (and some older EPUB 3 readers), while the HTML5 Navigation Document (Nav) is the standard for EPUB 3. This tool generates both.
Is this tool free to use?
Yes, this OPF TOC Generator is 100% free, open-source, and runs entirely in your browser. No data is uploaded to any server.
Copied to clipboard!
Read Also: