html-to-markdown
Fast, lossless HTML→Markdown conversion for coding agents, by Kreuzberg, Inc.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/xberg-io/html-to-markdown with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/xberg-io/html-to-markdown'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/xberg-io--html-to-markdown)HTML
<a href="/listings/xberg-io--html-to-markdown"><img src="/api/listings/xberg-io--html-to-markdown/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
`convert()` is the single entry point — it returns a structured result with `content`, `warnings`, and optional `metadata`.
Language Packages
<details open> <summary><strong>Rust</strong></summary>
cargo add html-to-markdown-rs
See [Rust README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown) for full documentation.
</details>
<details> <summary><strong>Python</strong></summary>
pip install html-to-markdown
See [Python README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/python) for full documentation.
</details>
<details> <summary><strong>Node.js</strong></summary>
pnpm add @xberg-io/html-to-markdown
See [Node.js README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-node) for full documentation.
</details>
<details> <summary><strong>Go</strong></summary>
go get github.com/xberg-io/html-to-markdown/packages/go/v3
See [Go README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/go) for full documentation.
</details>
<details> <summary><strong>Java</strong></summary>
Available on Maven Central as `io.xberg:html-to-markdown`. See [Java README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/java) for the dependency snippet and current version.
</details>
<details> <summary><strong>C#</strong></summary>
dotnet add package XbergIo.HtmlToMarkdown
See [C# README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/csharp) for full documentation.
</details>
<details> <summary><strong>Ruby</strong></summary>
gem install html-to-markdown
See [Ruby README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/ruby) for full documentation.
</details>
<details> <summary><strong>PHP</strong></summary>
This is a native PHP extension (Rust `ext-php-rs`), so install it with [PIE](https://github.com/php/pie) — not `composer require`:
pie install xberg-io/html-to-markdown
See [PHP README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-php) for full documentation.
</details>
<details> <summary><strong>Elixir</strong></summary>
Add `{:html_to_markdown, "~> 3.6"}` to your `mix.exs` dependencies. See [Elixir README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/elixir) for full documentation.
</details>
<details> <summary><strong>R</strong></summary>
install.packages("htmltomarkdown", repos = "https://xberg-io.r-universe.dev")See [R README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/r) for full documentation.
</details>
<details> <summary><strong>Dart / Flutter</strong></summary>
dart pub add h2m
See [Dart README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/dart) for full documentation.
</details>
<details> <summary><strong>Kotlin (Android)</strong></summary>
Available on Maven Central as `io.xberg:html-to-markdown-android`. See [Kotlin README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/kotlin-android) for the dependency snippet and current version.
</details>
<details> <summary><strong>Swift</strong></summary>
Add via Swift Package Manager. See [Swift README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/swift) for full documentation.
</details>
<details> <summary><strong>Zig</strong></summary>
See [Zig README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/zig) for installation and usage.
</details>
<details> <summary><strong>WebAssembly</strong></summary>
pnpm add @xberg-io/html-to-markdown-wasm
See [WebAssembly README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-wasm) for full documentation.
</details>
<details> <summary><strong>C/C++ (FFI)</strong></summary>
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 15 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "name": "html-to-markdown",
- "description": "Fast, lossless HTML→Markdown conversion for coding agents, by Kreuzberg, Inc.",
- "owner": {
- "name": "Kreuzberg, Inc.",
- "email": "contact@xberg.io"
- },
- "plugins": [
- {
- "name": "html-to-markdown",
- "description": "Fast, lossless HTML→Markdown conversion with structured metadata, tables, and document-structure extraction.",
- "source": "./plugin"
- }
- ]
- }
README.md · README · 446 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <!-- This file is auto-generated by alef — DO NOT EDIT. -->
- <!-- alef:hash:78a50bbe93502f2f81a98124918d11975401b1e57470462f5372fc17c0d15a4f -->
- <!-- To regenerate: alef readme -->
- <!-- To verify freshness: alef verify -->
- <p align="center">
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-dark.svg">
- <img alt="Xberg" width="420" src="https://cdn.jsdelivr.net/gh/xberg-io/assets@v1/banner/readme-banner-light.svg">
- </picture>
- </p>
- # html-to-markdown
- <div align="center" style="display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 20px 0;">
- <a href="https://github.com/xberg-io/alef">
- <img src="https://img.shields.io/badge/built%20with-alef%20%D7%90-007ec6" alt="Built with alef">
- </a>
- <!-- Language Bindings -->
- <a href="https://crates.io/crates/html-to-markdown-rs">
- <img src="https://img.shields.io/crates/v/html-to-markdown-rs?label=Rust&color=007ec6" alt="Rust">
- </a>
- <a href="https://pypi.org/project/html-to-markdown/">
- <img src="https://img.shields.io/pypi/v/html-to-markdown?label=Python&color=007ec6" alt="Python">
- </a>
- <a href="https://www.npmjs.com/package/@xberg-io/html-to-markdown">
- <img src="https://img.shields.io/npm/v/@xberg-io/html-to-markdown?label=Node.js&color=007ec6" alt="Node.js">
- </a>
- <a href="https://www.npmjs.com/package/@xberg-io/html-to-markdown-wasm">
- <img src="https://img.shields.io/npm/v/@xberg-io/html-to-markdown-wasm?label=WASM&color=007ec6" alt="WASM">
- </a>
- <a href="https://central.sonatype.com/artifact/io.xberg/html-to-markdown">
- <img src="https://img.shields.io/maven-central/v/io.xberg/html-to-markdown?label=Java&color=007ec6" alt="Java">
- </a>
- <a href="https://pkg.go.dev/github.com/xberg-io/html-to-markdown/packages/go/v3">
- <img src="https://img.shields.io/github/v/tag/xberg-io/html-to-markdown?label=Go&color=007ec6&filter=v3*" alt="Go">
- </a>
- <a href="https://www.nuget.org/packages/XbergIo.HtmlToMarkdown/">
- <img src="https://img.shields.io/nuget/v/XbergIo.HtmlToMarkdown?label=C%23&color=007ec6" alt="C#">
- </a>
- <a href="https://packagist.org/packages/xberg-io/html-to-markdown">
- <img src="https://img.shields.io/packagist/v/xberg-io/html-to-markdown?label=PHP&color=007ec6" alt="PHP">
- </a>
- <a href="https://rubygems.org/gems/html-to-markdown">
- <img src="https://img.shields.io/gem/v/html-to-markdown?label=Ruby&color=007ec6" alt="Ruby">
- </a>
- <a href="https://hex.pm/packages/html_to_markdown">
- <img src="https://img.shields.io/hexpm/v/html_to_markdown?label=Elixir&color=007ec6" alt="Elixir">
- </a>
- <a href="https://xberg-io.r-universe.dev/htmltomarkdown">
- <img src="https://img.shields.io/badge/R-htmltomarkdown-007ec6" alt="R">
- </a>
- <a href="https://pub.dev/packages/h2m">
- <img src="https://img.shields.io/pub/v/h2m?label=Dart&color=007ec6" alt="Dart">
- </a>
- <a href="https://central.sonatype.com/artifact/io.xberg/html-to-markdown-android">
- <img src="https://img.shields.io/maven-central/v/io.xberg/html-to-markdown-android?label=Kotlin&color=007ec6" alt="Kotlin">
- </a>
- <a href="https://github.com/xberg-io/html-to-markdown/tree/main/packages/swift">
- <img src="https://img.shields.io/badge/Swift-SPM-007ec6" alt="Swift">
- </a>
- <a href="https://github.com/xberg-io/html-to-markdown/tree/main/packages/zig">
- <img src="https://img.shields.io/badge/Zig-package-007ec6" alt="Zig">
- </a>
- <a href="https://github.com/xberg-io/html-to-markdown/releases">
- <img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI">
- </a>
- <!-- Project Info -->
- <a href="https://github.com/xberg-io/html-to-markdown/blob/main/LICENSE">
- <img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License">
- </a>
- <a href="https://docs.html-to-markdown.xberg.io">
- <img src="https://img.shields.io/badge/Docs-html--to--markdown-007ec6" alt="Documentation">
- </a>
- </div>
- <div align="center" style="display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 24px;">
- <a href="https://discord.gg/xt9WY3GnKR">
- <img height="22" src="https://img.shields.io/badge/Discord-Chat-007ec6?logo=discord&logoColor=white" alt="Join Discord">
- </a>
- <a href="https://docs.html-to-markdown.xberg.io/demo/">
- <img height="22" src="https://img.shields.io/badge/Live%20Demo-Open-007ec6?logo=webassembly&logoColor=white" alt="Live Demo">
- </a>
- </div>
- Turn messy, real-world HTML into clean Markdown — from the language you already work in.
- ## What and Why?
- 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.
- ### Features
- | 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 |
- <div align="center">
- <a href="https://github.com/xberg-io/html-to-markdown/stargazers">
- <img src="docs/assets/star.gif" alt="Star html-to-markdown on GitHub" width="640">
- </a>
- </div>
- <p align="center"><strong>⭐ Star this repo to show your support — it helps others discover html-to-markdown.</strong></p>
- ## Quick Start
- `convert()` is the single entry point — it returns a structured result with `content`, `warnings`, and optional `metadata`.
- ### Language Packages
- <details open>
- <summary><strong>Rust</strong></summary>
- ```sh
- cargo add html-to-markdown-rs
- ```
- The Rust crate needs Rust 1.99 or newer.
- See [Rust README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown) for full documentation.
- </details>
- <details>
- <summary><strong>Python</strong></summary>
- ```sh
- pip install html-to-markdown
- ```
- See [Python README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/python) for full documentation.
- </details>
- <details>
- <summary><strong>Node.js</strong></summary>
- ```sh
- pnpm add @xberg-io/html-to-markdown
- ```
- See [Node.js README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-node) for full documentation.
- </details>
- <details>
- <summary><strong>Go</strong></summary>
- ```sh
- go get github.com/xberg-io/html-to-markdown/packages/go/v3
- ```
- See [Go README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/go) for full documentation.
- </details>
- <details>
- <summary><strong>Java</strong></summary>
- Available on Maven Central as `io.xberg:html-to-markdown`. See [Java README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/java) for the dependency snippet and current version.
- </details>
- <details>
- <summary><strong>C#</strong></summary>
- ```sh
- dotnet add package XbergIo.HtmlToMarkdown
- ```
- See [C# README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/csharp) for full documentation.
- </details>
- <details>
- <summary><strong>Ruby</strong></summary>
- ```sh
- gem install html-to-markdown
- ```
- See [Ruby README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/ruby) for full documentation.
- </details>
- <details>
- <summary><strong>PHP</strong></summary>
- This is a native PHP extension (Rust `ext-php-rs`), so install it with [PIE](https://github.com/php/pie) — not `composer require`:
- ```sh
- pie install xberg-io/html-to-markdown
- ```
- See [PHP README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-php) for full documentation.
- </details>
- <details>
- <summary><strong>Elixir</strong></summary>
- Add `{:html_to_markdown, "~> 3.6"}` to your `mix.exs` dependencies. See [Elixir README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/elixir) for full documentation.
- </details>
- <details>
- <summary><strong>R</strong></summary>
- ```r
- install.packages("htmltomarkdown", repos = "https://xberg-io.r-universe.dev")
- ```
- See [R README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/r) for full documentation.
- </details>
- <details>
- <summary><strong>Dart / Flutter</strong></summary>
- ```sh
- dart pub add h2m
- ```
- See [Dart README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/dart) for full documentation.
- </details>
- <details>
- <summary><strong>Kotlin (Android)</strong></summary>
- Available on Maven Central as `io.xberg:html-to-markdown-android`. See [Kotlin README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/kotlin-android) for the dependency snippet and current version.
- </details>
- <details>
- <summary><strong>Swift</strong></summary>
- Add via Swift Package Manager. See [Swift README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/swift) for full documentation.
- </details>
- <details>
- <summary><strong>Zig</strong></summary>
- See [Zig README](https://github.com/xberg-io/html-to-markdown/tree/main/packages/zig) for installation and usage.
- </details>
- <details>
- <summary><strong>WebAssembly</strong></summary>
- ```sh
- pnpm add @xberg-io/html-to-markdown-wasm
- ```
- See [WebAssembly README](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-wasm) for full documentation.
- </details>
- <details>
- <summary><strong>C/C++ (FFI)</strong></summary>
- Pre-built `.so` / `.dll` / `.dylib` from [GitHub Releases](https://github.com/xberg-io/html-to-markdown/releases). See [FFI crate](https://github.com/xberg-io/html-to-markdown/tree/main/crates/html-to-markdown-ffi) for full documentation.
- </details>
- <details>
- <summary><strong>CLI</strong></summary>
- ```sh
- cargo install html-to-markdown-cli
- ```
- ```sh
- # Or install the prebuilt binary via cargo-binstall:
- cargo binstall html-to-markdown-cli
- ```
- ```sh
- brew install xberg-io/tap/html-to-markdown
- ```
- Windows users can install the same binary through [Scoop](https://scoop.sh):
- ```powershell
- scoop bucket add xberg https://github.com/xberg-io/scoop-bucket
- scoop install html-to-markdown
- ```
- Every install provides the CLI as both `html-to-markdown` and the short alias `h2m`.
- See [CLI usage](https://docs.html-to-markdown.xberg.io) for full documentation.
- </details>
- ### AI Coding Assistants
- Install the html-to-markdown plugin from [`xberg-io/html-to-markdown`](https://github.com/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](https://github.com/xberg-io/html-to-markdown/blob/main/plugin/README.md)
- 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](https://github.com/xberg-io/html-to-markdown/tree/main/skills),
- without a plugin or MCP registration, using the [skills CLI](https://github.com/vercel-labs/skills):
- ```sh
- 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.
- <details open>
- <summary><strong>Claude Code</strong></summary>
- ```text
- /plugin marketplace add xberg-io/html-to-markdown
- /plugin install html-to-markdown@html-to-markdown
- ```
- </details>
- <details>
- <summary><strong>Codex CLI</strong></summary>
- ```text
- /plugins add https://github.com/xberg-io/html-to-markdown
- ```
- Then search for `html-to-markdown` and select **Install Plugin**.
- </details>
- <details>
- <summary><strong>Cursor</strong></summary>
- Settings → Plugins → Add from URL → `https://github.com/xberg-io/html-to-markdown`, then select **html-to-markdown**.
- </details>
- <details>
- <summary><strong>Gemini CLI</strong></summary>
- From a checkout of this repository:
- ```sh
- gemini extensions install ./plugin
- ```
- The manifest is inside `plugin/`. See the [Gemini extension reference](https://geminicli.com/docs/extensions/reference/)
- for local installation and updates.
- </details>
- <details>
- <summary><strong>Factory Droid</strong></summary>
- ```text
- droid plugin marketplace add https://github.com/xberg-io/html-to-markdown
- droid plugin install html-to-markdown@html-to-markdown
- ```
- </details>
- <details>
- <summary><strong>GitHub Copilot CLI</strong></summary>
- ```text
- copilot plugin marketplace add https://github.com/xberg-io/html-to-markdown
- copilot plugin install html-to-markdown@html-to-markdown
- ```
- </details>
- <details>
- <summary><strong>Pi</strong></summary>
- From a checkout of this repository:
- ```bash
- pi install ./plugin
- ```
- After the next plugin release, install the same package used by OpenCode:
- ```bash
- 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.
- </details>
- <details>
- <summary><strong>opencode</strong></summary>
- Add the package to `opencode.json`:
- ```json
- {
- "$schema": "https://opencode.ai/config.json",
- "plugin": ["@xberg-io/opencode-html-to-markdown"]
- }
- ```
- </details>
- ## Documentation
- 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](https://docs.html-to-markdown.xberg.io)**.
- ## Part of Xberg.io
- - [Xberg](https://github.com/xberg-io/xberg) — the open-source content-intelligence engine: text, tables, and metadata from 101 formats (115 file extensions), with OCR, transcription, and code intelligence. MIT.
- - [Xberg Pro](https://xberg.io) — a complete self-hosted content-intelligence backend in a single container. Commercial.
- - [Xberg Enterprise](https://xberg.io) — the distributed, governed content-intelligence platform, scaled on Kubernetes with team governance and support. Commercial.
- - [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
- - [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
- - [liter-llm](https://github.com/xberg-io/liter-llm) — universal LLM API client with native bindings for 14 languages and 165 providers.
- - [tree-sitter-language-pack](https://github.com/xberg-io/tree-sitter-language-pack) — tree-sitter grammars and code-intelligence primitives.
- - [alef](https://github.com/xberg-io/alef) — the polyglot binding generator that produces every per-language binding across the 5 polyglot repos.
- ## Contributing
- Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions and guidelines.
- ## License
- MIT License — see [LICENSE](LICENSE) for details.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.