High performance and CommonMark compliant HTML to Markdown converter. Maintained by the Kreuzberg team. Kreuzberg is a fast, polyglot document intelligence engine with a Rust core. It extracts structured data from 98+ document formats using streaming parsers and built-in OCR.
See the code
Turn messy, real-world HTML into clean Markdown — from the language you already work in.
Feed html-to-markdown the HTML you actually have — unclosed tags, CDATA, custom elements, broken entities, nested tables, mixed encodings — and get back clean CommonMark (or Djot) without losing content. One convert() call does it, and it returns the same result whether you run it from Python, TypeScript, Go, Ruby, Java, or 11 more languages.
You get more than the text: pull page metadata (Open Graph, Twitter, JSON-LD) and structured tables in the same pass, or hook into the conversion to reshape the output. It is fast enough for whole-corpus jobs, and the messy-input handling is automatic — you never choose a parsing strategy or tune anything to get correct output.
| Feature | Description |
|---|---|
| 16 languages, one Rust core | Rust, Python, Node.js, WASM, Java, Go, C#, PHP, Ruby, Elixir, R, Dart, Kotlin (Android), Swift, Zig, and a C ABI |
| Tiered dispatch | Byte scanner → DOM walker → html5ever repair, with byte-equal output across tiers |
| Real-HTML robust | Unclosed tags, CDATA, custom elements, malformed entities, nested tables, mixed encodings — handled without losing content |
| GFM tables | Padded cells, alignment, and pipe escaping |
| Djot output | Set output_format = "djot" to emit Djot instead of Markdown |
| Metadata extraction | Parse <head> into structured metadata (Open Graph, Twitter, JSON-LD, microdata, RDFa, header hierarchy) |
| Inline images | Opt-in mirroring of data URIs and remote image references |
| Visitor API | Feature-gated traversal to transform the converted Markdown AST |
| Configurable preprocessing | Standard, strict, and lenient presets — or build your own |
| Fast | 19–116 MB/s on the Wikipedia/mdream corpus; per-group regression thresholds enforced on every PR |
⭐ Star this repo to show your support — it helps others discover html-to-markdown.
convert() is the single entry point — it returns a structured result with content, warnings, and optional metadata.
Available on Maven Central as io.xberg:html-to-markdown. See Java README for the dependency snippet and current version.
This is a native PHP extension (Rust ext-php-rs), so install it with PIE — not composer require:
pie install xberg-io/html-to-markdown
See PHP README for full documentation.
Add {:html_to_markdown, "~> 3.6"} to your mix.exs dependencies. See Elixir README for full documentation.
install.packages("htmltomarkdown", repos = "https://xberg-io.r-universe.dev")
See R README for full documentation.
Available on Maven Central as io.xberg:html-to-markdown-android. See Kotlin README for the dependency snippet and current version.
Add via Swift Package Manager. See Swift README for full documentation.
See Zig README for installation and usage.
Pre-built .so / .dll / .dylib from GitHub Releases. See FFI crate for full documentation.
cargo install html-to-markdown-cli
# Or install the prebuilt binary via cargo-binstall:
cargo binstall html-to-markdown-cli
brew install xberg-io/tap/html-to-markdown
Windows users can install the same binary through Scoop:
scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
scoop install html-to-markdown
See CLI usage for full documentation.
Install the html-to-markdown plugin from xberg-io/html-to-markdown. It ships the html-to-markdown agent skills — select your runtime below.
The bundle targets Claude Code, Codex, Cursor, Gemini CLI, Kimi, OpenCode, Factory Droid, Hermes, Pi, Agent Plugins and GitHub Copilot CLI. Read the plugin guide for runtime resources, CLI prerequisites and configuration. MCP-capable adapters expose the product's tools; Hermes uses a local stdio bridge and explicitly selected skills. Pi loads skills and prompt templates and requires the product CLI for executable operations.
Install only the public Agent Skills, without a plugin or MCP registration, using the skills CLI:
npx skills add xberg-io/html-to-markdown --list
npx skills add xberg-io/html-to-markdown
Choose the skills and target agents interactively. Installing instructions does not install the product CLI or configure provider credentials.
/plugin marketplace add xberg-io/html-to-markdown
/plugin install html-to-markdown@html-to-markdown
/plugins add https://github.com/xberg-io/html-to-markdown
Then search for html-to-markdown and select Install Plugin.
Settings → Plugins → Add from URL → https://github.com/xberg-io/html-to-markdown, then select html-to-markdown.
From a checkout of this repository:
gemini extensions install ./plugin
The manifest is inside plugin/. See the Gemini extension reference
for local installation and updates.
droid plugin marketplace add https://github.com/xberg-io/html-to-markdown
droid plugin install html-to-markdown@html-to-markdown
copilot plugin marketplace add https://github.com/xberg-io/html-to-markdown
copilot plugin install html-to-markdown@html-to-markdown
From a checkout of this repository:
pi install ./plugin
After the next plugin release, install the same package used by OpenCode:
pi install npm:@xberg-io/opencode-html-to-markdown
Pi loads the bundled skills and prompt templates. Use /html-to-markdown-convert or /html-to-markdown-metadata with the input as arguments. Install the html-to-markdown CLI separately for shell access. This package does not register MCP servers, hooks, or native Pi extensions.
Add the package to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xberg-io/opencode-html-to-markdown"]
}
Full guides, the convert() API for every binding, tier architecture, the metadata and visitor APIs, and performance benchmarks live at docs.html-to-markdown.xberg.io.
Contributions welcome! See CONTRIBUTING.md for setup instructions and guidelines.
MIT License — see LICENSE for details.
185 followers · starred Jan 2026
36 followers · starred Jun 2026
487 followers · starred Nov 2025
71 followers · starred Aug 2025
High performance and CommonMark compliant HTML to Markdown converter. Maintained by the Kreuzberg team. Kreuzberg is a fast, polyglot document intelligence engine with a Rust core. It extracts structured data from 98+ document formats using streaming parsers and built-in OCR.
See the code
Turn messy, real-world HTML into clean Markdown — from the language you already work in.
Feed html-to-markdown the HTML you actually have — unclosed tags, CDATA, custom elements, broken entities, nested tables, mixed encodings — and get back clean CommonMark (or Djot) without losing content. One convert() call does it, and it returns the same result whether you run it from Python, TypeScript, Go, Ruby, Java, or 11 more languages.
You get more than the text: pull page metadata (Open Graph, Twitter, JSON-LD) and structured tables in the same pass, or hook into the conversion to reshape the output. It is fast enough for whole-corpus jobs, and the messy-input handling is automatic — you never choose a parsing strategy or tune anything to get correct output.
| Feature | Description |
|---|---|
| 16 languages, one Rust core | Rust, Python, Node.js, WASM, Java, Go, C#, PHP, Ruby, Elixir, R, Dart, Kotlin (Android), Swift, Zig, and a C ABI |
| Tiered dispatch | Byte scanner → DOM walker → html5ever repair, with byte-equal output across tiers |
| Real-HTML robust | Unclosed tags, CDATA, custom elements, malformed entities, nested tables, mixed encodings — handled without losing content |
| GFM tables | Padded cells, alignment, and pipe escaping |
| Djot output | Set output_format = "djot" to emit Djot instead of Markdown |
| Metadata extraction | Parse <head> into structured metadata (Open Graph, Twitter, JSON-LD, microdata, RDFa, header hierarchy) |
| Inline images | Opt-in mirroring of data URIs and remote image references |
| Visitor API | Feature-gated traversal to transform the converted Markdown AST |
| Configurable preprocessing | Standard, strict, and lenient presets — or build your own |
| Fast | 19–116 MB/s on the Wikipedia/mdream corpus; per-group regression thresholds enforced on every PR |
⭐ Star this repo to show your support — it helps others discover html-to-markdown.
convert() is the single entry point — it returns a structured result with content, warnings, and optional metadata.
Available on Maven Central as io.xberg:html-to-markdown. See Java README for the dependency snippet and current version.
This is a native PHP extension (Rust ext-php-rs), so install it with PIE — not composer require:
pie install xberg-io/html-to-markdown
See PHP README for full documentation.
Add {:html_to_markdown, "~> 3.6"} to your mix.exs dependencies. See Elixir README for full documentation.
install.packages("htmltomarkdown", repos = "https://xberg-io.r-universe.dev")
See R README for full documentation.
Available on Maven Central as io.xberg:html-to-markdown-android. See Kotlin README for the dependency snippet and current version.
Add via Swift Package Manager. See Swift README for full documentation.
See Zig README for installation and usage.
Pre-built .so / .dll / .dylib from GitHub Releases. See FFI crate for full documentation.
cargo install html-to-markdown-cli
# Or install the prebuilt binary via cargo-binstall:
cargo binstall html-to-markdown-cli
brew install xberg-io/tap/html-to-markdown
Windows users can install the same binary through Scoop:
scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
scoop install html-to-markdown
See CLI usage for full documentation.
Install the html-to-markdown plugin from xberg-io/html-to-markdown. It ships the html-to-markdown agent skills — select your runtime below.
The bundle targets Claude Code, Codex, Cursor, Gemini CLI, Kimi, OpenCode, Factory Droid, Hermes, Pi, Agent Plugins and GitHub Copilot CLI. Read the plugin guide for runtime resources, CLI prerequisites and configuration. MCP-capable adapters expose the product's tools; Hermes uses a local stdio bridge and explicitly selected skills. Pi loads skills and prompt templates and requires the product CLI for executable operations.
Install only the public Agent Skills, without a plugin or MCP registration, using the skills CLI:
npx skills add xberg-io/html-to-markdown --list
npx skills add xberg-io/html-to-markdown
Choose the skills and target agents interactively. Installing instructions does not install the product CLI or configure provider credentials.
/plugin marketplace add xberg-io/html-to-markdown
/plugin install html-to-markdown@html-to-markdown
/plugins add https://github.com/xberg-io/html-to-markdown
Then search for html-to-markdown and select Install Plugin.
Settings → Plugins → Add from URL → https://github.com/xberg-io/html-to-markdown, then select html-to-markdown.
From a checkout of this repository:
gemini extensions install ./plugin
The manifest is inside plugin/. See the Gemini extension reference
for local installation and updates.
droid plugin marketplace add https://github.com/xberg-io/html-to-markdown
droid plugin install html-to-markdown@html-to-markdown
copilot plugin marketplace add https://github.com/xberg-io/html-to-markdown
copilot plugin install html-to-markdown@html-to-markdown
From a checkout of this repository:
pi install ./plugin
After the next plugin release, install the same package used by OpenCode:
pi install npm:@xberg-io/opencode-html-to-markdown
Pi loads the bundled skills and prompt templates. Use /html-to-markdown-convert or /html-to-markdown-metadata with the input as arguments. Install the html-to-markdown CLI separately for shell access. This package does not register MCP servers, hooks, or native Pi extensions.
Add the package to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xberg-io/opencode-html-to-markdown"]
}
Full guides, the convert() API for every binding, tier architecture, the metadata and visitor APIs, and performance benchmarks live at docs.html-to-markdown.xberg.io.
Contributions welcome! See CONTRIBUTING.md for setup instructions and guidelines.
MIT License — see LICENSE for details.
185 followers · starred Jan 2026
36 followers · starred Jun 2026
487 followers · starred Nov 2025
71 followers · starred Aug 2025