Strip tags to plain text, and escape or unescape entities.
What it's for
Turn web-page code (HTML) into plain, readable text — from a page's source or an email template, say — or rewrite HTML so a web page shows the code itself as text.
Before you start
Have the HTML ready to paste, and know which job you want: plain text to read or reuse, or code to show as an example.
Paste the HTML
Paste it into the HTML box, replacing the example. Paragraphs, headings and list items each become a line of their own in the result.
Pick the mode
In Mode, Remove tags gives plain text and is the usual choice. Escape as entities does the opposite: it keeps the tags but rewrites them, so a web page shows the code as text instead of running it.
Leave Decode entities ticked
With Remove tags, keep Decode entities ticked so codes such as & turn back into the character they stand for, here &. Untick it only if you need those codes left as they were written.
Show the result and copy it
Press Remove tags under the box to bring the result into view; it also updates as you type. Then press Copy at the top to take it.
Reading the result
If it goes wrong
One thing on this page is worth reading: stripping tags is not sanitising. It turns markup into plain text; it does not turn text into markup that is safe to insert into a page. Those are different jobs, and the second needs a real sanitiser on the server.
Block elements become line breaks. Without that, every paragraph runs together into one continuous line — the commonest complaint about tools that do this.
The contents of script and style go too, not just their tags. Removing only the tags leaves CSS and JavaScript sitting in the middle of your text.
And entities are decoded last. Decoding first would turn <script> into a live tag — creating markup out of text that was deliberately escaped.
No, and this is the one thing worth reading on this page. Stripping tags turns markup into plain text; it does not produce markup that is safe to insert into a page. Those are different jobs and the second one needs a real sanitiser running on the server that owns the output. If you are removing HTML for security reasons, this is the wrong tool.
Because block elements become line breaks. Removing tags without them runs every paragraph, list item and table row together into one continuous line, which is the commonest complaint about tools that do this. Inline elements like span and em do not break.
They go entirely, not just their tags. Removing only the tags would leave a page of CSS rules and JavaScript sitting in the middle of your text, which is never what “remove the HTML” means. An unclosed script element takes the rest of the input, which is what a browser does too.
Stripping removes markup so the text reads as text. Escaping converts the markup characters into entities so the text DISPLAYS as markup — useful when you want to show someone a code sample. They are opposite operations and this page does both.
Because every other replacement introduces one. Escape the less-than sign first and you get <, then escaping ampersands turns that into &lt; — the classic double-escape. The ampersand has to go first or the output is wrong in a way that looks almost right.
Because decoding first would turn <script> into a live tag — creating markup out of text that was deliberately escaped, which is the exact opposite of the job. Decoding happens last, on what is left.
Repeated until nothing more is found. <scr<script>ipt> leaves a live tag behind when the pattern runs only once.
When escaping, the ampersand is replaced first. Do < first and the < it produces becomes &lt; — the classic double-escape.
Important
Runs entirely in your browser. Stripping tags is not sanitising — this produces plain text from markup, not markup that is safe to insert into a page. For security, use a real sanitiser on the server that owns the output. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.