| name | HTML to Markdown |
| slug | html-to-markdown |
| description | Convert HTML pages to clean Markdown for LLM consumption. Use when building RAG pipelines, preparing web content for AI context windows, or extracting readable content from HTML. Strips scripts, styles, nav, ads. Preserves headings, links, lists, code blocks, and tables.
|
| category | Utility |
| tags | ["html","markdown","conversion","rag","llm","content-extraction"] |
| price_per_call | 0 |
| input_schema | {"type":"object","properties":{"html":{"type":"string","description":"Raw HTML content to convert (max 5MB). Mutually exclusive with url."},"url":{"type":"string","description":"URL to fetch and convert. Mutually exclusive with html."}},"required":[]} |
| output_schema | {"type":"object","properties":{"markdown":{"type":"string","description":"Clean Markdown output"},"char_count":{"type":"number"},"line_count":{"type":"number"}}} |
| metadata | {"requires":{"env":["CLAW0X_API_KEY"]}} |
HTML to Markdown
Convert any HTML content or URL into clean, LLM-ready Markdown. Strips noise (scripts, styles, nav, ads), preserves structure (headings, links, lists, code blocks, tables).
How It Works
- Accept raw HTML string or fetch from URL (10s timeout, follows redirects)
- Strip non-content elements:
<script>, <style>, <nav>, <footer>, <aside>
- Convert semantic HTML to Markdown: headings, bold, italic, links, images, code, lists, tables, blockquotes
- Decode HTML entities, normalize whitespace
- Return clean Markdown with metadata
Use Cases
- RAG pipeline preprocessing (web → Markdown → embeddings)
- LLM context window preparation
- Content extraction from web pages
- Documentation conversion
- Web scraping post-processing
Prerequisites
- Sign up at claw0x.com
- Create API key in Dashboard
- Set environment variable:
export CLAW0X_API_KEY="ck_live_..."
Pricing
FREE. No charge per call.
- Requires Claw0x API key for authentication
- No usage charges (price_per_call = 0)
- Unlimited calls
Example
Input:
{
"url": "https://example.com/article"
}
Output:
{
"markdown": "# Article Title\n\nFirst paragraph...\n\n## Section\n\n- Item 1\n- Item 2",
"char_count": 1234,
"line_count": 45,
"source": "https://example.com/article"
}
Error Codes
| Code | Meaning |
|---|
| 400 | Missing html/url, or URL fetch failed |
| 401 | Missing or invalid API key |
| 500 | Conversion failed (not billed) |
About Claw0x
Claw0x is the native skills layer for AI agents.
GitHub: github.com/kennyzir/html-to-markdown