How to Remove HTML from Text
To remove HTML from text, paste the code into the first box. The tool walks through it once, drops everything between angle brackets and keeps the text that a reader would see. This is the Example input and its result with the default settings:
<h2>Release notes</h2>
<p>Version <b>2.1</b> is out. Read more at <a href="https://example.com/notes">the notes page</a> & share it.</p>
<ul><li>Faster search</li><li>Fixed a "crash"</li></ul>
<script>track();</script>Release notes
Version 2.1 is out. Read more at the notes page & share it.
Faster search
Fixed a "crash"The script is gone, the bold tag is gone, the entities are decoded, and the heading, paragraph and list are on separate lines.
What Happens to Each Part of the HTML
- Tags: opening and closing tags are removed. A greater-than sign inside a quoted attribute, as in title="a > b", does not end the tag early.
- Comments: everything from the start of a comment to its end is removed.
- Script and style elements: the tags and the code inside them are removed. Turn off Remove script and style content to keep that code as plain text.
- Doctype and XML declarations: removed.
- CDATA sections: the text inside is kept.
- A less-than sign that does not start a tag, as in 1 < 2, stays as it is.
The tool does not run or draw the page. It only reads the text you paste, so scripts in it are never executed.
How Line Breaks Are Kept
In a web page, line breaks in the source mean nothing, and the tags decide where lines start. This tool follows the tags. Paragraphs, headings, lists, tables, block quotes and horizontal rules are separated by a blank line. List items, table rows, div elements and br tags start a new line. Table cells are separated by a space.
Line breaks that are already in the text you paste are kept, which is what you want when the input is not really HTML. Runs of blank lines are reduced to one. Turn off Keep line breaks to get everything on one line, or turn on Remove blank lines to get a list without gaps. If a text is wrapped at a fixed width, Remove Line Breaks can join it into paragraphs.
HTML Entities Are Decoded
Entities are codes that stand for characters, such as & for an ampersand, < for a less-than sign and © for the copyright sign. With Decode entities on, the tool turns them into the characters. It knows the numeric forms, decimal and hexadecimal, and 136 common named ones: the Latin accented letters, quotes, dashes, the euro sign and similar.
- A non-breaking space,
, becomes an ordinary space. - A name that the tool does not know, such as
¬arealentity;, is left as it is. - An entity must end with a semicolon.
&without one is not decoded. - Decoding happens after the tags are removed, so
<b>x</b>becomes the text <b>x</b> and is not stripped a second time.
Keep the Link Addresses
By default a link keeps only its text. Turn on Keep link addresses and the address is written after the text, so the link above becomes the notes page (https://example.com/notes). Links to the same page, such as #top, and javascript: links are skipped. A link with no text gives just its address, and a link whose text is the address is not repeated.
To get only the links of a page, without the text, use the URL Extractor.
This Is Not a Security Filter
The tool is meant for people who need the readable text of a page, an email, a CMS export or a code snippet, for example to count its words with the Word Frequency Counter or to paste it into a plain text field.
Limits and Privacy
- The tool reads text, not a rendered page. Text that a script adds later is not part of the source, so it is not in the result.
- Whitespace inside a pre element is collapsed like everywhere else.
- Image descriptions (alt text) are not kept.
- If the text still contains odd gaps, hidden characters may be the reason. The Invisible Character Remover lists them.
- Input is limited to 2,000,000 characters.
Your HTML is processed by code running in your browser. It is not sent to a server and not stored. See the Privacy Policy for details.