Skip to content

HTML Tag Remover

Paste HTML and get plain text back as you type: tags, comments, scripts and styles are removed, line and paragraph breaks are kept, and common entities such as & and   are turned into the characters they stand for. Three counters show input size, output size and how many tags went. Free, no sign-up, and nothing you paste is uploaded.

How to Use the HTML Tag Remover

  1. 1. Paste your HTML. A whole page source, an email's HTML or a fragment copied from a CMS all work.
  2. 2. Read the plain text. The result updates as you type; there is no button to press.
  3. 3. Check the counters. Input Characters counts your pasted text, Output Characters the result, and Tags Removed every <…> item found, including closing tags, comments and the tags around scripts.
  4. 4. Copy the output. Copy Output puts the plain text on your clipboard.

What Gets Removed, Kept and Decoded

The tool works in five fixed steps, in this order:

  1. Comments, scripts and styles are removed together with everything inside them, so JavaScript and CSS never leak into your text.
  2. Line breaks and tabs — each <br> becomes a newline, and so does the closing tag of a p, div, heading (h1–h6), li or tr. The end of a table cell (td or th) becomes a tab, so cells in a row stay apart.
  3. All other tags are deleted, keeping the text between them. Only real tags count: a < must be followed by a letter, /, ! or ?, so a comparison such as 5 < 6 and 7 > 3 is text and stays.
  4. Entities are decoded once: named references such as &amp;, &lt;, &eacute; or &mdash;, and decimal or hex numeric references such as &#65; and &#x41;. &nbsp; becomes an ordinary space. Text that was escaped twice, such as &amp;#65;, comes out as &#65;, because each reference is decoded a single time.
  5. Whitespace is tidied: runs of spaces become one, three or more newlines become two, and the ends are trimmed.

Worked Example

Input

<!-- draft --><h1>Results &amp; Discussion</h1><p>Scores rose from <b>4&nbsp;to&nbsp;7</b> &mdash; see the <a href="/t">table</a>.</p><ul><li>One</li><li>Two</li></ul><script>track()</script>

Output

Four lines: Results & Discussion, Scores rose from 4 to 7 — see the table., One and Two.

Counters

191 input characters, 69 output characters, 17 tags removed.

The 17 are the comment, the opening and closing tags of h1, p, b, a, ul, script and the two li elements. The script's contents (track()) were dropped with it. Because each block ends in a single newline, the paragraphs here sit on consecutive lines; if your source has blank lines between blocks, the output keeps up to one blank line.

What It Does Not Handle

This is a fast, regular-expression tool for tidying text, not an HTML parser. Know where it stops:

CaseWhat happens
Table cellsCells are separated by tabs and each row gets its own line (<td>A</td><td>B</td> becomes A and B with a tab between)
A bare less-than sign in textKept: 5 < 6 and 7 > 3 stays as typed. A < directly followed by a letter, as in a<b, is read as the start of a tag
Unknown named entitiesA name the tool does not know, such as &notarealname;, stays as typed
Links and imagesThe link text is kept; the address and image alt text are dropped

Which Tool Do You Need?

You haveYou wantUse
HTMLPlain textThis page
HTMLMarkdown that keeps headings, links and listsHTML to Markdown
MarkdownPlain textMarkdown to Text
MarkdownHTMLMarkdown to HTML
Messy HTMLTidy, indented HTMLHTML Formatter

Frequently Asked Questions

What does this HTML tag remover do?
It deletes every HTML tag from the text you paste and returns the readable text. Comments, scripts and styles are removed with their contents, breaks are kept at line ends and block elements, and common entities are decoded.
Will removing HTML tags affect my text formatting?
Yes. Bold, italics, headings, links and lists exist only as tags, so they disappear. You get the words, with a new line wherever a paragraph, heading, list item or line break ended. To keep that structure, convert to Markdown instead.
Can I use this to clean up text copied from a website?
Yes, if you paste the HTML source or the HTML a CMS shows you. Text pasted into a plain box is already plain; the hidden markup is only present when you copy the page source or an email's HTML view.
Does it decode HTML entities?
Yes: named references such as &eacute;, and decimal and hex numeric references such as &#65; and &#x41;. Each is decoded once, so &amp;#65; becomes &#65;. A name the tool does not know stays as typed.
Why did some of my text disappear?
Most likely a < directly followed by a letter, as in a<b, was read as the start of a tag, and everything up to the next > was removed with it. Put a space after the <, or write it as &lt; in the source.
Does it remove the contents of script and style tags?
Yes. Both elements, along with their contents, and all comments, are removed before any other tags are touched.
Is my HTML uploaded anywhere?
No. The stripping runs in your browser as you type and the HTML is not sent to CitationEasy or anyone else.

Related Tools

More in Data, Markup & Code

See all Data, Markup & Code