txt2html - Text to HTML converter

txt2html's main website is http://txt2html.sourceforge.net. The project summary page is at http://sourceforge.net/projects/txt2html/.

A similar mirror page is at http://www.katspace.com/tools/text_to_html/

txt2html's original website was at http://www.aigeek.com/txt2html/

Table of Contents

What is txt2html?

txt2html is a Perl program that converts plain text to HTML. It uses the HTML::TextToHTML perl module to do so. Look at the README file.

What is HTML::TextToHTML?

HTML::TextToHTML is a Perl module that converts plain text to HTML.

It supports headings, lists, some tables, simple character markup, and hyperlinking, and is highly customizable. It recognizes some of the apparent structure of the source document (mostly whitespace and typographic layout), and attempts to mark that structure explicitly using HTML.

Our intent in writing this tool is to provide an easier way of converting existing text documents to HTML format.

What is txt2html not?

txt2html is not a program to convert wordprocessor files or other marked-up document formats. It is also not a program to convert HTML to text. Most HTML browsers do that.

If you need to convert something other than plain text to HTML, or you need to convert from HTML, you should look for a more appropriate tool.

txt2html is not a program for automatically generating a table-of-contents from a file. If you want that, then use txt2html to generate a HTML file, and then use htmltoc or hypertoc on the HTML file.

What's the current version?

The current version is v2.01. A list of changes can be found here and in the tar file.

Obtaining and installing txt2html

It's a Perl module with the script and everything bundled in the tarball, so installation is pretty easy. You don't need to compile anything.

  1. Get the current version of txt2html/HTML::TextToHTML at sourceforge download txt2html
  2. Untar the tarball somewhere.
  3. Follow the instructions in the INSTALL file. Look out for the dependencies!

    This will install the script in /usr/local/bin by default, but note that the perl install stuff is clever enough to figure out where your copy of perl is installed, and alter the script accordingly. It will also install the standard links dictionary in /usr/share/txt2html.

  4. If you want override the standard links dictionary, then add your own version to ~/.txt2html.dict so it will be used automatically.

If you prefer an RPM install, look for various RPMs, made by other people. There is also an official Debian package, though naturally all RPMs and Debs will lag behind the official tarball here.

How to Use txt2html

What can txt2html handle?

Look at this sample document for a basic idea. txt2html is more flexible than it looks though. You don't need to make your documents look just like this for txt2html to work.


If you just want to make obvious URL references into hyperlinks, you just have to install the standard links dictionary.

For learning how to configure your own hyperlinks dictionary, take a look at the sample links dictionary. If you have improvements for this file, please mail them to me so everyone can benefit.

How is txt2html licensed?

Look at the LICENSE or the plain text version. Basically this is licensed under the Artistic License and the GPL.

What platforms will it run on?

If you can get a copy of Perl (version 5 or later), then you can use txt2html. Don't ask me how, because I've never tried it. Other people tell me it works fine.

What is the future of txt2html?


Thanks to all the people who have given us ideas, patches, bug reports, wish lists, and moral support.

SourceForge.net Logo

[ Home   |   txt2html sourceforge   |   Download ]