Toolvito

Works on this device

HTML to Text Converter

Paste HTML or open a saved page to get its text without the tags. Links, lists, tables, headings and the alt text of images stay readable. You can also turn plain text into simple HTML. The HTML is read as text in your browser. It is never run, and it is not sent to a server.

Your HTML or text

Takes the tags out of a web page, a saved HTML file or a piece of HTML and gives the text that a reader sees.

Paste a whole page or a piece of HTML. It is read as text in this browser. Nothing in it is run or loaded.

Keep the place of empty cells for a table of data, so that each value stays in its column. Leave empty cells out for a page that is laid out with tables.

More options

The nav, aside and footer elements and all that stands inside them.

The title is the text of the title tag. A browser shows it on the tab, not in the page.

Only needed for short links such as /about. Type the address the HTML came from, and each short link is written in full. Nothing is loaded from it.

Type 0 for no limit. With a number from 20 to 1000, longer lines are broken at spaces.

Text in an element with the hidden attribute, or with display:none in its style attribute.

Soft hyphens and zero-width characters. Turn this off for Persian and other text that needs the zero-width non-joiner.

Your values are worked out in this browser. They are not sent to a server.

Your converted text will show here

Paste the source, or choose Try an example.

How to use the converter

  1. Choose what you want to make: plain text from HTML, or simple HTML from plain text.
  2. Paste the source in the box, or open a file from your device. The result shows as you type.
  3. Choose how links, images and tables are written. More options has the part of the page, the page title, short link addresses, headings, a line length and hidden text.
  4. Choose Copy text or Download file.

What happens to each part of the HTML

  • Text: runs of spaces and line breaks become one space, as a browser shows them. Text inside <pre> keeps its spaces and line breaks.
  • Paragraphs, headings, lists, tables, quotes: each gets an empty line before and after it, and never more than one. <br> starts a new line. A section such as <div> starts on a new line.
  • Links: the address is put after the link words in round brackets, or as a number with a list of addresses at the end, or it is left out. An address is not repeated when the link words already are that address.
  • Email and phone links: the address or number is shown without mailto: or tel:.
  • Images: the alt text is put in square brackets. An image with no alt text leaves nothing.
  • Lists: a bullet item starts with - , a numbered item with its number. A list inside a list is moved in by two spaces.
  • Tables: the cells of a row stand on one line with | between them. An empty cell keeps its place, so each value stays in its column: the cells d, empty and f give d | | f, with two | marks and only spaces between them. You can also leave empty cells out, which is better for a page that is laid out with tables, or put each cell on its own line.
  • Quotes: each line of a <blockquote> starts with > .
  • Left out: scripts, styles, comments, the page title (unless you ask for it) and text that the HTML hides with hidden or display:none.
  • Character names: names such as &amp; and &eacute; and numbers such as &#8212; are turned into their characters. So HTML that was made safe, such as &lt;b&gt;, comes out as <b>.

Options for a whole web page

  • Part of the page: the whole page, or only the main part. The main part is the first <main> element (or an element with role="main"). When a page has none, the first <article> element is read. When it has none of them, the whole page is read and a note says so.
  • Leave out menus, side notes and footers: every <nav>, <aside> and <footer> element is left out with all that stands inside it.
  • Page title: the text of the <title> tag is put on the first line.
  • Address of the page: a saved page often has short links such as /about or ../news.html. Type the address the page came from and each short link is written in full, by the rules of RFC 3986. Nothing is loaded from that address.
  • Spaces and line breaks: keep them as they are in the source when the lines of the source matter. This reads the whole source as if it stood inside a <pre> tag.

Text to HTML: what is made

  • An empty line starts a new paragraph (<p>). A line break inside a paragraph becomes <br>. You can also make every line a paragraph, or keep the whole text in one <pre> block.
  • The characters &, < and > are written as &amp;, &lt; and &gt;. So a tag that stands in your text is shown as text and cannot run.
  • A web address that starts with https:// or http:// and an email address can be made into links.
  • With the list option, the lines between two empty lines become a list when every line starts with -, * or a bullet (a <ul> list), or every line starts with a number and a full stop or a bracket (an <ol> list). The numbers that you typed are kept with start and value.
  • You can ask for a whole page. It gets a doctype, a <head> that names UTF-8 as its character set, a viewport line for small screens and a title, and a <body> with your text.

Worked examples

The HTML <h1>Tulips</h1><p>Plant in <b>autumn</b>. See the <a href="/guides/soil">soil guide</a>.</p><ul><li>Bulbs</li><li>A spade</li></ul> gives four lines of text with an empty line between the blocks: Tulips, then Plant in autumn. See the soil guide (/guides/soil)., then - Bulbs and - A spade.

With the address of the page set to https://www.example.com/shop/tulips.html, the link in that text is written as (https://www.example.com/guides/soil).

A table row with the three cells Tulips, an empty cell and 4.50 gives the line Tulips | | 4.50. With empty cells left out, the same row gives Tulips | 4.50.

The other way round, the text Tom & Sam <team> becomes <p>Tom &amp; Sam &lt;team&gt;</p>.

Limits you should know

  • This page does not fetch a web address. Paste the HTML, or save the page in your browser and open the file here.
  • The page reads the HTML as text and never draws it. Scripts are not run, so text that a page makes with scripts after it loads is not in the result. Text inside <noscript> is kept.
  • Styles in a <style> block or a style file are not applied, so text that such a rule hides is not known to be hidden. Only hidden and display:none on the tag itself are followed.
  • A page that is laid out with tables or columns is read from the first cell to the last. Check the order of the text. If the text has | marks that you do not want, choose to leave empty cells out, or to put each cell on its own line.
  • Two pieces of text that only a style keeps apart, such as two buttons side by side with no space between their tags, run together in the text.
  • In a table row, a cell that spans columns (colspan="2") is followed by an empty place, so the next cell stays in its column. A cell that spans rows (rowspan) is not followed: in the rows below it the cells stand one place to the left.
  • The cells of a table are not lined up under each other with spaces. Count the | marks to find a column. A row in which every cell is empty gives no line.
  • A paragraph, a list or a line break inside a table cell still starts a new line, so such a row takes more than one line. The cells that follow go on in the newest line, each with its | mark in front. So a table whose cells hold paragraphs is not written as one line for each row.
  • When you choose to leave empty cells out, an empty cell leaves no gap in its row, and the cells that follow move one place to the left.
  • When you keep the spaces and line breaks of the source and also leave empty cells out, no | is written between the cells of a row. Choose the first way under Tables to get the | marks.
  • Text that a browser shows only in some cases is kept: the content of <details>, every <option> of a menu, and the spare text inside <video>, <audio> and <object>. A value typed into an <input> tag is not text and is left out.
  • Broken HTML is read with the usual repair rules: a missing end tag is closed where a browser would close it. Very unusual cases can differ from a browser.
  • The table of character names holds the 252 names of HTML 4, &apos; and some common newer names. A name that is not in the table stays as it is written.
  • A file that you open must be saved as UTF-8 text (or UTF-16 with a byte order mark) and have at most 5 MB. The box takes up to 1,000,000 characters of HTML.
  • A <base> tag in the HTML is not followed. Type the address of the page yourself if you want full link addresses. They are worked out from the text of the two addresses by RFC 3986. A browser reads a few unusual forms in another way, such as an address with a backslash or with three slashes at its start.
  • The result is plain text only. This page does not make Markdown.
  • Text to HTML is simple on purpose: paragraphs, line breaks, lists of one level and links. It does not make headings or tables.
  • For the plain text part of an email, use the Email Plain Text Converter. To change only character names such as &amp; and leave all the rest as it is, use the Text Escape & Unescape Tool.

Related tools