Skip to content

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

pip install html-to-markdown

Or with uv:

uv add html-to-markdown

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):

npm install @kreuzberg/html-to-markdown-node

For browsers, Deno, and Cloudflare Workers (WebAssembly):

npm install @kreuzberg/html-to-markdown-wasm

Unified TypeScript package (auto-selects native or WASM based on environment):

npm install @kreuzberg/html-to-markdown

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

cargo add html-to-markdown-rs

Or add to your Cargo.toml:

[dependencies]
html-to-markdown-rs = "2.26"

Requirements: Rust 1.80+ (2024 edition)

The core Rust crate has no system dependencies and compiles on all major platforms.

v2.5.1

gem install html-to-markdown

Or add to your Gemfile:

gem 'html-to-markdown'

Requirements: Ruby 3.2+

Pre-built native extensions are included. The gem uses Magnus for Rust bindings.

v2.5.6

composer require kreuzberg-dev/html-to-markdown

Requirements: PHP 8.4+

The package includes a native Rust extension via ext-php-rs. PHPStan level 9 compatible.

v2.8.0

go get github.com/kreuzberg-dev/html-to-markdown/packages/go/v2/htmltomarkdown

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:

implementation("dev.kreuzberg:html-to-markdown:2.28.1")

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

dotnet add package KreuzbergDev.HtmlToMarkdown

Or via the NuGet Package Manager:

Install-Package KreuzbergDev.HtmlToMarkdown

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:

defp deps do
  [
    {:html_to_markdown, "~> 2.26"}
  ]
end

Then fetch dependencies:

mix deps.get

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:

cargo build --release -p html-to-markdown-ffi

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:

npm install @kreuzberg/html-to-markdown-wasm

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.

cargo install html-to-markdown-cli
brew install kreuzberg-dev/tap/html-to-markdown

Download platform-specific binaries from the GitHub Releases page.

After installation, verify it works:

html-to-markdown --version

Next Steps

Once you have html-to-markdown installed, head to the Quick Start guide to convert your first HTML document.