# HTML to Markdown

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

- Skill: `kennyzir/html-to-markdown` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add kennyzir/html-to-markdown`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kennyzir/html-to-markdown/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: kennyzir (https://skillmd.com/u/kennyzir)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kennyzir/html-to-markdown

---


# 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

1. Accept raw HTML string or fetch from URL (10s timeout, follows redirects)
2. Strip non-content elements: `<script>`, `<style>`, `<nav>`, `<footer>`, `<aside>`
3. Convert semantic HTML to Markdown: headings, bold, italic, links, images, code, lists, tables, blockquotes
4. Decode HTML entities, normalize whitespace
5. 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

1. **Sign up at [claw0x.com](https://claw0x.com)**
2. **Create API key** in Dashboard
3. **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**:
```json
{
  "url": "https://example.com/article"
}
```

**Output**:
```json
{
  "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](https://claw0x.com) is the native skills layer for AI agents.

**GitHub**: [github.com/kennyzir/html-to-markdown](https://github.com/kennyzir/html-to-markdown)

