How to convert TXT to EPUB
Plain text files are easy to write and share, but they make poor ebooks: no chapters, no table of contents and no formatting. Converting TXT, Markdown or HTML to EPUB fixes that, and it's quick if you mark your chapter headings first. Here's how to prepare the file and which tool to use.
Updated 2026-11-11
Prepare the text file
- Put each chapter title on its own line, with a blank line before and after.
- If you use Markdown, start chapter titles with # so converters detect them.
- Separate paragraphs with a single blank line.
- Remove any hard line breaks inside paragraphs.
- Save the file as UTF-8 so quotes, accents and dashes display correctly.
Ways to convert
- EbookMagic: import TXT, Markdown or RTF, check the detected chapters, add a cover and export EPUB.
- Calibre: add the TXT and convert to EPUB, using Markdown input formatting for headings.
- Pandoc: convert Markdown or HTML with one command, such as pandoc book.md -o book.epub.
- Sigil: paste HTML into an EPUB project and edit it by hand.
Convert TXT to EPUB with Calibre
- Add the TXT file to Calibre and click Convert books.
- Under TXT input, set Formatting style to Markdown if you used # headings.
- Under Structure detection, check that chapters are found.
- Set Output format to EPUB, add a title, author and cover in Metadata, and convert.
Why structure matters
An EPUB is really a small website: chapters are HTML files, with a navigation file for the table of contents. Converters need to know where chapters begin to build that structure. When chapter headings are clearly marked, readers can jump between chapters, e-readers show progress correctly, and stores accept the file without complaints. Without them, the whole book becomes one long chapter that's hard to navigate.
Next steps
Mark your chapter headings, save as UTF-8, and convert a test copy. Open it in an EPUB reader and check that the table of contents lists every chapter. Then add a cover, title and author details, and validate the final file with EPUBCheck if you plan to publish it in stores. If your text came from a scan or an old website, proofread it carefully before converting.
Common mistakes
- Saving the file in a legacy encoding instead of UTF-8.
- Leaving chapter titles unmarked.
Convert your manuscript with EbookMagic
Import a DOCX, PDF, EPUB, TXT, Markdown or RTF file, edit it chapter by chapter, and export a clean EPUB, a KDP-ready print PDF or a DOCX.
Import a manuscriptQuestions people ask
- Can I read a TXT file on an e-reader?
- Some e-readers open TXT, but there are no chapters or formatting. Converting to EPUB gives a much better reading experience.
- What's the easiest way to convert Markdown to EPUB?
- Pandoc converts Markdown to EPUB with a single command. If you prefer a visual editor, import the file into EbookMagic.
- Why do quotes look strange after converting?
- The file probably wasn't saved as UTF-8. Re-save it with UTF-8 encoding and convert again.
- Can I convert HTML to EPUB?
- Yes. Calibre and Pandoc both convert HTML to EPUB. Make sure headings use h1 or h2 tags for chapters.
- Can I add a cover to a TXT conversion?
- Yes. Calibre and EbookMagic both let you add a cover image and book details before exporting the EPUB.
- Is Markdown better than plain text for ebooks?
- Yes, slightly. Markdown marks headings, italics and lists, so converters can keep that formatting in the EPUB.
- What's the smallest EPUB I can make?
- An EPUB can be a single short chapter. Even a one-page story benefits from a title, author and cover so it displays properly in reading apps.
- Can I convert RTF to EPUB?
- Yes. Calibre converts RTF, and EbookMagic imports RTF files into editable chapters.
More epub guides
Keep exploring
- Bedtime stories
- Personalized books
- How to write a book
- AI story generator
- Short stories & fairy tales
- Writing prompts
- Book cover design
- Coloring pages
- Self-publishing guides
- Fantasy name generators
- Story ideas
- Personalized gift ideas
- Author marketing
- Reading guides
- Literary devices
- Poetry forms
- Story structure
- Card messages
- Free author tools