Installation¶
html-to-markdown provides native bindings for 12 language ecosystems, plus a standalone CLI tool. Choose your platform below.
Language Bindings¶
v2.0.0
Or with uv:
Requirements: Python 3.10+
Pre-built wheels are available for Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64). The package includes compiled Rust extensions via PyO3 -- no Rust toolchain needed.
Used by kreuzberg
The Python binding is the same one used internally by kreuzberg for its HTML conversion pipeline. If you are already using kreuzberg for document processing, html-to-markdown is included as a dependency.
v2.3.0
For Node.js and Bun (native NAPI-RS bindings, best performance):
For browsers, Deno, and Cloudflare Workers (WebAssembly):
Unified TypeScript package (auto-selects native or WASM based on environment):
Requirements: Node.js 18+ or Bun 1.0+
Pre-built native binaries are available for Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64).
v2.0.0
Or add to your Cargo.toml:
Requirements: Rust 1.80+ (2024 edition)
The core Rust crate has no system dependencies and compiles on all major platforms.
v2.5.1
Or add to your Gemfile:
Requirements: Ruby 3.2+
Pre-built native extensions are included. The gem uses Magnus for Rust bindings.
v2.5.6
Requirements: PHP 8.4+
The package includes a native Rust extension via ext-php-rs. PHPStan level 9 compatible.
v2.8.0
Requirements: Go 1.21+
The Go binding uses FFI to call the Rust core. The shared library is automatically downloaded and cached on first use. Set HTML_TO_MARKDOWN_FFI_PATH to provide a custom library path, or HTML_TO_MARKDOWN_FFI_CACHE_DIR to control the cache directory.
v2.24.2
Add to your pom.xml:
<dependency>
<groupId>dev.kreuzberg</groupId>
<artifactId>html-to-markdown</artifactId>
<version>2.28.1</version>
</dependency>
Or with Gradle:
Requirements: Java 24+ (Panama Foreign Function & Memory API)
The Java binding uses the Panama FFM API for zero-overhead FFI calls to the Rust core.
v2.8.0
Or via the NuGet Package Manager:
Requirements: .NET 8.0+
The C# binding uses P/Invoke for FFI to the Rust core.
v2.8.2
Add to your mix.exs dependencies:
Then fetch dependencies:
Requirements: Elixir 1.19+, OTP 25+
The Elixir binding uses Rustler for safe NIF bindings to the Rust core.
v2.25.2
Install from r-universe:
install.packages("htmltomarkdown",
repos = c("https://kreuzberg-dev.r-universe.dev",
"https://cloud.r-project.org"))
Requirements: R 4.3+
The R binding uses extendr for Rust FFI.
v2.28.1
Download the pre-built shared library from the GitHub Releases page, or build from source:
The C header file html_to_markdown.h is generated by cbindgen and included in the release artifacts. Link against libhtml_to_markdown_ffi.so (Linux), libhtml_to_markdown_ffi.dylib (macOS), or html_to_markdown_ffi.dll (Windows).
Requirements: Any C compiler with C11 support
v2.3.0
Install the npm package:
Or use directly from a CDN:
<script type="module">
import init, { convert } from 'https://unpkg.com/@kreuzberg/html-to-markdown-wasm/html_to_markdown_wasm.js';
await init();
const markdown = convert('<h1>Hello</h1>');
</script>
Requirements: Any modern browser with WebAssembly support (Chrome 89+, Firefox 79+, Safari 14.1+)
CLI Tool¶
The command-line interface lets you convert HTML files without writing code.
Download platform-specific binaries from the GitHub Releases page.
After installation, verify it works:
Next Steps¶
Once you have html-to-markdown installed, head to the Quick Start guide to convert your first HTML document.