No server. No backend. Pure JavaScript. Turn HTML into valid EPUB 3 files with a clean, chainable API — sanitizer, cover, TOC, images and fonts included.
Fill in the fields, click generate — your browser downloads a real, valid EPUB 3 file.
Every method returns this for chaining. All generation methods are async.
Create a book. Pass title, author, language, publisher, description, date, uuid, rights, sanitize.
Add a chapter. HTML is sanitized automatically. Options: id, order, css[], raw.
Set the cover image. Pass base64, ArrayBuffer, or Blob. opts.asPage inserts a full cover page.
Insert a human-readable contents page before chapter one. Custom title, css, inlineStyle.
Embed a stylesheet. Reference it in chapters via opts.css: ["style.css"].
Add an image asset. Reference in HTML as ../images/filename. Supports JPEG, PNG, WebP, GIF, SVG.
Embed a font file. Reference via @font-face in your CSS. Supports WOFF2, WOFF, TTF, OTF.
Replace a chapter's title or content in place. Throws if id is not found.
Remove a chapter by its id. Silent if not found.
Re-sequence chapters by passing ids in the desired order.
Generate and trigger a browser download. Filename defaults to slugified title.
Returns raw Blob. Also: .toBase64() for a base64 string, .toObjectURL() for a preview URL.
One file, zero dependencies beyond JSZip, covers the full EPUB 3 spec.
DOM-based HTML sanitizer preserves tables, images, links, figures, lists, code — strips scripts, iframes, forms.
Generates nav.xhtml for EPUB 3 readers and toc.ncx for legacy EPUB 2 readers simultaneously.
Full-bleed cover XHTML page with proper epub:type="cover" and OPF cover-image manifest property.
Numbered, clickable contents page inserted into the spine — the kind printed on page 3 of a real book.
Embed WOFF2 fonts and CSS files. Link stylesheets per-chapter or globally across the whole book.
Works as a plain script tag, CommonJS require(), or ESM import. Auto-injects JSZip if not present.