📗TXT to EPUB - Turn a Text File into an Ebook with Chapters
A book saved off the web is usually one multi-megabyte text file: no table of contents, no way to find your place, and often an encoding that shows up as garbage. This tool turns it into a proper EPUB — chapter lines become a real table of contents, the encoding is repaired, and title, author and cover are filled in.
Free · No sign-up · Runs in your browserLast updated:
Loading tool...
How to use TXT to EPUB
- 1Pick one or more TXT files (several files are joined in order)
- 2Fill in the title and author, and choose a cover if you have one
- 3Confirm how chapters are detected, then click Convert to EPUB
- 4Check the chapter list and the structure self-check, then download
FAQ
- What if chapter detection misses?
- Switch to Custom regex and write your own; it is matched line by line and a matching line becomes the chapter title. To split on a row of asterisks, for example, use ^\*+$. You can also pick One chapter per file and split the text yourself.
- Can a sentence mentioning a chapter be mistaken for a heading?
- Almost never. A heading line has to be short and the number must be followed by whitespace, punctuation or the end of the line, so a sentence that continues past the number is left alone.
- Will it work on a Kindle?
- Yes. Recent Kindle firmware reads EPUB directly, so Send to Kindle is enough; for very old models convert to AZW3 with Calibre.
- How is the encoding repaired?
- By scoring bytes: valid UTF-8 is used as-is, otherwise GBK, Big5, Shift_JIS and EUC-KR are scored on how plausible the resulting characters look. If the preview still looks wrong, set the encoding by hand.
- Do Markdown files work?
- Yes. Choose Markdown headings and the first two heading levels become chapters; deeper hashes are stripped and the text stays as a paragraph.