HTML to plain text
Extract readable plain text from HTML: headings, paragraphs, list bullets and table rows, without scripts or menus.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/html-to-text \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href=\"/docs\">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>","links":true}}'
import json, urllib.request
body = {'input': {'text': '<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href="/docs">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>', 'links': True}}
request = urllib.request.Request("https://setget.net/v1/tools/html-to-text", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/html-to-text", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href=\"/docs\">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>","links":true}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "html-to-text",
"input": {
"text": "<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href=\"/docs\">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>",
"links": true
}
}
{
"input": {
"text": "<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href=\"/docs\">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>",
"links": true
}
}
Endpoint: POST /v1/tools/html-to-text. Over MCP: run_tool with slug: "html-to-text".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The HTML to convert. |
links |
boolean | no | Add each link address in brackets after its text. Default: false. |
Examples
Input
{
"text": "<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello & welcome</h1><p>Read the\n <a href=\"/docs\">docs</a>.</p><ul><li>One</li><li>Two</li></ul></body></html>",
"links": true
}Result
{
"title": "Demo",
"text": "Hello & welcome\n\nRead the docs (/docs).\n\n- One\n- Two"
}Table rows become tab-separated lines
Input
{
"text": "<table><tr><th>Name</th><th>Age</th></tr><tr><td>Sam</td><td>31</td></tr></table>"
}Result
{
"title": null,
"text": "Name\tAge\nSam\t31"
}Questions
- What is left out?
- Everything inside head, script, style, noscript, template, svg, canvas, iframe, object, nav and footer.
- Does it fetch the page?
- No. Paste the HTML itself. Nothing is downloaded.
- How are images handled?
- An image is replaced by its alt text, if it has one.
Related tools
- HTML link extractorList every link and image in HTML, with link text, resolved address, rel values and internal or external.
html-extract-links - Open Graph and meta tag extractorPull the title, description, canonical link, Open Graph, Twitter card, favicons and JSON-LD out of HTML.
og-tags-extract - HTML minifierShrink HTML by removing comments and needless white space, without touching pre, textarea, script or style.
html-minify - .gitignore testerCheck which paths a .gitignore file ignores and which line decided each one, using real Git matching rules.
gitignore-test - Cache-Control explainerExplain a Cache-Control header directive by directive and how browsers and CDNs will treat the response.
cache-control-explain - Card number (Luhn) and IBAN validatorCheck a card number with the Luhn checksum and name its network, or check an IBAN by length and mod-97.
luhn-iban-validate