HTML to Text Converter
WM-19Paste HTML to get plain text back. Tags are removed, entities are decoded, and paragraphs, headings and list items stay on separate lines.
Runs in your browser. Nothing is uploaded.
HTML
Plain text
How to use it
- Paste your HTML into the input box, or open an .html file (up to 5 MB).
- Tick Show link addresses if you want each link written as text (url).
- Untick the list option if you do not want dashes and numbers in front of list items.
- Choose Convert, then copy or download the text.
How the text is laid out
Paragraphs, headings, lists and tables are separated by blank lines or line breaks, and br becomes a line break. List items start with a dash, or a number inside an ordered list, and nested lists are indented. Table cells in a row are joined with tabs, so the text pastes into a spreadsheet. Spaces and line breaks in the HTML collapse the way a browser shows them, except inside pre and textarea, which keep their spacing.
What is dropped
Script, style, template and head content is removed, and so are comments and images, including alt text. Hidden text is not detected: the tool does not apply CSS, so something hidden with display:none is still in the output. Links keep only their visible text unless you turn on the link option, which adds the address in brackets after it. Fragment links and javascript: links are skipped.
Entities and the tokenizer
Entities are decoded with the built-in table of 258 names, plus decimal and hex references. A name outside the table stays as written, for example ♥ is decoded but a rare HTML5 name may not be. Non-breaking spaces become plain spaces. The tool reads the markup itself rather than loading it into a page, so it never runs scripts and does not need a browser document.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
<script> opened at line 3 is never closed. | A script, style or template tag has no closing tag, so its content cannot be separated from the text. | Add the closing tag, or remove the opening tag. |
Questions people ask
How do I convert HTML to plain text?
Paste the HTML and choose Convert. Tags are stripped and the visible text is returned with line breaks where paragraphs, headings and list items were.
Does it keep links?
By default only the link text is kept. Tick Show link addresses to get text (url) instead. If the link text is the same as the address, or the link points to a fragment or javascript:, the address is not repeated.
Are HTML entities decoded?
Yes. Named entities from the built-in table and numeric references such as € and 😀 become characters. A reference that is not valid, such as half of a surrogate pair, is left as typed.
Why is hidden text still in the output?
The converter does not run CSS or scripts, so it cannot know what a stylesheet hides. It removes script, style and head content, but display:none text in the body is kept.
What happens to tables?
Each row becomes a line and the cells in it are separated by tabs. Merged cells are not handled specially, and nested tables simply flatten into the same lines.
Is this the same as a regular expression strip?
No. A pattern that deletes anything between angle brackets keeps script text, breaks on a > inside an attribute and loses all line breaks. This tool tracks quotes inside tags and uses the element names to decide where breaks go.
About this tool
Reads the HTML with a built-in tokenizer, not your browser, so the result does not depend on a page being loaded. Tags are removed; script, style, template and head content is dropped, and so are comments and images, including their alt text. Paragraphs, headings and lists are separated by blank lines, other block elements and br by line breaks, and table cells by tabs. Whitespace is collapsed the way a browser shows it, except inside pre and textarea. Entities are decoded using the built-in table of 258 common names plus numeric references; a name outside it stays as written. Non-breaking spaces become plain spaces. CSS is not applied, so text hidden with display:none is still included.