PHPackages                             worksome/html2text - 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. worksome/html2text

ActiveLibrary

worksome/html2text
==================

A PHP script to convert HTML into a plain text format

v2.1.0(10mo ago)1279.9k↑22.8%2[2 PRs](https://github.com/worksome/html2text/pulls)MITPHPPHP ^8.4CI passing

Since Oct 5Pushed 2mo agoCompare

[ Source](https://github.com/worksome/html2text)[ Packagist](https://packagist.org/packages/worksome/html2text)[ GitHub Sponsors](https://github.com/worksome)[ RSS](/packages/worksome-html2text/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

Html2Text
=========

[](#html2text)

[![Latest Version on Packagist](https://camo.githubusercontent.com/99ba24652dd0d1fd89529b46bd60121e40289517fc569002c60fdcf16b50000d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776f726b736f6d652f68746d6c32746578742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/worksome/html2text)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8508acaf02748c47c054a2347a6f0ff7e223fd6f1b21f94904a960039a094a3a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776f726b736f6d652f68746d6c32746578742f74657374732e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d7465737473)](https://github.com/worksome/html2text/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/419ed4b62731af4158f2b25d7f42aab31e4aa4287273c6461ce6f865db906cce/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f776f726b736f6d652f68746d6c32746578742f7374617469632e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265266c6162656c3d636f64652532307374796c65)](https://github.com/worksome/html2text/actions?query=workflow%3A%22Static+Analysis%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/9b647f5a3eb2f50c6981bf5c25ed4f650bca76bebe5fd81557d7cf3bfb6938bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776f726b736f6d652f68746d6c32746578742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/worksome/html2text)

A simple converter from HTML to Plaintext

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require worksome/html2text
```

Usage
-----

[](#usage)

```
$text = \Worksome\Html2Text\Html2Text::convert($html);
```

See the [original repository](https://github.com/soundasleep/html2text) for more information.

### Options

[](#options)

OptionDefaultDescription**dropLinks**`false`Set to `true` to not render links as `My Link` instead of `[https://foo.com](My Link)`.**characterSet**`'auto'`Set to a specific character set to override the auto-detection with `mb_detect_encoding`.Pass along a configuration class as a second argument to `convert`, for example:

```
$options = new \Worksome\Html2Text\Config(
    dropLinks: true
);

$text = \Worksome\Html2Text\Html2Text::convert($html, $options);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [GitHub Releases](https://github.com/worksome/html2text/releases) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Owen Voke](https://github.com/owenvoke)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance72

Regular maintenance activity

Popularity38

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 59.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 ~331 days

Total

4

Last Release

328d ago

Major Versions

v1.0.0 → v2.0.02022-10-05

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.1.0PHP ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1899334?v=4)[Owen Voke](/maintainers/owenvoke)[@owenvoke](https://github.com/owenvoke)

---

Top Contributors

[![soundasleep](https://avatars.githubusercontent.com/u/3889656?v=4)](https://github.com/soundasleep "soundasleep (85 commits)")[![owenvoke](https://avatars.githubusercontent.com/u/1899334?v=4)](https://github.com/owenvoke "owenvoke (31 commits)")[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (7 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![vanhoavn](https://avatars.githubusercontent.com/u/3288188?v=4)](https://github.com/vanhoavn "vanhoavn (2 commits)")[![SDKiller](https://avatars.githubusercontent.com/u/2150916?v=4)](https://github.com/SDKiller "SDKiller (1 commits)")[![Stadly](https://avatars.githubusercontent.com/u/7263579?v=4)](https://github.com/Stadly "Stadly (1 commits)")[![thetaylor82](https://avatars.githubusercontent.com/u/2462662?v=4)](https://github.com/thetaylor82 "thetaylor82 (1 commits)")[![timothyasp](https://avatars.githubusercontent.com/u/707699?v=4)](https://github.com/timothyasp "timothyasp (1 commits)")[![tommygnr](https://avatars.githubusercontent.com/u/929392?v=4)](https://github.com/tommygnr "tommygnr (1 commits)")[![ulrichsg](https://avatars.githubusercontent.com/u/197901?v=4)](https://github.com/ulrichsg "ulrichsg (1 commits)")[![pethersonmorenosqg](https://avatars.githubusercontent.com/u/9138772?v=4)](https://github.com/pethersonmorenosqg "pethersonmorenosqg (1 commits)")[![guillaume-ro-fr](https://avatars.githubusercontent.com/u/1820051?v=4)](https://github.com/guillaume-ro-fr "guillaume-ro-fr (1 commits)")[![jaylinski](https://avatars.githubusercontent.com/u/1668766?v=4)](https://github.com/jaylinski "jaylinski (1 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (1 commits)")[![maskas](https://avatars.githubusercontent.com/u/1159983?v=4)](https://github.com/maskas "maskas (1 commits)")[![cyrosy](https://avatars.githubusercontent.com/u/2836107?v=4)](https://github.com/cyrosy "cyrosy (1 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/worksome-html2text/health.svg)

```
[![Health](https://phpackages.com/badges/worksome-html2text/health.svg)](https://phpackages.com/packages/worksome-html2text)
```

PHPackages © 2026

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