Text and writing

How to remove HTML markup from a copied snippet

When reusing an HTML snippet as plain text, the visual markup may not be needed. Review the output before using it elsewhere.

Before you start

Required libraries are loaded from jsDelivr; text is processed in the browser after they load. Consider the content before using it and read the privacy policy.

Privacy

How to use it

  1. Enter <p>Ola <b>mundo</b></p><p>fim</p>.

  2. Run Remove HTML.

  3. Check the text and line breaks in the result.

Strip HTML

Worked example

The paragraph and bold tags do not appear in the extracted text; the paragraphs are separated by a blank line.

Result: Ola mundo, a blank line, then fim.

Limits and checks

The tool extracts text, includes image alt text and handles blocks and breaks according to its own rules. Scripts and other elements are removed; layout is not preserved. It is not a sanitizer for inserting HTML into an application. It needs DOMPurify to load in the browser; limit: 100,000 UTF-16 code units.

Next step

To preserve editable structure instead, try HTML to Markdown and review the conversion.

How to convert simple HTML to editable Markdown
Back to the blog