# phpman > man > html2text(1)

[html2text(1)](https://www.chedong.com/phpMan.php/man/html2text/1/markdown)                           General Commands Manual                          [html2text(1)](https://www.chedong.com/phpMan.php/man/html2text/1/markdown)



## NAME
       html2text - an advanced HTML-to-text converter

## SYNOPSIS
### html2text -help
### html2text -version
       **html2text**  [  **-unparse**  |  **-check**  ]  [ **-debug-scanner** ] [ **-debug-parser** ] [ **-rcfile** _path_ ] [
### -style -width -o -nobs -ascii -utf8
       ] [ **-nometa** ] [ _input-file_ ...  ]

## DESCRIPTION
       **html2text**  reads  HTML  documents from the _input-file_s, formats each of them into a stream of
       plain text characters, and writes the result to standard output (or into _output-file_, if  the
### -o

       If  no  _input-file_s are specified on the command line, **html2text** reads from standard input. A
       dash as the _input-file_ is an alternate way to specify standard input.

       **html2text** understands all HTML 3.2 constructs, but can render only part of them  due  to  the
       limitations  of the text output format. However, the program attempts to provide good substi‐
       tutes for the elements it cannot render.  **html2text** parses HTML 4 input, too, but not  always
       as  successful  as  other HTML processors. It also accepts syntactically incorrect input, and
       attempts to interpret it "reasonably".

       The way **html2text** formats the HTML documents is controlled by formatting properties read from
       an RC file.  **html2text** attempts to read _$HOME/.html2textrc_ (or the file specified by the **-rc**‐‐
       **file** command line  option);  if  that  file  cannot  be  read,  **html2text**  attempts  to  read
       _/etc/html2textrc_.  If no RC file can be read (or if the RC file does not override all format‐
       ting properties), then "reasonable" defaults are assumed. The RC file format is described  in
       the [**html2textrc**(5)](https://www.chedong.com/phpMan.php/man/html2textrc/5/markdown) manual page.

       Debian    version   of   **html2text**   also   can   do   input   and   output   recoding   (see
       /usr/share/doc/html2text/README.Debian for more info).  **html2text**  tries  to  fetch  encoding
       from HTML document. If encoding is not specified, you can use **-ascii** and **-utf8** options.  Out‐
       put is converted to user's locale charset (LC_CTYPE).

## OPTIONS
### -nometa
              By default, Debian version of **html2text** use 'meta http-equiv' tag for input  recoding.
              This option cancels this behavior.

### -ascii -nometa
              this option, plain **ASCII** is used instead. To find out  how  non-ASCII  characters  are
              rendered, refer to the file "ascii.substitutes".

### -utf8 -nometa
              fying this option, **UTF-8** is used instead (both for input and output). This option  im‐
              plies **-nobs**.

### -check
              cessed otherwise. In this mode of operation, **html2text** will report on parse errors and
              scan  errors,  which it does not in other modes of operation. Note that parse and scan
              errors are not fatal for **html2text**, but may cause mis-interpretation of the HTML  code
              and/or portions of the document being swallowed.

### -debug-parser
              Let  **html2text**  report  on  the tokens being shifted, rules being applied, etc., while
              scanning the HTML document. This option is for diagnostic purposes.

### -debug-scanner
              Let **html2text** report on each lexical token scanned, while scanning the HTML  document.
              This option is for diagnostic purposes.

### -help

### -nobs
              score-backspace-character" and boldface letters like  "character-backspace-character".
              Because  of issues with UTF-8, Debian version of **html2text** doesn't produce backspaces,
              so this option really does nothing.

### -o
              Write the output to _output-file_ instead of standard output. A dash as the  _output-file_
              is an alternate way to specify the standard output.

### -rcfile
              Attempt to read the file specified in _path_ as RC file.

### -style
              Style  **pretty**  changes  some  of the default values of the formatting parameters docu‐
              mented in [**html2textrc**(5)](https://www.chedong.com/phpMan.php/man/html2textrc/5/markdown).  To find out which and how the formatting parameter defaults
              are  changed,  check the file "pretty.style". If this option is omitted, style **compact**
              is assumed as default.

### -unparse
              This option is for diagnostic purposes: Instead of  formatting  the  parsed  document,
              generate  HTML  code, that is guaranteed to be syntactically correct. If **html2text** has
              problems parsing a syntactically incorrect HTML document, this option may help you  to
              understand what **html2text** thinks that the original HTML code means.

### -version
              Print program version and exit.

### -width
              By  default, **html2text** formats the HTML documents for a screen width of 79 characters.
              If redirecting the output into a file, or if your terminal has a width other  than  80
              characters,  or  if you just want to get an idea how **html2text** deals with large tables
              and different terminal widths, you may want to specify a different _width_.

## FILES
       _/etc/html2textrc_
              System wide parser configuration file.

       _$HOME/.html2textrc_
              Personal parser configuration file, overrides the system wide values.

## CONFORMING TO
       **HTML** **3.2** (HTML 3.2 Reference Specification - <http://www.w3.org/TR/REC-html32>),

## RESTRICTIONS
       Debian version of **html2text** have no http support. Use **html2text** through pipes  with  curl  or
       wget instead. See README.Debian for more information.

       **html2text**  was written to convert HTML 3.2 documents. When using it with HTML 4 or even XHTML
       1 documents, some constructs present only in these HTML versions might not be rendered.

## AUTHOR
       **html2text** was written up to version 1.2.2 by Arno Unkrig <<arno@unkrig.de>> for  GMRS  Software
       GmbH, Unterschleissheim.

       Current maintainer and primary download location is:
       Martin Bayer <<mail@mbayer.de>>
       <http://www.mbayer.de/html2text/files.shtml>

       This man page was modified for Debian by Eugene V. Lyubimkin <<jackyf.devel@gmail.com>> ⟨⟩

## SEE ALSO
       [**html2textrc**(5)](https://www.chedong.com/phpMan.php/man/html2textrc/5/markdown), [**less**(1)](https://www.chedong.com/phpMan.php/man/less/1/markdown), [**more**(1)](https://www.chedong.com/phpMan.php/man/more/1/markdown)



                                             2008-09-20                                 [html2text(1)](https://www.chedong.com/phpMan.php/man/html2text/1/markdown)
