Skip to main content
Complete Guide

Ebook Formatting: The Complete Guide

·18 min read·
Ebook FormattingEPUBSelf-Publishing

A professionally formatted ebook is the difference between a book that sells and one that gets buried. Readers abandon poorly formatted books within minutes, retailers suppress them in search results, and review algorithms punish them with lower visibility. Yet most indie authors treat formatting as an afterthought, something to rush through after the "real" work of writing is done.

This guide covers every aspect of ebook formatting, from choosing the right file format to passing accessibility validation. Whether you are publishing your first novel or your fifteenth, you will find actionable techniques here that directly impact your sales and reader satisfaction.

Understanding Ebook File Formats

Before you format a single page, you need to understand what you are building. An ebook is not a print-ready PDF shrunk to fit a screen. It is a reflowable document that adapts to the reader's device, font size preferences, and accessibility needs.

EPUB: The Industry Standard

EPUB (Electronic Publication) is the open standard maintained by the W3C. It is essentially a ZIP archive containing HTML, CSS, images, and metadata files. Every major retailer except Amazon accepts EPUB directly.

EPUB 3, the current version, supports:

  • Reflowable and fixed-layout content
  • Embedded fonts and media
  • Semantic HTML5 markup
  • Full accessibility features (alt text, navigation, ARIA)
  • MathML for equations
  • JavaScript for interactive content

EPUB 2, the older version, is still accepted by most retailers but lacks modern accessibility features. If your tools output EPUB 2, converting to EPUB 3 is worth the effort, particularly for accessibility compliance.

MOBI and KF8: Amazon's Formats

Amazon uses its proprietary KF8 (Kindle Format 8) format, which is functionally similar to EPUB 3 but wrapped in Amazon's container. When you upload an EPUB to KDP, Amazon converts it to KF8 automatically.

The older MOBI format was deprecated by Amazon in 2023. You no longer need to create MOBI files for any purpose.

PDF: When Reflowable Won't Work

PDFs preserve exact page layouts, making them ideal for heavily designed books, cookbooks, art books, and textbooks with complex diagrams. However, they are terrible for novels, memoirs, and any text-heavy book because they do not reflow to fit different screen sizes.

For a detailed comparison of when to use each format, see our format comparison guide.

The Anatomy of an EPUB File

Understanding what is inside an EPUB helps you troubleshoot formatting issues and make informed decisions about tools. An EPUB file contains:

ComponentFilePurpose
MimetypemimetypeIdentifies the file as an EPUB (must be first, uncompressed)
ContainerMETA-INF/container.xmlPoints to the package document
Package Documentcontent.opfLists all files, metadata, reading order
Navigationnav.xhtml or toc.ncxTable of contents for e-reader navigation
Content*.xhtml filesYour actual book text in HTML
Styles*.css filesFonts, spacing, colors, layout rules
Imagesimages/*.jpg, *.pngCover, illustrations, diagrams

The Package Document (OPF)

The OPF file is the heart of your EPUB. It contains three critical sections:

  1. Metadata, Title, author, ISBN, language, accessibility properties
  2. Manifest, A list of every file in the EPUB with its media type
  3. Spine, The reading order of your content files

Most formatting tools generate this file automatically. But if something goes wrong, a missing chapter, incorrect reading order, broken images, the OPF is the first place to look. We cover metadata optimization in detail in our ebook metadata guide.

Content Files (XHTML)

Each chapter or section of your book is typically one XHTML file. These files use standard HTML tags:

  • <h1> through <h6> for headings
  • <p> for paragraphs
  • <em> and <strong> for emphasis
  • <img> for images (with alt text)
  • <blockquote> for quotations
  • <ol> and <ul> for lists

The key rule: use semantic HTML. A heading should be an <h2>, not a bold paragraph. A list should be an <ol>, not a series of lines with manual numbers. Screen readers and e-reader software depend on correct semantic markup to provide navigation and accessibility features.

EPUB 3 uses a nav.xhtml file for its table of contents. EPUB 2 uses toc.ncx. Many EPUBs include both for backward compatibility. We have a dedicated guide to creating proper ebook tables of contents that covers the technical requirements and common mistakes.

Choosing the Right Formatting Tool

Your choice of tool affects everything from workflow speed to output quality. Here is a quick overview, see our full tool comparison for detailed pricing and feature breakdowns.

For Most Fiction Authors: Vellum or Atticus

Vellum (Mac only, $249.99 one-time) and Atticus (all platforms, $147 one-time) are designed for authors who want beautiful results without touching code. They offer visual formatting, chapter templates, and direct export to EPUB and print-ready PDF.

Best for: Novels, memoirs, short story collections, poetry

For Budget-Conscious Authors: Calibre or Sigil

Calibre (free, all platforms) converts between formats and offers basic formatting. Sigil (free, all platforms) is a dedicated EPUB editor that gives you full control over the HTML and CSS.

Best for: Authors comfortable with some technical work, or those who need fine-grained control

For Complex Non-Fiction: Sigil or InDesign

Books with tables, footnotes, sidebars, or complex layouts often need manual HTML/CSS editing. Sigil handles this well. Adobe InDesign ($22.99/month) produces both print and ebook layouts but has a steep learning curve.

Best for: Textbooks, technical manuals, cookbooks, reference books

Formatting Your Content

Front Matter

Front matter appears before your main content. Keep it lean for ebooks, readers want to get to your story quickly.

Include:

  • Title page
  • Copyright page
  • Dedication (optional)
  • Table of contents

Skip or move to back matter:

  • Foreword
  • Preface
  • Acknowledgments
  • Long author bios

Each front matter element should be a separate XHTML file in your EPUB. Mark them with the appropriate epub:type semantic attribute so e-readers can identify them.

Chapter Structure

Every chapter should follow this pattern:

  1. Chapter heading, Use <h1> or <h2> consistently. Pick one level for chapter titles and stick with it throughout the book.
  2. Opening paragraph, Some authors style this differently (drop cap, no indent). Handle this with a CSS class, not inline styles.
  3. Body paragraphs, Standard <p> tags. Use text-indent in CSS for paragraph indentation rather than manual spaces or tabs.
  4. Scene breaks, Use a styled <hr> element or a centered ornamental character. Never use blank lines alone, they can collapse on some e-readers.

Heading Hierarchy

Heading hierarchy is one of the most common accessibility violations in ebooks. The rule is straightforward: headings must not skip levels. If your chapter title is <h1>, the next heading must be <h2>, not <h3> or <h4>.

A valid hierarchy looks like this:

h1: Chapter 1: The Beginning
  h2: The Morning
    h3: The Alarm Clock
  h2: The Afternoon

An invalid hierarchy:

h1: Chapter 1: The Beginning
  h3: The Morning     ← skipped h2
    h4: The Alarm Clock

Broken heading hierarchy triggers warnings in DAISY Ace and EPUBCheck, and contributes to Amazon's suppression risk scoring. Our EPUB validation guide covers how to catch and fix these issues.

Typography and Styling

Ebook styling requires a different mindset than print. You are making suggestions, not dictating exact layouts, because readers control font size, font family, and often colors.

Do:

  • Set relative font sizes (em or %, not px)
  • Use text-indent for paragraph indentation (typically 1.5em)
  • Set comfortable line-height (1.4 to 1.6)
  • Define margin-top and margin-bottom for spacing between elements

Do not:

  • Set exact page dimensions
  • Use absolute positioning for text elements
  • Force specific fonts (provide fallbacks instead)
  • Set background colors that interfere with e-reader night mode
  • Use !important excessively, it overrides reader preferences

If your ebook contains hyperlinks, they must be visually distinguishable from surrounding text and meet WCAG 2.1 AA contrast requirements, a minimum 4.5:1 contrast ratio against the background. The default blue (#0000FF) on white meets this standard. A dark blue like #0066CC works even better for readability.

Many ebooks fail accessibility checks because links are styled to look identical to body text, or because the link color does not contrast enough against the background. Amazon's quality systems flag this as a violation.

Working with Images

Images are where many ebooks fail accessibility standards. Every image needs proper sizing, an appropriate format, and alt text.

Image Format and Sizing

Use CaseRecommended FormatMax WidthFile Size Target
Cover imageJPEG2560 x 1600pxUnder 5MB
PhotographsJPEG1600px wideUnder 1MB
IllustrationsPNG1600px wideUnder 500KB
Simple diagramsSVGScalableUnder 100KB
Decorative elementsPNG or SVGAs neededUnder 50KB

Use JPEG for photographs and complex images with many colors. Use PNG for illustrations, screenshots, and images with text or sharp edges. SVG works well for icons, diagrams, and decorative elements, it scales perfectly to any screen size.

Alt Text for Every Image

Every meaningful image in your ebook must have alt text. This is not optional, it is required by accessibility standards, the European Accessibility Act (since June 2025), and Amazon's quality guidelines.

Good alt text describes the image's content and purpose in under 125 characters. For a thorough treatment of alt text best practices, see our complete alt text guide.

For decorative images that add no informational content (ornamental dividers, background patterns), use an empty alt attribute: alt="". This tells screen readers to skip the image entirely.

Cover Image Requirements

Your cover image serves double duty: it is both a marketing asset and the first image a reader sees in the ebook. Retailers have specific requirements:

  • Amazon KDP: Minimum 625 x 1000px, recommended 2560 x 1600px, JPEG or TIFF
  • Apple Books: Minimum 1400px on shortest side, JPEG or PNG
  • Kobo: Minimum 1400 x 1873px, JPEG

Set your cover image's alt text to something like "Book cover: [Your Title] by [Your Name]", not a long description of the visual design.

For detailed guidance on image formatting, see our images in ebooks best practices guide.

Metadata: Your Book's Hidden Sales Engine

Metadata is the structured information embedded in your EPUB that tells retailers, libraries, and search engines what your book is about. Poor metadata means poor discoverability, and in 2026, it also means accessibility compliance failures.

Essential Metadata Fields

At minimum, your EPUB's OPF file should include:

  • dc:title, Your book's title, exactly as it appears on the cover
  • dc:creator, Author name(s)
  • dc:language, Language code (e.g., en, fr, de)
  • dc:identifier, ISBN or unique identifier
  • dc:date, Publication date
  • dc:publisher, Publisher name
  • dc:description, Book description/blurb

Accessibility Metadata

Since mid-2025, accessibility metadata has moved from "nice to have" to required. Amazon, Apple, and Kobo all factor it into their quality assessments. Key accessibility metadata properties include:

  • schema:accessibilityFeature, Lists features like alternativeText, tableOfContents
  • schema:accessibilityHazard, Declares known hazards (flashing, motion, sound) or none
  • schema:accessibilitySummary, Human-readable description of accessibility features
  • schema:accessMode, How content is consumed (textual, visual)

Our ebook metadata guide covers all of these in detail, including copy-paste templates for common book types.

Building a Proper Table of Contents

Every ebook needs two types of navigation:

  1. HTML TOC, A visible page in your book that readers can navigate to
  2. Navigation Document, A structured file (nav.xhtml or toc.ncx) that e-readers use for their built-in navigation menus

Both must exist, and both must be accurate. A missing or broken navigation document is one of the top three reasons Amazon suppresses ebook rankings.

Your navigation document should include entries for:

  • All chapters
  • Major sections within chapters (if applicable)
  • Front matter (title page, copyright, dedication)
  • Back matter (acknowledgments, about the author, also by)

Do not include entries for every subsection, keep navigation practical and useful. See our table of contents guide for the complete technical walkthrough.

Validation: The Final Step Before Publishing

Validation is where you catch errors before your readers (or Amazon's automated systems) do. Think of it as the ebook equivalent of proofreading.

EPUBCheck: Structural Validation

EPUBCheck is the official W3C validator for EPUB files. It catches structural errors: missing files, invalid HTML, incorrect metadata, broken navigation references. Running EPUBCheck should be the absolute minimum before any upload.

In 2025, EPUBCheck processed over 2 million validations through its web interface alone. The most common errors it catches are:

  1. Missing or malformed OPF metadata
  2. Broken internal links
  3. Invalid HTML in content files
  4. Incorrect mimetype file placement
  5. Missing navigation documents

DAISY Ace: Accessibility Validation

DAISY Ace goes beyond structural validation to check accessibility compliance. It tests for alt text, heading hierarchy, color contrast, keyboard navigation, and WCAG 2.1 conformance.

According to the DAISY Consortium's 2025 report, 73% of independently published EPUBs fail at least one Ace accessibility check. The most common failures are missing alt text (68%), incorrect heading hierarchy (41%), and insufficient link contrast (35%).

Rahatt: Suppression Risk Assessment

While EPUBCheck and Ace tell you what is technically wrong, Rahatt tells you what is commercially dangerous. Our scanner maps accessibility violations to Amazon's known suppression triggers, giving you a risk score from 0 to 100.

A score of 0 means your ebook is in excellent shape. A score above 50 means you are at significant risk of reduced visibility. Rahatt can also fix many common issues automatically, heading hierarchy, link contrast, accessibility metadata, and alt text.

For the complete validation workflow, see our EPUB validation guide.

Accessibility: Not Optional Anymore

Ebook accessibility used to be a niche concern. That changed dramatically in 2025 with two developments:

  1. The European Accessibility Act took effect in June 2025, making accessibility a legal requirement for ebooks sold in the EU
  2. Amazon intensified suppression of non-accessible ebooks, with an estimated 15-20% of KDP backlist titles experiencing reduced visibility due to accessibility failures

Accessibility compliance is now a commercial imperative. Books that meet WCAG 2.1 AA standards get better treatment from algorithms and reach a wider audience.

The Core Accessibility Requirements

RequirementWhat It MeansImpact If Missing
Alt text on imagesEvery meaningful image has a text description-10 per image (Amazon risk score)
Heading hierarchyHeadings follow a logical order (h1, h2, h3)Triggers Ace violations
Navigation documentFunctional table of contents for e-reader menus-40 on risk score
Accessibility metadataSchema.org properties in OPF-20 on risk score
Link contrastLinks visually distinguishable (4.5:1 ratio)Ace contrast violation
Language declarationxml:lang attribute set correctlyEPUBCheck error
Reading orderContent in logical sequenceScreen reader confusion

For a thorough introduction to accessibility requirements, see our EPUB accessibility 101 guide. If you have already identified issues, our fixing guide walks through the solutions.

Platform-Specific Formatting Considerations

Amazon KDP

Amazon converts your EPUB to its KF8 format during upload. This conversion can introduce subtle formatting changes:

  • Some CSS properties are ignored or overridden
  • Complex table layouts may reflow unexpectedly
  • Embedded fonts may be replaced with Amazon's defaults on older Kindles
  • SVG support varies by device generation

Pro tip: Always preview your book using Kindle Previewer 3 (free from Amazon) before publishing. It shows you exactly how your book renders on different Kindle devices.

Apple Books

Apple Books supports EPUB 3 natively and renders most formatting faithfully. It has excellent support for embedded fonts, fixed-layout content, and media overlays. Apple's quality guidelines place extra emphasis on accessibility, books with accessibility issues may be rejected during review.

Kobo

Kobo uses Adobe's rendering engine for EPUBs. It handles standard formatting well but can struggle with very complex CSS. Kobo's ePub spec for publishers recommends keeping CSS simple and avoiding advanced selectors.

Google Play Books

Google accepts both EPUB 2 and EPUB 3. Their system is forgiving of minor validation errors but applies its own style overrides aggressively. Test your formatting using Google's previewer in the Play Books partner center.

Common Formatting Mistakes and How to Fix Them

Mistake 1: Using Spaces or Tabs for Indentation

Many authors transfer their Word formatting habits to ebooks, using spaces or tabs at the start of paragraphs. These render inconsistently across devices. Instead, use text-indent in your CSS:

p {
  text-indent: 1.5em;
  margin-top: 0;
  margin-bottom: 0;
}

Mistake 2: Hard Page Breaks in the Middle of Content

Print-minded page breaks (page-break-before: always) should only appear between chapters, not within them. In reflowable ebooks, they create awkward blank pages on smaller screens.

Mistake 3: Images Without Size Constraints

An image without max-width: 100% in CSS will overflow the screen on smaller devices. Always include:

img {
  max-width: 100%;
  height: auto;
}

Mistake 4: Missing Language Declaration

The xml:lang attribute must be set on the root <html> element of every XHTML file, and dc:language must be present in the OPF. EPUBCheck flags this as an error, and screen readers need it to select the correct voice/pronunciation.

Mistake 5: No Fallback Fonts

If you embed a custom font, always provide a fallback. Some e-readers cannot display embedded fonts, and without a fallback, your text may render in an unexpected system font.

body {
  font-family: "YourFont", Georgia, serif;
}

The Formatting Workflow: Start to Finish

Here is a reliable workflow that works for most indie authors:

  1. Write in your preferred tool (Word, Scrivener, Google Docs)
  2. Export to EPUB using a formatting tool (Vellum, Atticus, Calibre)
  3. Add images with proper alt text and sizing
  4. Check metadata, ensure all required fields are present
  5. Validate with EPUBCheck, fix all errors and warnings
  6. Validate with DAISY Ace, fix accessibility issues
  7. Run through Rahatt, check suppression risk and auto-fix remaining issues
  8. Preview on target platforms (Kindle Previewer, Apple Books, Kobo desktop)
  9. Upload to each retailer

This workflow typically adds 1-2 hours to your publishing process but saves you from the weeks of lost visibility that come with a suppressed or poorly formatted book.

Frequently Asked Questions

How long does it take to format an ebook?

A straightforward novel (text-only, no images) takes 1-3 hours with a tool like Vellum or Atticus. A complex non-fiction book with tables, images, and footnotes can take 4-8 hours. Add another 1-2 hours for validation and accessibility fixes. Most indie authors find that formatting gets significantly faster after their first two or three books.

Do I need to format differently for each retailer?

No. A well-formatted EPUB 3 file works on all major platforms. Amazon converts it to KF8 automatically. The only retailer-specific concern is cover image dimensions, Amazon, Apple, and Kobo each have slightly different minimums. Use the largest recommended size (2560 x 1600px) and all three are covered.

Can I use my print-ready PDF as my ebook?

You can, but you should not. PDFs do not reflow to fit different screen sizes, making them unreadable on phones and small tablets. They also lack the semantic structure that e-readers need for navigation and accessibility. Always create a separate EPUB for digital distribution.

Is EPUB 2 still acceptable?

Most retailers still accept EPUB 2, but EPUB 3 is strongly recommended. EPUB 3 supports modern accessibility features required by the European Accessibility Act, and Amazon's quality systems give better treatment to EPUB 3 files. If your formatting tool outputs EPUB 2, consider converting to EPUB 3 or switching tools.

What is the most common reason ebooks get suppressed on Amazon?

Based on data from over 10,000 scans processed through Rahatt, the three most common suppression triggers are: missing accessibility metadata (present in 82% of flagged books), missing image alt text (68%), and broken or missing navigation documents (45%). All three are fixable without reformatting your entire book, our scanner can detect and repair these issues automatically.

Next Steps

Formatting is not a one-time task. As accessibility standards evolve and retailers update their requirements, your ebooks may need updates. The authors who treat formatting as an ongoing part of their publishing process, not a box to check once, consistently see better visibility and fewer platform issues.

Start by scanning your existing catalog with Rahatt to identify any books at risk. Then work through the specialized guides in this series to address specific areas:

  • EPUB vs MOBI vs PDF: Choosing the Right Format
  • Best EPUB Formatting Tools for Indie Authors
  • Ebook Metadata: The Hidden Key to Discoverability
  • How to Create a Proper Ebook Table of Contents
  • Images in Ebooks: Sizing, Format, and Accessibility
  • How to Validate Your EPUB Before Publishing

Ready to check your EPUB?

Scan Your EPUB Free