FindSoftware

HTML To Markdown for PHP

PHP library that converts HTML documents to Markdown text.

HTML To Markdown for PHP converts an HTML document or fragment into Markdown text. A converter object takes the HTML string and returns Markdown. Options strip tags, remove nodes, keep comments and set how line breaks, links and bold or italic text are written. Tables are converted only after a table converter is added to the environment. The library reads HTML through PHP’s DOM and XML extensions.

The README links league/commonmark and three other libraries for the opposite direction, Markdown to HTML.

Worth knowing

By default the library keeps HTML tags that have no Markdown equivalent, such as span, div, iframe and script, in the output. The strip_tags and remove_nodes options change that.

Identity

Status
Active
Maintainer
Colin O'Dell3
First release
20134

Rendering and deploy

Install with
composer2

Releases

Current major version
57
Last release
2026-10-197

Adoption

GitHub stars
1,9091
Packagist downloads
40,606,9446
Contributors
448
Dependent repositories
1,5814
Dependent packages
1324

Why these figures do not compare

Sources

  1. 2026-11-16: links, Written in, License, GitHub stars
    api.github.com/repos/thephpleague/html-to-markdown
  2. 2026-11-16: links, Categories, Install with
    github.com/thephpleague/html-to-markdown/blob/master/README.md
  3. 2026-11-16: Maintainer, License model
    github.com/thephpleague/html-to-markdown/blob/master/LICENSE
  4. 2026-11-16: First release, Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/packagist.org/packages/league%2Fhtml-to-markdown
  5. 2026-11-16: Runtime, Minimum runtime
    github.com/thephpleague/html-to-markdown/blob/5.2.3/composer.json
  6. 2026-11-16: Packagist downloads
    packagist.org/packages/league/html-to-markdown.json
  7. 2026-11-16: Current major version, Last release
    github.com/thephpleague/html-to-markdown/releases/tag/5.2.3
  8. 2026-11-16: Contributors
    api.github.com/repos/thephpleague/html-to-markdown/contributors?per_page=1

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON