Strip HTML Tags
Safely remove HTML tags and extract clean, readable text content
Stripped Output
Extract the readable text from a chunk of HTML
Markup gets in the way when you only need the content: copied page source, an email template, a WordPress export, or a database field that holds formatted text. Strip HTML Tags parses the markup with the browser's DOM parser and gives back what a reader would see, without tags or attributes. It also has a switch for decoding HTML entities, which matters when the source is full of sequences like ampersand-amp or nbsp.
Using it
- Paste your markup into the HTML Input box.
- Check the two boxes under Cleaning Strategy. Decode Entities is ticked to begin with. Keep Inner Text is also ticked; the text inside tags is what the tool returns in any case.
- Click Extract Clean Text.
- The Stripped Output panel shows the text. The cards underneath give Tags Removed and Final Length.
- Press Copy Result to take the text. This tool offers copying but no file download.
What the decoding step adds
After the tags are gone, Decode Entities runs the text through a second decoding pass. Entities such as the ampersand, less-than and greater-than codes, and quotes appear as real characters, and a non-breaking space entity becomes an actual non-breaking space character. Untick the option if you would rather see the decoded-once text without the extra pass, for instance when the source contains double-escaped entities that you want to keep.
Typical jobs
- Getting plain text from a rich-text field before searching or comparing it.
- Making a preview or meta description from an article body that contains markup.
- Checking the true length of visible text in a template.
- Recovering the wording from an old page whose files you only have as source.
Things to be aware of
- Tags Removed counts each opening and closing tag separately, so it is not the same as the number of elements.
- Nothing is inserted between elements. Adjacent paragraphs, headings or list items with no newline in the source can run together in the output.
- Text held inside script or style elements in the page body can remain as text, and attribute values such as link addresses or image alt text are discarded.
- The output is trimmed at the start and end.
The parsing is done in your browser page using the built-in DOM parser, which does not run scripts from the pasted markup.
Related Tools
Related Tools