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
51 graphemes51 code points51 bytes
Live result

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.
01

Reviewed truth vectors

Examples that expose the edge cases

Input<p>Hello <b>world</b></p>
OutputHello world

Tags are removed; text is kept.

Input<p>Line 1</p><p>Line 2</p>
OutputLine 1 Line 2

Block elements become line breaks.

Input<script>alert(1)</script>Safe
OutputSafe

Script and style blocks are dropped, never executed.

02

Transparent implementation

How it works

  1. 01

    Remove script and style blocks entirely.

  2. 02

    Convert br and closing block tags to newlines, then strip other tags.

  3. 03

    Decode common named and numeric entities and tidy whitespace.

03

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.

04

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.

05

Experience, expertise & trust

How we verify this tool

GlyphSift EditorialText-engine authors & reviewers

The GlyphSift Editorial team designs the deterministic text engine, writes each tool's examples against real Unicode edge cases, and reviews every claim before a page becomes eligible for indexing. We build and test the software we document; we do not outsource the copy to generic content mills.

Each tool page is reviewed against the same six input classes the engine is tested with — ASCII, emoji, combining marks, non-Latin scripts, empty input, and 5,000-grapheme input — and cannot become eligible if it is only a parameter variation of another page.

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