HTML to Plain Text Converter
Strip HTML tags and extract clean plain text with optional line break handling and whitespace normalization.
HTML to Plain Text
What is an HTML to Plain Text Converter?
An HTML to plain text converter takes a block of HTML markup and returns only the readable text, with every tag removed. Instead of copying styled text from a web page, an email, or a content management system and dragging unwanted formatting along with it, you paste the underlying HTML and receive a clean, unformatted version that drops neatly into a document, spreadsheet, or database field.
HTML is a markup language: the words you see in a browser are wrapped in tags such as <p>, <strong>, and <a> that tell the browser how to display them. When you only care about the content, those tags become noise. This converter removes them, converts structural elements into sensible line breaks, and decodes HTML entities so that & becomes a plain & and becomes a space.
The entire conversion runs in your browser using JavaScript. Nothing is uploaded to a server, so the tool is safe for confidential copy, internal notes, and proprietary documents. The output updates live as you type or paste, and running character and line counts help you judge exactly how much content has been extracted from the markup.
Two checkboxes let you shape the result. “Preserve line breaks” keeps the paragraph, heading, list, and table structure so the text stays readable. “Collapse whitespace” normalises spacing, turning runs of spaces or tabs into single spaces and squeezing multiple blank lines down to one, which is ideal when preparing text for downstream parsing.
Key Features of This Converter
- 100% client-side — your HTML never leaves the browser, so there is no upload, no logging, and no privacy risk.
- Structure-aware line breaks — closing paragraphs, headings, list items, table rows, and
<br>tags become newlines when preservation is enabled. - Entity decoding — common named entities such as
&, , and©, plus numeric codes likeé, are converted to real characters. - Script and style removal — the contents of
<script>and<style>blocks are discarded entirely rather than leaking into the output. - Whitespace control — collapse mode squeezes repeated spaces, indentation, and blank lines so pasted text is tidy and predictable.
- Live statistics — character and line counts for both the input and the output update automatically as you work.
- Paste HTML — Paste or type HTML markup into the input box; the plain text updates instantly.
- Choose line breaks — Leave "Preserve line breaks" ticked to keep <br>, <p>, <div>, heading, list, and table structure.
- Adjust whitespace — Tick "Collapse whitespace" to trim indentation and limit blank lines to a single gap.
- Review the output — Check the plain text on the right and the character and line counts shown below the editors.
- Copy result — Click Copy to place the cleaned plain text on your clipboard.
How HTML Tags Are Translated
The converter treats each structural tag differently when “Preserve line breaks” is enabled. The table below summarises the exact behaviour; anything not listed is simply removed from the output.
| HTML tag | Plain text result |
|---|---|
| <br> | Single new line |
| </p> | Blank line (two newlines) |
| </div> | Single new line |
| </h1>–</h6> | Blank line |
| </li> | Single new line |
| </tr> | Single new line |
| </td>, </th> | Tab character |
| <hr> | A --- separator line |
| <script>, <style> | Removed with their contents |
| Any other tag | Removed, text kept |
Worked Examples
- Heading and paragraph —
<h1>Title</h1><p>Hello <strong>world</strong>.</p>becomesTitle, a blank line, thenHello world. - Two paragraphs —
<p>First</p><p>Second</p>becomes three lines:First, an empty line, andSecond. - List items —
<ul><li>One</li><li>Two</li></ul>becomesOneandTwoon separate lines. - Line break —
<p>A<br>B</p>becomesAandBon separate lines. - Entity decoding —
<p>Tom &amp; Jerry</p>becomesTom & Jerry. - Table cells —
<td>Alpha</td><td>100</td>becomes a tab-separated pair,Alphaand100. - Style block — a
<style>block full of CSS returns nothing because it is discarded before tags are stripped.
Tips and Common Mistakes
- Line break setting matters most — with “Preserve line breaks” switched off, an entire document collapses into a single long line that is hard to read.
- Only common entities are decoded — an unusual named entity is left exactly as written rather than guessed, so a stray entity code may survive in the output.
- Script and style content is lost — if you actually need the JavaScript or CSS text from a page, this tool deliberately throws it away.
- Collapse trims indentation — leading spaces on every line are removed, which is great for parsing but strips deliberate code-style indentation.
- Malformed HTML can surprise you — a missing closing bracket or an unescaped
<in text can cause a chunk of content to be treated as a tag. - Copy before you navigate away — nothing is stored between visits, so use the Copy button to keep the result.
Common Use Cases
Stripping markup is a small step that shows up in a surprising number of workflows. Anywhere text is stored inside HTML but consumed as plain content, this converter saves manual cleanup.
- Extracting text from emails and newsletters — remove the heavy table-based markup that email clients produce and keep only the message.
- Cleaning web copy for a CMS — paste HTML from a page and drop the text into a rich-text field, a meta description, or a database column.
- Preparing data for spreadsheets — table cells become tab-separated values that paste neatly into rows and columns.
- Word counts and reading analysis — feed clean text to an editor or a word-count tool without markup inflating the totals.
- Accessibility and screen-reader checks — read the text equivalent of a page to spot missing labels or stray characters.
- Translation and localisation — hand translators clean text instead of tagged markup.
Is my HTML data sent to a server?
No. All processing happens 100% client-side in your browser using JavaScript. Your HTML is never uploaded, stored, or logged, so the tool is safe for confidential documents, internal notes, and proprietary copy. You can even use it while offline once the page has loaded.
How are HTML tags handled?
Every tag is removed and only the text it wraps is kept. When “Preserve line breaks” is enabled, closing tags for block elements such as <p>, <div>, <h1>-<h6>, <li>, and <tr> become newlines, <td> and <th> become tabs, and <br> becomes a line break. Inline tags like <strong>, <em>, and <a> disappear entirely, leaving their text behind.
Which HTML entities are decoded?
The converter decodes the common named entities &, <, >, ", ', and , plus a set including ©, €, £, ¥, ®, ™, —, –, …, «, », ·, and °. Numeric codes such as é are also converted. Any other named entity is left exactly as written rather than guessed.
What does “Preserve line breaks” do?
It keeps the document structure by translating block-level closing tags into line breaks. Paragraphs and headings produce blank lines, list items and table rows start on new lines, and table cells are separated by tabs. Without it, the entire document is flattened into a single run of text, which is sometimes useful for feeds but usually harder to read.
What does “Collapse whitespace” do?
Collapse mode normalises spacing so the output is tidy and predictable. Runs of spaces and tabs are reduced to a single space, three or more consecutive newlines are trimmed to one blank line, and leading indentation is removed from every line. This is especially helpful when the source HTML is deeply indented or generated by a template engine.
Does it remove script and style content?
Yes. The contents of <script> and <style> blocks are stripped before the remaining tags are removed, so JavaScript code and CSS rules never appear in the plain text output. This is usually what you want when extracting readable content, but it means the tool is not suitable for pulling code out of an HTML page.
What is the opposite of this tool?
Going the other direction means adding markup, not removing it. To turn plain text or Markdown into HTML, use the Markdown to HTML converter; to clean up and re-format existing markup, use the HTML Formatter.
Is there a size limit on the input?
There is no hard limit imposed by the tool because everything runs locally in the browser. Very large documents are limited only by the memory of your device, and pasting several megabytes of HTML may briefly slow the live preview. For typical emails, articles, and fragments, the conversion is instant.