TXT 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.
Plain text, with one rule applied and no guessing.
A blank line starts a new paragraph. That is the only rule, and it is deliberate: the tempting extras — a short line is a heading, a line in capitals is a title — are guesses, and a guess that is wrong chops the book in the wrong place and looks like it was meant. A single newline inside a paragraph becomes a line break rather than a split, which is what keeps addresses and verse intact.
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 invent chapters. Plain text has no structure in it, so what comes out is one chapter of paragraphs, and a table of contents with one entry. If you want chapters, mark them as headings in HTML and use that page instead.
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 TXT — the same conversion the other way
- EPUB to HTML — another way out of one
- HTML to EPUB — another way into a book