# HTML to plain text

Extract readable plain text from HTML: headings, paragraphs, list bullets and table rows, without scripts or menus.

- Endpoint: `POST https://setget.net/v1/tools/html-to-text` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `html-to-text`
- Page: https://setget.net/tools/html-to-text

## Inputs

- `text` (required, string): The HTML to convert.
- `links` (optional, boolean, default `false`): Add each link address in brackets after its text.

## Example 1

```json
{"input":{"text":"<html><head><title>Demo</title><style>p{color:red}</style></head><body><nav>Menu</nav><h1>Hello &amp; 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:

```json
{"title":"Demo","text":"Hello & welcome\n\nRead the docs (/docs).\n\n- One\n- Two"}
```

## Example 2: Table rows become tab-separated lines

```json
{"input":{"text":"<table><tr><th>Name</th><th>Age</th></tr><tr><td>Sam</td><td>31</td></tr></table>"}}
```

Result:

```json
{"title":null,"text":"Name\tAge\nSam\t31"}
```

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