Skip to content
ToolPlankDEV
Text Tools
100% In-Browser Execution

Updated:

Remove HTML from Text

Paste HTML code and remove html from text in one step. Tags, comments, scripts and styles are stripped, entities such as & are decoded, and paragraphs and lists keep their line breaks. Nothing is uploaded.

Options:

HTML or text with tags

Input
0 chars · 0 lines

Plain text

Ready
Processing in browser...
0 chars · 0 linesUpdates as you type

Processed on your device. Your text is not sent to our servers.

More free tools you may need next.

Quick Guide

How to use Remove HTML Tags

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste the HTML

    Paste HTML source, or text that has tags in it, into the first box. You can also press Paste, drop an .html or .txt file onto the box, or press Example to load a small page fragment.

  2. 02

    Read the plain text

    The text without tags appears on the right. Paragraphs, headings, list items and table rows start new lines, and entities such as & are turned into the characters they stand for.

  3. 03

    Adjust what is kept

    Keep link addresses writes each link's address after its text. Keep line breaks, Remove script and style content, Collapse extra spaces and Remove blank lines change how the text is tidied.

  4. 04

    Copy the text

    Press Copy to put the clean text on your clipboard, or Download to save it as a .txt file. Your original HTML stays in the first box.

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:

HTML
<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> &amp; share it.</p>
<ul><li>Faster search</li><li>Fixed a &quot;crash&quot;</li></ul>
<script>track();</script>
Text
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 &amp; for an ampersand, &lt; for a less-than sign and &#169; 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, &nbsp;, becomes an ordinary space.
  • A name that the tool does not know, such as &notarealentity;, is left as it is.
  • An entity must end with a semicolon. &amp without one is not decoded.
  • Decoding happens after the tags are removed, so &lt;b&gt;x&lt;/b&gt; becomes the text <b>x</b> and is not stripped a second time.

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.

Frequently Asked Questions

Technical Q&A for Remove HTML Tags

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the HTML into the first box. The text without tags appears in the second box. Press Copy to use it.

Leave Keep line breaks on, which is the default. Paragraphs, headings and list items stay on separate lines.

Yes, by default. The tags and the code inside script and style elements are removed. Turn off Remove script and style content to keep that code as text.

With Decode entities on, &amp; becomes an ampersand and &nbsp; becomes a normal space. Turn the option off to keep the entities as they are.

Yes. Turn on Keep link addresses. Each link's address is written after its text, in brackets.

Turn off Keep line breaks. All the text is put on one line with single spaces between the parts.

Yes. The tags are removed in your browser. The text is not sent to a server, and the tool never runs scripts in it.

No. It produces plain text for reading. It is not a security filter and should not be used to protect a website from malicious HTML.

Text inside script and style elements and inside comments is removed. Text that a page builds with scripts is not in the source, so it cannot be found either.

No. The HTML is processed in your browser and nothing is sent to a server or saved. Reloading the page clears the boxes.