Converting Web Pages and HTML Source to Plain Text
Strip tags from HTML source while keeping paragraphs and line breaks: remove script and style, decode entities like & and turn tables into tabs.
Sometimes all you have is HTML source, such as a blog editor's HTML view, an email template or a CMS export file, and you want just the body text out of it. Removing tags by hand easily leaves behind entities like & and script code.
The basic pipeline
The built-in recipe runs in this order.
- Strip HTML tags — removes tags, turns block boundaries into line breaks and entities into characters.
- Clean invisible characters and quotes — turns the NBSP (U+00A0) produced from
and curly quotes into ordinary characters. - Trim leading and trailing spaces — removes the spaces left at the start of lines by the source's indentation.
- Remove blank lines — 'Squeeze consecutive blank lines into one' evens out the spacing between paragraphs to one line.
- Collapse repeated spaces and tabs — shrinks runs of spaces within a line to a single space.
- Strip HTML tags
- Clean invisible characters and quotes
- Trim leading and trailing spaces
- Remove blank lines
- Collapse repeated spaces and tabs
What tag stripping handles
- Comments and executable code:
<!-- -->comments and<script>,<style>,<noscript>and<template>elements are removed together with their content. If only the tags were removed, JavaScript or CSS code would remain as if it were body text. - Block tags and line breaks: with 'Turn block tags and <br> into line breaks' on, the line breaks at
<br>and at the boundaries of block elements such asp,div,h1–h6,liandtr. Both opening and closing tags become line breaks, which creates blank lines, but runs of three or more line breaks are reduced to two. - Tables: the ends of cells (
</td>,</th>) become tabs. When you paste the result into a spreadsheet, the columns are split. - Entities: with 'Decode entities like &' on, common named entities such as
&<>" …and numeric entities such as''are converted into the actual characters. Named entities the tool does not know are left as they are.
<h2>Notice</h2> <p>This week's maintenance schedule.<br>Questions go to the Q&A board.</p> <ul><li>Mon: Server</li><li>Wed: DB</li></ul> <script>track();</script>
The source above is cleaned up as follows.
Notice This week's maintenance schedule. Questions go to the Q&A board. Mon: Server Wed: DB
If you do not want blank lines left between list items, choose 'Remove all blank lines' instead of squeezing consecutive blank lines. In that case, however, the blank lines between paragraphs disappear as well.
If you want to keep the table structure
The last step of the recipe, Collapse repeated spaces and tabs, has 'Merge tabs into spaces too' on by default and turns the table's tabs into spaces. Trim leading and trailing spaces also removes tabs at the start and end of lines. To use the table as tab-separated data, turn off 'Merge tabs into spaces too' in Collapse repeated spaces and tabs, and switch off the trim step.
How it differs from copying the browser view
Drag-selecting and copying a web page on screen gives a different result from cleaning its HTML source with this tool.
- This tool does not interpret CSS. Text of elements hidden with
display:noneremains in the result. - Image alternative text (
alt) and link addresses (href) disappear along with the tags. If you need the link addresses, look them up separately in the source before removing the tags. - If a long sentence was written across several lines in the HTML source, those line breaks remain. In that case, adding Repair PDF line breaks, which joins lines within a paragraph, afterwards helps.
- No line break or space is inserted at the boundaries of non-block elements such as
<span>, so elements that were written next to each other without a space come out with their text stuck together.
Hidden characters in email templates
Newsletter HTML sometimes contains dozens of invisible characters such as ‌ or ​ to control the inbox preview text. Tag stripping turns these entities into the zero-width non-joiner (U+200C) and zero-width space (U+200B), and the second step of the recipe removes them. If you switch off the Clean invisible characters and quotes step, these characters remain in the result, and text that looks fine may fail to match in searches and comparisons.
If you want bullets back in front of list items, add Add text to the start and end of lines after the recipe and enter - as the prefix. However, it is added to every line, so it does not suit results where headings and paragraphs are mixed.
Caution
- Tags are removed based on the pattern of
<followed by a letter and closed by>. In rare source where an attribute value contains>, parts may remain. - Entities are decoded after the tags are removed, so
<b>in the source is not treated as a tag and remains as the text<b>. This is intended.
Checklist
- Paste the whole source and try the recipe first.
- If you will use the tables, switch off the steps that remove tabs.
- If you need link addresses, secure them before removing the tags.
Last updated: 2026-09-23