Skip to content
POST AI agent ready /v1/html-to-text/convert

HTML to Text API - Free HTML Stripper

Strips all HTML tags and returns plain text. Headings, lists, and tables are converted to readable text formatting. Optionally preserve link URLs and set a word wrap column.

Parameters

stringrequired

The HTML content to convert.

boolean

Include link URLs in the plain text output (e.g., "Botoi [https://botoi.com]").

number

Wrap text at this column width. Set to 0 to disable wrapping.

Code examples

curl -X POST https://api.botoi.com/v1/html-to-text/convert \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Welcome</h1><p>Visit <a href=\"https://botoi.com\">Botoi</a>.</p>","preserveLinks":true,"wordwrap":80}'

When to use this API

Generate plain-text versions of HTML emails

Create the text/plain fallback for HTML marketing or transactional emails so they render in clients that do not support HTML.

Extract readable content from web pages

Scrape a page, pass the HTML to this endpoint, and get clean text for content analysis, summarization, or archival.

Frequently asked questions

How are HTML tables converted?
Tables are converted to aligned plain-text columns with spacing, keeping the data readable without any markup.
What happens to images in the HTML?
Images are replaced with their alt text if available. If no alt text exists, the image is omitted.
Does this handle malformed HTML?
Yes. The parser is forgiving and handles unclosed tags, missing attributes, and other common HTML issues.
Can I use this to strip HTML from user input for safety?
For security sanitization, use the /v1/html-sanitize endpoint instead. This endpoint is designed for content extraction, not security filtering.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.