Snipget.ai

Strip HTML tags to plain text

Exact
text_html_strip

Deterministic and authoritative — the canonical answer for this input.

Decode HTML entities and strip tags, returning plaintext. Script/style/noscript bodies dropped entirely. Block-level tags add a space so words don't concatenate. Pass preserve_br_as_newline to turn <br> into ' ' before stripping. Run this before feeding HTML-bearing text to downstream parsers. Processing multiple inputs? Use `text_html_strip_batch` to do up to 1000 in one call.

Parameters

textstringrequired

HTML-bearing text.

preserve_br_as_newlinebooleanoptional

Convert <br> to ' ' before stripping.

collapse_whitespacebooleanoptional

Call it

curl -X POST https://api.snipget.ai/v1/text/html/strip \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"text":"<p>Hello <strong>world</strong></p><p>Read &amp; enjoy.</p>","collapse_whitespace":true}'

The Batch tab sends up to 1000 inputs in one call via /v1/text/html/strip/batch.

Example response

{
  "input_length": 59,
  "output_length": 25,
  "text": "Hello world Read & enjoy."
}

FAQ

What does it do?

It removes HTML tags and turns codes like &amp; back into real characters, leaving clean plain text. Useful when you copy from a web page or email and just want the words.

Does it keep scripts and styles?

No. The contents of script, style, and noscript blocks are dropped entirely, and block-level tags add a space so words do not run together.

Can I keep line breaks from the HTML?

Set preserve_br_as_newline to turn <br> tags into real line breaks before stripping. By default whitespace is collapsed to single spaces; set collapse_whitespace to false to keep it.

Does it understand the page or follow links?

No. It only removes the markup from the text you pass in. It does not render the page, run scripts, or fetch anything.

Is it reliable to run repeatedly?

Yes. It is deterministic and authoritative: the same HTML always produces the same plain text.

Related tools