17 / Create · HTML → EPUB

HTML to EPUB converter

A page, kept as a book.

Convert a saved HTML file or pasted page source into a reflowable EPUB. Review the detected chapters, rename or exclude sections, and set the book title, author and language before downloading. This converter handles one supplied document; it does not crawl a website or fetch an article from a live URL.

  • One HTML page, up to 10 MB
  • Paste source or choose a file
  • EPUB 3 assembled in this tab
All tools
Opening your workspace…

At a glance

HTML to EPUB quick specs

Verified
Input
Saved .html / .htm file or pasted HTML source
Output
Clean EPUB 3 split by headings with metadata
Scope & limit
Up to 10 MB per page
Processing
Local in your browser — files never upload
Price & account
Free; no sign-up or install required
Key boundary
Works on local HTML source; does not crawl live URLs or fetch remote assets

From file to finished

How to convert an HTML page to EPUB

  1. Drop an .html file on the page, press Choose a file, or paste the page source into the editor. Try sample HTML loads a bundled example without a network request.

  2. Check Book title, Author and Language code in the sidebar. A <title> from the page fills the title only while the field is empty or still reads My HTML book, so replace the default if the page has no useful title.

  3. Press Review chapters. The body is sanitized and split at <h1>, or at <h2> when there is no <h1>, and the Detected chapters list appears with a checkbox and an editable title per row.

  4. Clear a row’s checkbox to leave that chapter out, type a new title, and choose it under Rendered preview to inspect the sanitized HTML before export.

  5. Press Download EPUB. Editing the HTML or the split mode disables the button until Review chapters runs again; the file is named from the book title and downloads from this tab.

Formats and inputs

Supported HTML formats and inputs

HTML describes a document, but a saved webpage can depend on separate CSS, scripts, images and fonts. This converter reads the supplied source, not its sibling asset folder or the original site. A .html or .htm file is different from MHTML or a ZIP of a website. The EPUB uses a reading stylesheet, so keep the original if its exact visual layout matters.

InputSupportWhat to expect
A saved .html, .htm or .xhtml fileBest fitThe picker accepts these extensions and the text/html type. The file is decoded as text, checked against the 10.0 MB byte limit and the 5,000,000-character limit, then parsed.
HTML pasted into the source editorWorksPaste the page source and press Review chapters; this path skips the file picker, the 10 MB byte check and the 5,000,000-character check, so the browser’s memory is the only ceiling.
A page with one or more <h1> headingsBest fitAny <h1> selects h1 splitting. Each <h1> starts a chapter, text before the first one becomes an untitled chapter, and <h2> lines stay inside their chapter as subheadings.
A page with <h2> headings but no <h1>WorksEvery <h2> becomes a chapter and is promoted to an <h1> in the export. This is the fallback for articles that start at level two.
A page with no headings at allPartialThe body becomes one chapter with no title, exported as Chapter. You can rename it in the list, but there is no automatic division into parts by length.
https or data: images in the bodyPartialA base64 data: image is carried inside the chapter and works offline. An https image keeps only its URL: it is not downloaded or added to the manifest, so an offline reader shows a gap.
Relative image paths and remote CSSPartialA bare relative src such as images/a.png is removed by the sanitizer; a root-relative path survives but points at no file in the archive. Style blocks and linked stylesheets are dropped entirely.
A file over 10 MB or 5,000,000 charactersNot supportedThe file is refused before or just after it is read, with a message naming the limit. A page with 1,001 or more split chapters is also refused, so trim the input or reduce its headings.

What it can do

What HTML to EPUB can do

Turn one saved page into a book

Choose an .html, .htm or .xhtml file, drop it on the page, or paste the source into the editor. The tool parses it as one document, keeps the body text and structure, and builds a single book. There is no URL field and no crawler, so a site with ten articles means ten files and ten exports.

Let the page’s headings set the chapters

If the body contains any <h1>, every <h1> starts a chapter, even when there is only one. With no <h1>, every <h2> is used instead; with neither, the whole page is one chapter. Text before the first heading becomes an untitled chapter, so site navigation can appear as chapter one until you exclude it.

Check the split before you download

Review chapters lists every chapter with a checkbox and an editable title; selecting a row shows its sanitized HTML under Rendered preview. Rename a row, clear its checkbox to leave it out, or preview a chapter’s sanitized HTML. The download button is disabled while the source or split mode is unreviewed, so you cannot export a stale chapter list by accident.

Keep the words, drop the machinery

The sanitizer removes script, style, link, meta, base, iframe, object, embed, form controls, video and audio, and strips event handlers such as onclick. Headings, paragraphs, lists, tables, quotes, code and links remain. Class names survive but the rules that styled them do not, so the book follows its own reading stylesheet rather than the site’s design.

See how pictures travel

A base64 data: image stays inside the chapter XHTML and works offline. An https image keeps its URL, so the book contains a link that an online reader may fetch and an offline reader will not. A plain relative path loses its src during sanitizing. No image folder or manifest entry is written, so nothing is embedded beyond the data URIs.

Export a complete EPUB 3 package

The download is a ZIP with a stored mimetype first, container.xml, an OPF 3.0 package, nav.xhtml, toc.ncx, book.css and one XHTML file per included chapter. Metadata carries the title, optional author, language, a generated UUID and a modification time. There is no cover, publisher, series or description field.

After you run it

What you get from HTML to EPUB

The download is a real EPUB archive, not a PDF or a web page with an .epub name. These are the parts you can inspect to decide whether the export matches what the page held.

What you getWhat it means
An EPUB file named from the book titlesafeFilename() drops characters that file systems reject, collapses spaces, trims to 120 characters and adds .epub. A title with a colon becomes a hyphen in the download name.
One XHTML file per included chapterchapter-1.xhtml through chapter-N.xhtml follow the list order. Each begins with an <h1> built from the chapter title, even when the source used <h2>. Excluded rows are absent from the spine as well.
Two tables of contents in the same ordernav.xhtml is the EPUB 3 navigation document and toc.ncx is the older NCX fallback. Both list every included chapter title, so a renamed row appears renamed in both.
An OPF package with your metadatacontent.opf declares EPUB 3.0 and carries dc:title, dc:language and dc:creator when an author was entered, plus a generated UUID and a UTC modification time. No cover, publisher, series or description is written.
A fixed reading stylesheetbook.css sets a serif body, 1.65 line height, heading sizes and image limits. Rules from page stylesheets are gone, though inline style attributes that survive sanitizing can still override parts of it.
A success line and a downloaded blobThe status reads “EPUB created. Your download should start automatically.” The tool does not show the file size, so open the archive to confirm the chapter count and metadata.

When people reach for it

Common HTML to EPUB use cases

The useful source is a saved document with the intended words already present. These tasks suit articles and manuals more than interactive applications, and they assume a reading edition is more important than the original website layout.

If you need to…What this tool does
Keep a long article for a flightThe article body is split on its headings, scripts and forms are removed, and the EPUB opens in an e-reader without a network. Navigation text before the first heading may become an extra chapter, and remote images may be missing, so check the list first.
Turn a documentation page into chaptersA page built from <h2> sections with no <h1> splits at each <h2>, which gives a technical article a contents list without editing the source.
Make a handout readable on an e-readerPaste the exported HTML from a writing app, review the headings, exclude the table of contents block, and download a book whose chapter titles you control.
Build a small EPUB for testing a readerChoose the number of chapters by choosing the headings, set a language tag, and inspect nav.xhtml and toc.ncx in the download. It is a quick way to produce a predictable test file.
Rescue text from a saved page with heavy chromeThe sanitizer drops forms, scripts and embedded frames while keeping paragraphs, lists and tables. If navigation text survives, it usually sits before the first heading; exclude that untitled chapter.
Package an essay that has no headingsA page without <h1> or <h2> becomes one chapter, titled Chapter unless you rename it in the chapter list. The text still gets the reading stylesheet and a place in both contents files.

Why use it

Why convert a saved HTML page into an EPUB

An EPUB is useful when a saved page should behave like a book on a reading device. This conversion focuses on document text and navigation, letting you inspect the structure rather than treating a website’s screen layout as a finished ebook.

Carry a long document into an ebook reader

A locally saved article or manual may be awkward to use in a browser on an e-ink device. An EPUB gives that material a book container and navigation, so reading can continue in the app you already use.

Check page structure instead of trusting visual headings

Large text on a webpage is not always a real heading element. The detected chapter list reveals what the HTML actually contains, helping you correct source markup or adjust expectations before distributing a misleading contents list.

Separate article content from the site’s presentation

A webpage can include menus, controls and styles that have no purpose in a reading edition. Reviewing the sanitized preview makes it easier to see what remains useful as prose and what needs removing from the supplied source.

Keep the saved page as a reference for missing assets

A reading copy may omit pictures or styling on which the original explanation depended. Retaining the HTML and its asset folder gives you a source to consult when checking diagrams, references or a later, more complete edition.

When it does not work

Why HTML to EPUB may fail

Every message below comes from a gate in the converter rather than from a reading system. Most are fixed in the source file; the last two are fixed in the book fields or by changing how images are written.

  • The file is larger than 10.0 MB

    The size gate runs before the file is read, so no conversion starts. The message names 10.0 MB and suggests a smaller file. Save the article as HTML without its asset folder, or paste the article body instead of choosing the whole saved page.

  • A chosen file holds more than 5,000,000 characters

    This is a character count, not a byte count, and it is checked after the file is decoded. The message asks you to trim the page to a single article. Removing embedded base64 images or long scripts is usually enough; pasted source is not counted by this gate.

  • The body has no readable content after sanitizing

    A page made only of scripts, styles, frames or empty elements sanitizes to nothing, and Review chapters stops with “No readable content was found. Paste the HTML of a page or article.” Save the page again with its article text, or paste the article body.

  • More than 1,000 chapters are detected

    Every matching heading starts a chapter, so a page that uses <h2> for every paragraph can cross the cap. The message says more than 1,000 chapters were detected. Switch How to split to One chapter: whole page, or remove repeated headings.

  • The book title is empty

    The writer refuses a blank title even when the page had one, because the field may have been cleared. The message is “Give your book a title before downloading.” Type a title in Book details and press Download EPUB again; no review is needed.

  • The language field is not shaped like a language tag

    createEpub accepts 2–8 letters, optionally followed by hyphen groups of 1–8 letters or digits. A value such as en_US or e is refused with a message naming en, en-US, fr and zh-Hans. A word such as english passes the shape check but may not identify a language to a reader.

  • Images are broken or absent in the book

    The sanitizer removes a bare relative src and the writer packages no image files. An https source stays a remote reference, so an offline reader shows nothing. Use a base64 data: URI for an image that must travel, or accept that the book is text-only.

Repair paths

How to fix common HTML to EPUB issues

Match the sentence you see to a row. The first four are input problems, the next two are book-field problems, and the last is about images that were never packaged.

What you seeLikely causeWhat to do
“This file is larger than 10.0 MB…”The byte gate refused the file before reading it.Save a text-only copy of the page, split the HTML at an article boundary, or paste the article body into the editor instead of choosing the file.
“This HTML is larger than 5 million characters…”The decoded file crossed the character gate after it was read.Delete embedded base64 images, long script blocks and repeated navigation, or paste only the article section; the file limit and this gate are separate.
“No readable content was found…”Sanitizing left no text, usually because the body held only scripts, frames or styles.Save the page as HTML again and confirm it opens with article text in a browser, or copy the article markup into the editor and review it.
“More than 1,000 chapters were detected.”Too many matching headings were found for the export cap.Set How to split to One chapter: whole page, or remove repeated heading levels in the source before reviewing again.
“Give your book a title before downloading.”Book title is blank after trimming.Type a title under Book details; the page title is only copied into that field when the field is empty or still shows My HTML book.
“Use a language code such as en, en-US, fr or zh-Hans.”The language value does not match the accepted shape.Use two to eight letters with optional hyphen groups, such as en, en-GB, fr or zh-Hans; avoid underscores and single letters.
Images show as empty boxes or are missingA relative path lost its src, or an https image was never packaged.For an image that must work offline, embed it as a base64 data: URI in the HTML before review; otherwise keep the https reference and read the book online.

Plain-language notes

Key HTML and EPUB terms explained

The terms below decide how a page becomes a book here: what gets read, where chapters come from and what the archive contains. They are the words that change an input or an output.

HTML source

The text of a web page as saved by the browser, including tags, attributes, scripts and styles. This tool reads that text, parses it with the browser’s HTML parser and takes the body; the .html extension alone does not guarantee clean markup.

Sanitizing

The step that removes tags and attributes a book cannot safely carry, using DOMPurify with an allowlist. Scripts, styles, frames, form controls, media elements and event handlers go; paragraphs, lists, tables, links and data: images generally stay. The output is what the preview shows.

Heading split

The rule that turns headings into chapter boundaries. One level is chosen for the whole page: <h1> if any exists, otherwise <h2>, otherwise no split. The chosen heading tags are removed from the body and rewritten as the chapter’s <h1> title.

Untitled chapter

A chapter created from text before the first heading. It has no title, so it appears as Untitled chapter in the list and Chapter in the export unless you rename it. Site navigation or a byline often lands here, which is why the first row is worth checking.

EPUB 3

The current EPUB container standard: a ZIP with a mimetype entry, a container file, an OPF package, XHTML documents and a navigation document. This writer follows that shape but does not run EPUBCheck, so the presence of the files is not a conformance certificate.

OPF

The package document, content.opf, that lists metadata, manifest items and the spine reading order. Here it declares version 3.0, the title, language, optional creator, a generated UUID and a modification time, plus one manifest item per chapter and contents file.

Nav and NCX

Two tables of contents. nav.xhtml is the EPUB 3 navigation document; toc.ncx is the older NCX file kept for reading systems that still look for it. Both are generated from the included chapter titles, in the same order as the spine.

Data URI

An image written directly into the HTML as data:image/…;base64,…. It survives sanitizing and travels inside the chapter XHTML, so it works offline, but it inflates the chapter size. A normal https image is only a reference and is never added to the EPUB manifest.

HTML, MHTML and complete-page saves

An HTML-only save supplies one document; a complete-page save usually adds a sibling asset folder. MHTML bundles resources differently. This tool reads the HTML you provide and does not import every kind of saved webpage container.

Other ways to do it

HTML to EPUB vs. alternatives

Another tool is the better choice when the job is batch conversion, visual editing, or keeping the page’s design. Here is what each path costs compared with exporting one page in this tab.

OptionBetter whenTrade-off
PandocYou already use a terminal and want batch conversion or a scripted pipeline with a custom stylesheet.A command-line workflow can process many sources and apply custom settings. Maintain those settings and review how resources and chapter structure are mapped.
Calibre desktopYou need a library, a cover editor, metadata lookup or conversion of many formats.A desktop workflow offers broader format and library options. Configure it for the saved document and inspect the result rather than assuming a webpage converts with its original design.
SigilYou want to edit the EPUB after export: fix a chapter break, add a cover or adjust the XHTML directly.Another application to install and learn; rebuilding the book here later would discard those edits.
Browser print to PDFYou need the page to look exactly as it did on screen, including its layout.A fixed page rather than reflowable text; it is hard to read at another font size and usually larger.
Leave the page as a saved HTML fileYou only need to read the page on the same device and do not need an e-reader.The saved document remains available in an HTML-capable app. No EPUB package is created, and companion assets must remain accessible wherever you read it.

Your files and this tool

Privacy, accuracy and HTML to EPUB limits

The conversion is local, but the page is still a web page. These points separate what stays in the tab from what the browser or a later reading system may request.

  • The chosen file is read with the File API and parsed in memory; no request carries the HTML to a server. Pasted source never leaves the editor, and the EPUB is assembled as a blob in the same tab.
  • Closing or reloading the tab discards the file, the chapter list and the metadata. The tool writes nothing to localStorage or IndexedDB, so there is no draft to recover and no copy to clear later.
  • Opening the page loads the site’s scripts, styles and the shared analytics tag; the sample HTML is a string inside the page script, so pressing it makes no extra request. None of those requests includes your source.
  • A preview renders the sanitized chapter, so a remote https image in it is requested from its host when you open that preview. The tool does not download the image into the EPUB; the request comes from the browser showing the preview.
  • A later reader may fetch remote image URLs and link targets when the book is opened. If that matters, remove those references before export or use base64 images, and open the EPUB in airplane mode to see what is actually inside.

A little more detail

Frequently asked questions about HTML to EPUB

Does this convert a whole website or just one page?

One document per export. The tool has no URL field and does not follow links, so a saved article, a chapter of documentation or a blog post is the right input. For a site with several pages, save each page as HTML and export them one at a time, or merge the pages into one HTML file before reviewing the chapter list.

How do I save a web page as HTML?

In Chrome or Edge, press Ctrl+S or Command+S and choose Webpage, HTML Only; Firefox offers Web Page, HTML Only. You get one .html file. The Complete option also creates an asset folder, but this tool reads only the .html file, so pictures in that folder are not packaged. Pasting the page source is the other route, and it avoids the 10 MB and 5,000,000-character file gates.

Will the EPUB look like the original page?

No. The body is sanitized and placed under a fixed reading stylesheet, so type, spacing and page width come from the book, not the site. Style blocks, linked stylesheets and class-based layout are removed; an inline style attribute may survive and affect one element. Expect a readable article or documentation page, not a visual replica.

Why did my chapters split on h1 when I expected h2?

The rule is one level for the whole page. If any <h1> exists, every <h1> is a boundary and <h2> lines stay inside those chapters. Only when there is no <h1> does the tool switch to <h2>. To split at level two, remove the <h1> from the source and review again; choosing One chapter: whole page makes a single chapter instead.

Are images embedded in the EPUB?

Only base64 data: images are inside. An https image keeps its URL, so an online reader may fetch it and an offline reader will not; a bare relative src such as images/a.png is removed during sanitizing. No images folder or manifest entry is written. For a self-contained book, replace each image with a data URI before review, which makes the chapter file larger.

Why is a saved interactive webpage empty after conversion?

Some sites save an application shell whose article appears only after JavaScript fetches data. This converter removes scripts and works from the markup you supply, so it cannot recover content absent from that file. Save a version with the actual article text, or copy suitable HTML source that already contains it, then review the preview before exporting.

Why is Download EPUB disabled?

It is disabled until at least one chapter is included and the current HTML has been reviewed. Typing in the editor or choosing a different split mode marks the chapter list stale and clears the prepared output. Press Review chapters again; renaming chapters or editing the book title, author or language does not disable the button.

What are the size and chapter limits?

A chosen file may be 10 MB at most and is refused if its decoded text exceeds 5,000,000 characters. An export may contain at most 1,000 chapters; more than that stops the review. Pasted HTML skips the two file gates but still hits the chapter cap. The book title is capped at 300 characters by the field and by the writer.

Is the EPUB checked or validated?

No. The writer builds the archive and offers it as a download; it does not run EPUBCheck or report schema errors. The structure is EPUB 3: stored mimetype first, container.xml, an OPF 3.0 package, nav.xhtml, toc.ncx, book.css and one XHTML file per included chapter. Unzip the file to confirm the chapter count and metadata before relying on it.