How do I convert a text file to the EPUB format?

Happened upon this thread many moons later.

Just liked to point out there is a command line tool Calibre uses to convert. It's called (surprise, surprise) ebook-convert. See 'ebook-convert -h' or 'ebook-convert dummy.html .epub -h' to see conversion options for converting html to epub.

Haven't explored it though. I am most curious about --list-recipes (and if it works), it looks as somethings interesting.


I'd say, Calibre is for you. It works on Linux, Mac OS X, and Windows.

Input Formats: CBZ, CBR, CBC, EPUB, FB2, HTML, LIT, MOBI, ODT, PDF, PRC**, PDB, PML, RB, RTF, TXT

Output Formats: EPUB, FB2, OEB, LIT, LRF, MOBI, PDB, PML, RB, PDF, TXT


For the Mac OS X and Windows, I have had success with Stanza for Desktop.

This supports a good range of export formats.

More importantly, it copes very well with

  • detecting chapters in large text files.
  • unicode, including "significant" characters like < and &.