Clean Text · browser-local
HTML to Text
Convert an HTML snippet into clean plain text. GlyphSift removes script and style blocks, turns block elements into line breaks, separates table cells with tabs, keeps whitespace inside pre blocks, strips remaining tags, and decodes HTML entities in a single pass. It reads the markup as a string and never attaches it to the page.
Works on up to 5,000 characters and 20,000 code points per field (at most 64 code points per character), processed in your browser.
Output
Title Hello world & more
Good fit
Use this tool when
- You copied rich content and need plain text.
- You want to remove markup from an email or page fragment.
- You need a quick, safe tag strip without running the HTML.
Keep the original
Avoid it when
- You need to preserve links, tables, or structure.
- The source is a full document you must parse precisely.
- You require sanitized HTML output rather than plain text.
Reviewed truth vectors
Examples that expose the edge cases
<p>Hello <b>world</b></p>Hello worldTags are removed; text is kept.
<p>Line 1</p><p>Line 2</p>Line 1
Line 2Block elements become line breaks.
<script>alert(1)</script>SafeSafeScript and style blocks are dropped, never executed.
Transparent implementation
How it works
- 01
Tokenize the markup as a string and skip script and style bodies entirely.
- 02
Turn br and block tags into newlines, table cells into tabs and rows into newlines, and keep pre text verbatim.
- 03
Decode named and numeric entities once, so &lt; stays the literal text <, and collapse other whitespace.
Known limitations
What the result cannot promise
Links and images are not preserved; tables become tab-separated rows, not aligned columns.
becomes an ordinary space; entities outside the built-in table are left as written.
Malformed HTML may leave stray characters.
Questions before copying
Frequently asked questions
Is it safe to paste untrusted HTML?
Yes for extraction. Script and style blocks are removed and nothing is executed; the tool only manipulates strings.
Does it keep links?
No. Link markup is stripped and only the visible text remains.
Will it decode entities?
Numeric references and the Latin-1, Greek, typographic, and common math named entities are decoded in one pass. A double-encoded value such as &lt; becomes the literal text <, not a tag.
Testing and sources
How this tool is tested
Automated evidence
- Tool-contract & coverage suiteShared suite · 37 cases across all tools it covers
tests/tools-30.test.mjs mirrors the ToolRunner dispatch and asserts every registered engineId returns the contracted output shape, plus a coverage guard: every style keeps one output character per input character with unmapped characters passed through in place, and strikethrough, zalgo and upside-down never drop or split a grapheme cluster.
Run in: node --test after a production build (vinext build) - Rendered-HTML suiteShared suite · 26 cases across all tools it covers
tests/rendered-html.test.mjs renders the deployed server bundle and asserts the Unicode-version manifest and each wave's tool markup are present in the server-rendered HTML.
Run in: node --test against the built dist/server bundle - Transform & cleanup suiteShared suite · 38 cases across all tools it covers
tests/transform-cleanup.test.mjs exercises each deterministic cleanup and transform action against whitespace, duplicate, ordering, casing, and HTML-to-text edge cases.
Run in: node --test, no network, no randomness
Standards this tool follows
- UAX #29: Unicode Text Segmentation
Grapheme and word boundaries underpinning line and whitespace operations.
- UAX #14: Unicode Line Breaking Algorithm
Line-break semantics behind hard-wrap repair.