PHPackages                             goldziher/html-to-markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. goldziher/html-to-markdown

ActivePhp-ext[Parsing &amp; Serialization](/categories/parsing)

goldziher/html-to-markdown
==========================

Modern PHP API for the html\_to\_markdown native extension powered by the Rust html-to-markdown engine.

3.1.0(1mo ago)6265650[5 PRs](https://github.com/kreuzberg-dev/html-to-markdown/pulls)MITHTMLPHP ^8.4CI failing

Since Nov 3Pushed 1mo ago7 watchersCompare

[ Source](https://github.com/kreuzberg-dev/html-to-markdown)[ Packagist](https://packagist.org/packages/goldziher/html-to-markdown)[ Docs](https://github.com/kreuzberg-dev/html-to-markdown)[ RSS](/packages/goldziher-html-to-markdown/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (111)Used By (0)

html-to-markdown
================

[](#html-to-markdown)

 [ ![Rust](https://camo.githubusercontent.com/875152826f78912b6caa083335bd4da698c60b03d9c1928a79f6ccc3d0f43c34/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f762f68746d6c2d746f2d6d61726b646f776e2d72733f6c6162656c3d5275737426636f6c6f723d303037656336) ](https://crates.io/crates/html-to-markdown-rs) [ ![Python](https://camo.githubusercontent.com/37b516d01cb111f0df23c1489fcfbc5580c626199b7ace3f49c2d4e9bfd13cc1/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f68746d6c2d746f2d6d61726b646f776e3f6c6162656c3d507974686f6e26636f6c6f723d303037656336) ](https://pypi.org/project/html-to-markdown/) [ ![Node.js](https://camo.githubusercontent.com/3ed82c0e9a2e5687e9224b597d6d69877e48a979acbb48da0e68a26de28ec1cf/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f406b7265757a626572672f68746d6c2d746f2d6d61726b646f776e2d6e6f64653f6c6162656c3d4e6f64652e6a7326636f6c6f723d303037656336) ](https://www.npmjs.com/package/@kreuzberg/html-to-markdown-node) [ ![WASM](https://camo.githubusercontent.com/4bbf23256bc76887ca01d6a876d94eff669bb9a7160507934b160454a1456f92/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f406b7265757a626572672f68746d6c2d746f2d6d61726b646f776e2d7761736d3f6c6162656c3d5741534d26636f6c6f723d303037656336) ](https://www.npmjs.com/package/@kreuzberg/html-to-markdown-wasm) [ ![Java](https://camo.githubusercontent.com/02c96f93adcc69653f84e5efbf7ba20030d8a05b53a0de1ffc2b51c2597505da/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f6465762e6b7265757a626572672f68746d6c2d746f2d6d61726b646f776e3f6c6162656c3d4a61766126636f6c6f723d303037656336) ](https://central.sonatype.com/artifact/dev.kreuzberg/html-to-markdown) [ ![Go](https://camo.githubusercontent.com/e028c1af7591d0ad00dbd102f0eb5e5c39ea749dcdf9fdcca5fde380ab6eb1f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f6b7265757a626572672d6465762f68746d6c2d746f2d6d61726b646f776e3f6c6162656c3d476f26636f6c6f723d3030376563362666696c7465723d76322e32382e34) ](https://pkg.go.dev/github.com/kreuzberg-dev/html-to-markdown/packages/go/v2/htmltomarkdown) [ ![C#](https://camo.githubusercontent.com/fdf495e23ffcdc6a9ab2e75c65dfee9405f342254d7e349ba7275d5984f2f8f3/68747470733a2f2f696d672e736869656c64732e696f2f6e756765742f762f4b7265757a626572674465762e48746d6c546f4d61726b646f776e3f6c6162656c3d4325323326636f6c6f723d303037656336) ](https://www.nuget.org/packages/KreuzbergDev.HtmlToMarkdown/) [ ![PHP](https://camo.githubusercontent.com/4a10c87c84851720dd6fe94a96054d893f7572ae22e4cd24514c9ae068363a91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7265757a626572672d6465762f68746d6c2d746f2d6d61726b646f776e3f6c6162656c3d50485026636f6c6f723d303037656336) ](https://packagist.org/packages/kreuzberg-dev/html-to-markdown) [ ![Ruby](https://camo.githubusercontent.com/6a4b8b9f1861bb7980c818ef51e2556aba13e737033adf3d0f3165577191bae1/68747470733a2f2f696d672e736869656c64732e696f2f67656d2f762f68746d6c2d746f2d6d61726b646f776e3f6c6162656c3d5275627926636f6c6f723d303037656336) ](https://rubygems.org/gems/html-to-markdown) [ ![Elixir](https://camo.githubusercontent.com/970b7fe0422be681afedf7ea2c00c2bd2f44da7436c4679e7a6990e64ffefd44/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f762f68746d6c5f746f5f6d61726b646f776e3f6c6162656c3d456c6978697226636f6c6f723d303037656336) ](https://hex.pm/packages/html_to_markdown) [ ![R](https://camo.githubusercontent.com/f1a0b15ace52ad38450104c2a5293dd61c561fd3cbb27dbf2ba3b89cfde2010d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f522d68746d6c746f6d61726b646f776e2d303037656336) ](https://kreuzberg-dev.r-universe.dev/htmltomarkdown) [ ![C](https://camo.githubusercontent.com/41b9c58c3810775402965a3a7652da9832ea83391c1ff255081e5551900db8f2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f432d4646492d303037656336) ](https://github.com/kreuzberg-dev/html-to-markdown/releases) [ ![Documentation](https://camo.githubusercontent.com/f154a380ea5d0fe5bdf592d4ea4a7d45f5f63b71795515970910331afd83def0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f63732d6b7265757a626572672e6465762d303037656336) ](https://docs.html-to-markdown.kreuzberg.dev) [ ![License](https://camo.githubusercontent.com/0cd4d42d83d2124c29737dd1519425c87c4b465016ef0cee20cbcb8ef420c0e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d303037656336) ](https://github.com/kreuzberg-dev/html-to-markdown/blob/main/LICENSE) [ ![Live Demo](https://camo.githubusercontent.com/7aa98168c51ed6f6ec8777072227117b6871f4e5cfef4627122257fc754ffbd8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545322539362542362545462542382538465f4c6976655f44656d6f2d303037656336) ](https://docs.html-to-markdown.kreuzberg.dev/demo/)

[![Banner](https://private-user-images.githubusercontent.com/247880403/534229880-478a83da-237b-446b-b3a8-e564c13e00a8.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0ODYxNjksIm5iZiI6MTc3NDQ4NTg2OSwicGF0aCI6Ii8yNDc4ODA0MDMvNTM0MjI5ODgwLTQ3OGE4M2RhLTIzN2ItNDQ2Yi1iM2E4LWU1NjRjMTNlMDBhOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNlQwMDQ0MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NzE0NzQxOTNjMTRiODMyODhkNThjMmI1M2M4OTBlY2ZhZjFmNGRhYzhhYzYzZmE1ZWNkZGI2ZGMwOTdiMzgwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.M-_AZishPbJtd1kJ4EF1ympJ5VIpDHlwrNYczGWlg-Q)](https://private-user-images.githubusercontent.com/247880403/534229880-478a83da-237b-446b-b3a8-e564c13e00a8.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0ODYxNjksIm5iZiI6MTc3NDQ4NTg2OSwicGF0aCI6Ii8yNDc4ODA0MDMvNTM0MjI5ODgwLTQ3OGE4M2RhLTIzN2ItNDQ2Yi1iM2E4LWU1NjRjMTNlMDBhOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNlQwMDQ0MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04NzE0NzQxOTNjMTRiODMyODhkNThjMmI1M2M4OTBlY2ZhZjFmNGRhYzhhYzYzZmE1ZWNkZGI2ZGMwOTdiMzgwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.M-_AZishPbJtd1kJ4EF1ympJ5VIpDHlwrNYczGWlg-Q) [ ![Discord](https://camo.githubusercontent.com/f66b90b5263482521c9ff4e4cae96688b20f4670a56a633be6a10c633091b757/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446973636f72642d4a6f696e2532306f7572253230636f6d6d756e6974792d3732383964613f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465) ](https://discord.gg/pXxagNK2zN)

High-performance HTML to Markdown conversion powered by Rust. Ships as native bindings for **Rust, Python, TypeScript/Node.js, Ruby, PHP, Go, Java, C#, Elixir, R, C (FFI), and WebAssembly** with identical rendering across all runtimes.

**[Documentation](https://docs.html-to-markdown.kreuzberg.dev)** | **[Live Demo](https://docs.html-to-markdown.kreuzberg.dev/demo/)** | **[API Reference](https://docs.html-to-markdown.kreuzberg.dev/reference/api-rust/)**

Highlights
----------

[](#highlights)

- **150-280 MB/s** throughput (10-80x faster than pure Python alternatives)
- **12 language bindings** with consistent output across all runtimes
- **Metadata extraction** — title, headers, links, images, structured data (JSON-LD, Microdata, RDFa)
- **Visitor pattern** — custom callbacks for content filtering, URL rewriting, domain-specific dialects
- **Table extraction** — extract structured table data (cells, headers, rendered markdown) during conversion
- **Secure by default** — built-in HTML sanitization via ammonia

Quick Start
-----------

[](#quick-start)

```
# Rust
cargo add html-to-markdown-rs

# Python
pip install html-to-markdown

# TypeScript / Node.js
npm install @kreuzberg/html-to-markdown-node

# Ruby
gem install html-to-markdown

# CLI
cargo install html-to-markdown-cli
# or
brew install kreuzberg-dev/tap/html-to-markdown
```

See the **[Installation Guide](https://docs.html-to-markdown.kreuzberg.dev/getting-started/installation/)** for all languages including PHP, Go, Java, C#, Elixir, R, and WASM.

Part of the Kreuzberg Ecosystem
-------------------------------

[](#part-of-the-kreuzberg-ecosystem)

html-to-markdown is developed by [kreuzberg.dev](https://kreuzberg.dev) and powers the HTML conversion pipeline in [Kreuzberg](https://docs.kreuzberg.dev), a document intelligence library for extracting text from PDFs, images, and office documents.

Contributing
------------

[](#contributing)

Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions and guidelines.

License
-------

[](#license)

MIT License — see [LICENSE](LICENSE) for details.

###  Health Score

59

—

FairBetter than 98% of packages

Maintenance98

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

105

Last Release

38d ago

Major Versions

v2.15.0 → v4.0.0-rc.162025-12-22

2.30.0 → 3.0.02026-03-30

PHP version history (2 changes)v2.5.7PHP ^8.2

2.24.6PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/e332a98740b42010f18d4ff016720276b0f6b893776963c6fe29beac6f5a94ff?d=identicon)[Goldziher](/maintainers/Goldziher)

---

Top Contributors

[![Goldziher](https://avatars.githubusercontent.com/u/30733348?v=4)](https://github.com/Goldziher "Goldziher (1297 commits)")[![AlexVonB](https://avatars.githubusercontent.com/u/7325664?v=4)](https://github.com/AlexVonB "AlexVonB (130 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (55 commits)")[![matthewwithanm](https://avatars.githubusercontent.com/u/126263?v=4)](https://github.com/matthewwithanm "matthewwithanm (55 commits)")[![andredelft](https://avatars.githubusercontent.com/u/32297879?v=4)](https://github.com/andredelft "andredelft (13 commits)")[![Mkalbani](https://avatars.githubusercontent.com/u/112591148?v=4)](https://github.com/Mkalbani "Mkalbani (11 commits)")[![nickovs](https://avatars.githubusercontent.com/u/4205868?v=4)](https://github.com/nickovs "nickovs (9 commits)")[![BrunoMiguens](https://avatars.githubusercontent.com/u/6075268?v=4)](https://github.com/BrunoMiguens "BrunoMiguens (8 commits)")[![SimonIT](https://avatars.githubusercontent.com/u/11720038?v=4)](https://github.com/SimonIT "SimonIT (8 commits)")[![dietervansteenwegen](https://avatars.githubusercontent.com/u/46349482?v=4)](https://github.com/dietervansteenwegen "dietervansteenwegen (6 commits)")[![tlp-red](https://avatars.githubusercontent.com/u/57686909?v=4)](https://github.com/tlp-red "tlp-red (4 commits)")[![jfouret](https://avatars.githubusercontent.com/u/30047021?v=4)](https://github.com/jfouret "jfouret (4 commits)")[![bbeardsley](https://avatars.githubusercontent.com/u/9709?v=4)](https://github.com/bbeardsley "bbeardsley (4 commits)")[![chrispy-snps](https://avatars.githubusercontent.com/u/50950969?v=4)](https://github.com/chrispy-snps "chrispy-snps (4 commits)")[![ivanova-gif](https://avatars.githubusercontent.com/u/247880403?v=4)](https://github.com/ivanova-gif "ivanova-gif (4 commits)")[![tommyjs007](https://avatars.githubusercontent.com/u/5484335?v=4)](https://github.com/tommyjs007 "tommyjs007 (3 commits)")[![AndrewCRichards](https://avatars.githubusercontent.com/u/14843292?v=4)](https://github.com/AndrewCRichards "AndrewCRichards (3 commits)")[![idvorkin](https://avatars.githubusercontent.com/u/280981?v=4)](https://github.com/idvorkin "idvorkin (3 commits)")[![jiulongw](https://avatars.githubusercontent.com/u/1650734?v=4)](https://github.com/jiulongw "jiulongw (3 commits)")[![jsm28](https://avatars.githubusercontent.com/u/10537793?v=4)](https://github.com/jsm28 "jsm28 (3 commits)")

---

Tags

hocrhtmlhtml-convertermarkdownmarkdown-converterragtext-extractiontext-processing

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/goldziher-html-to-markdown/health.svg)

```
[![Health](https://phpackages.com/badges/goldziher-html-to-markdown/health.svg)](https://phpackages.com/packages/goldziher-html-to-markdown)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M344](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
