# HTML To Markdown for PHP

PHP library that converts HTML documents to Markdown text.


Source: https://findsoftware.frbit.cloud/league-html-to-markdown/
Last reviewed: 2026-11-16
Listed since: 2026-11-16

## Record

### Links

- repository: https://github.com/thephpleague/html-to-markdown
- docs: https://github.com/thephpleague/html-to-markdown/blob/master/README.md

### Identity

- status: active
- maintainer: Colin O'Dell
- maintainerType: unknown
- parent: unknown
- firstRelease: 2013
- hqCountry: unknown

### Kind

- category: library
- hosting: php
- language: php
- runtime: php
- runtimeMin: php 7.2
- basedOn: unknown

### Content

- contentStore: not applicable
- databases: not applicable
- adminUi: not applicable
- headlessApi: not applicable
- templating: not applicable
- i18n: not applicable

### Rendering and deploy

- runsAs: not applicable
- renderingModes: not applicable
- installMethod: composer

### License

- licenseModel: open-source
- license: MIT

### Releases

- currentMajor: 5
- latestReleaseDate: 2026-10-19

### Adoption

- githubStargazers: 1909
- packagistDownloads: 40606944
- npmWeeklyDownloads: not applicable
- contributors: 44
- pluginCount: unknown
- packagistMonthlyDownloads: unknown
- ecosystemsMonthlyDownloads: unknown
- httpArchiveSites: unknown
- wordpressActiveInstalls: unknown
- dependentRepos: 1581
- dependentPackages: 132

### Sources

- urls: https://api.github.com/repos/thephpleague/html-to-markdown (read 2026-11-16)
- urls: https://github.com/thephpleague/html-to-markdown/blob/master/README.md (read 2026-11-16)
- maintainer: https://github.com/thephpleague/html-to-markdown/blob/master/LICENSE (read 2026-11-16)
- firstRelease: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/league%2Fhtml-to-markdown (read 2026-11-16)
- language: https://api.github.com/repos/thephpleague/html-to-markdown (read 2026-11-16)
- category: https://github.com/thephpleague/html-to-markdown/blob/master/README.md (read 2026-11-16)
- runtime: https://github.com/thephpleague/html-to-markdown/blob/5.2.3/composer.json (read 2026-11-16)
- runtimeMin: https://github.com/thephpleague/html-to-markdown/blob/5.2.3/composer.json (read 2026-11-16)
- installMethod: https://github.com/thephpleague/html-to-markdown/blob/master/README.md (read 2026-11-16)
- packagistDownloads: https://packagist.org/packages/league/html-to-markdown.json (read 2026-11-16)
- dependentPackages: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/league%2Fhtml-to-markdown (read 2026-11-16)
- dependentRepos: https://packages.ecosyste.ms/api/v1/registries/packagist.org/packages/league%2Fhtml-to-markdown (read 2026-11-16)
- license: https://api.github.com/repos/thephpleague/html-to-markdown (read 2026-11-16)
- licenseModel: https://github.com/thephpleague/html-to-markdown/blob/master/LICENSE (read 2026-11-16)
- currentMajor: https://github.com/thephpleague/html-to-markdown/releases/tag/5.2.3 (read 2026-11-16)
- latestReleaseDate: https://github.com/thephpleague/html-to-markdown/releases/tag/5.2.3 (read 2026-11-16)
- githubStargazers: https://api.github.com/repos/thephpleague/html-to-markdown (read 2026-11-16)
- contributors: https://api.github.com/repos/thephpleague/html-to-markdown/contributors?per_page=1 (read 2026-11-16)

## Notes

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.

---

Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Attributes are recorded, never scored; absent means unknown.
Credit, in full: FindSoftware, CC BY 4.0
