HTML to EPUB
Nothing you choose here leaves your browser, and nothing is downloaded to make it work — not a library, not a reader, nothing. An EPUB is a ZIP of web pages, and your browser already knows how to deflate; this page writes the book around it.
A .htm is the same file as a .html — the short extension is a leftover from MS-DOS, which allowed only three characters after the dot. This page takes either. More about that.
A web page, turned into something a reader will actually open.
The hard part is not the ZIP. It is that a browser forgives and an e-reader does not: an unclosed paragraph, a stray </div>, an — every one of those is fine on the web and each one makes a book that will not open, usually without saying which file was wrong. So the markup is rebuilt: tags closed in the right order, entities turned into real characters, scripts and stylesheets dropped, and anything an e-reader does not recognise unwrapped with its words kept.
What an EPUB actually is
A ZIP file with a particular set of things in it. A
mimetype file saying application/epub+zip, a
META-INF/container.xml pointing at a package file, that
package file listing everything the book contains and the order to read it
in, and then the chapters, which are ordinary web pages. Rename an EPUB to
.zip and you can open it with anything.
One rule in there catches nearly everybody who writes one by hand:
the mimetype entry must be first in the archive and
stored uncompressed, so that a reader can identify the file by
reading twenty bytes at a fixed position without unzipping anything.
Compress it and you have a perfectly valid ZIP that no e-reader will accept
as a book. That was checked against a real book from Project Gutenberg
before this was written, and it is checked again every time these pages are
tested — by Python, which did not write them.
Books you bought are usually locked, and this says so
Most shops sell books wrapped in DRM. The
chapters inside are encrypted, and nothing can read them without the key
— not this page, not any converter, whatever it claims. The book
announces this itself, in a file called
META-INF/encryption.xml, so it is recognised and said plainly
rather than producing a file full of unreadable characters and leaving you
to wonder what you did wrong.
That is a limit of the file, not of the tool. A tool that appears to do it anyway is either stripping the protection, which is a legal question rather than a technical one, or giving you nonsense.
Why there is no EPUB to PDF here
Because it is not a conversion. A PDF fixes text to a page; an EPUB deliberately has no pages at all, and reflows to whatever it is read on — that is the entire point of the format. Going from one to the other means typesetting: choosing a page size, a typeface, a size, a margin, and where every break falls. Those are real decisions, and a converter that makes them silently has made them for you. An e-reader, Calibre, or a word processor will do it with the choices in front of you, which is the right place for them.
What it will not do
It will not fetch anything the page refers to. A stylesheet, a script or a picture held at a web address is simply not there once the HTML is on its own, and going to get it would mean this page contacting another site — the one thing it promises never to do. Pictures written into the page as data are included; the rest are counted and reported.
It does not open MOBI, AZW or AZW3 — Amazon's formats, which are a different container entirely and, in the case of anything bought from the Kindle store, encrypted as well. It does not open password-protected ZIPs. And it is not a proofreader: what goes in is what comes out, tidied but not rewritten.
Where to go next
- EPUB to HTML — the same conversion the other way
- EPUB to TXT — another way out of one
- TXT to EPUB — another way into a book