Remove HTML Tags

Paste HTML from a page, an email template or a CMS. You'll get readable plain text with the paragraphs and lists kept.

110 → 110 characters

Last reviewed:

What happens to each part of the HTML

Turning HTML into text takes more than deleting everything between angle brackets. Some tags mark where a line or paragraph ends, some hold content that was never meant to be seen, and character references like & need turning back into the symbols they stand for. This is how each part is handled.

In the HTMLIn the plain text
Paragraphs, headings, divs and blockquotesTheir own lines, usually with a blank line between
Line break (br) tagsA single line break
List items (li)A new line starting with a bullet (•)
Table cells (td and th)Separated by tabs, one row per line
Links (a)The link text only
Bold, italic, span and other inline tagsRemoved, with the words left in place
Script, style, noscript and template blocksRemoved completely, contents included
CommentsRemoved completely

Inline tags vanish without leaving a space, which is right most of the time. It goes wrong when two pieces of text were separated only by tags, such as a label and a price styled side by side: they come out glued together as Price:$5. Skim for joins like that and fix them in Find and Replace.

If you can see the page in a browser, selecting the text and copying it gives a similar result. Converting the HTML itself is for the times you only have the code: an email template, an export from a website's content system, a feed, or a database field full of markup.

Character references like & and  

HTML writes some characters as codes called character references, either because the raw character would be read as markup or because it's awkward to type. Named references put a word between & and a semicolon. Numeric ones give the character's Unicode number in decimal (€) or hexadecimal (€).

ReferenceBecomes
&&
&lt; and &gt;< and >
&quot; and &apos;" and '
&nbsp;An ordinary space
&ndash; and &mdash;A hyphen (-)
&hellip;Three dots (...)
&lsquo; &rsquo; &ldquo; &rdquo;Straight quote marks
&#8364; and &#x20AC;€
&euro; and &frac12;€ and ½
&rarr; (an arrow)Left as written

The HTML standard defines more than 2,000 named references. The converter decodes the common ones in the table, plus currency signs, fractions, the degree sign, the copyright, registered and trademark signs and similar everyday symbols, and every numeric reference. A rarer named one is left exactly as written, so search the result for an & before you publish it.

Example: A line from a restaurant's web page

  1. HTML text: Fish &amp; chips&nbsp;&mdash; &#8364;5 a portion
  2. Plain text: Fish & chips - €5 a portion

Dashes come out as plain hyphens and curly quotes as straight ones. That keeps the text safe for forms and code, at the cost of a little typography.

Decoding only goes one way. Once &lt; has become a real less-than sign, pasting the text back into HTML can turn it into the start of a tag, so keep the original if the text is headed back into a web page.

Writing a plain-text version of an HTML email

HTML emails are often sent with a plain-text twin inside the same message, for mail apps and readers that don't show HTML. Converting the HTML template is the quickest way to start one, but the result needs a little editing to read well on its own.

  • Put the links back. The converter keeps link text and drops the address, so “Shop the sale” needs its address written after it. Pull every address out first with the URL Extractor.
  • Replace buttons with plain sentences. “Shop now” on a line by itself means little without the button around it.
  • Delete layout leftovers, such as a “View in browser” line or a row of menu links that only made sense as buttons.
  • Keep paragraphs short, since some mail apps show plain text in a fixed-width font.

When the converted text looks wrong

  • Text missing after a less-than sign. Well-made HTML usually writes it as &lt;, but hand-typed snippets sometimes contain a bare one, as in “if x < 5 and y > 2”. The converter reads that as the start of a tag and drops everything up to the next greater-than sign, leaving “if x 2”.
  • Uneven blank lines. Deeply nested layouts leave extra gaps. Run the result through Remove Extra Spaces with empty lines removed.
  • Hidden text showing up. Menus, pop-ups and labels hidden by the page's styles are still in the HTML, so they appear in the text.
  • Almost nothing comes out. Pages that load their text with scripts after opening may have little in their source. Copy the page as displayed instead.
  • Tables that don't line up. Tabs keep the cells apart but won't align them. For anything bigger than a few rows, copy the table from the page straight into a spreadsheet.

Sources and further reading

How to use it

  1. 1Paste the HTML.
  2. 2Read the plain text on the right.
  3. 3Copy it, or use it as input for another text tool.

Questions

What happens to links?

The link text is kept and the address is dropped, the same as when you copy text from a web page. Use the URL extractor first if you also need the addresses.

Are scripts removed?

Yes. Script, style and template blocks are removed completely, along with HTML comments, so only the visible text is left.

Is my text uploaded anywhere?

No. Everything happens in your browser; your text never leaves your device.

Also handy: Text to QR Code, Shuffle a List