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, strips remaining tags, and decodes common entities — all with string operations, never a live DOM.
- Index state
- eligible
- Reviewed
- 2026-08-24
- Input limit
- 5,000 graphemes
HTML to Text
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
Remove script and style blocks entirely.
- 02
Convert br and closing block tags to newlines, then strip other tags.
- 03
Decode common named and numeric entities and tidy whitespace.
Known limitations
What the result cannot promise
Links, images, and table structure are not preserved.
Only common entities are decoded.
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?
Common named entities and numeric references are decoded; rarer named entities are left as written.
Experience, expertise & trust
How we verify this tool
Automated evidence
- Tool-contract & coverage suite30 deterministic cases
tests/tools-30.test.mjs mirrors the ToolRunner dispatch and asserts every registered engineId returns the contracted output shape, plus a coverage guard so no tool silently drops characters.
Run in: node --test after a production build (vinext build) - Rendered-HTML suite12 deterministic cases
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 suite21 deterministic cases
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.