PHPackages                             hamza221/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hamza221/html2text

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hamza221/html2text
==================

Converts HTML to formatted plain text

v1.0.0(2y ago)0163.1k—4.5%GPL-2.0-or-laterPHP

Since Aug 16Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Html2Text
=========

[](#html2text)

A PHP library for converting HTML to formatted plain text.

[![Build Status](https://camo.githubusercontent.com/271d007ed15cebef8fb040b711d08b7f706843b90947f4f279c9a239013d1e14/68747470733a2f2f7472617669732d63692e6f72672f6d74696262656e2f68746d6c32746578742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mtibben/html2text)

Installing
----------

[](#installing)

```
composer require hamza221/html2text

```

Basic Usage
-----------

[](#basic-usage)

```
$html = new \Html2Text\Html2Text('Hello, &quot;world&quot;');

echo $html->getText();  // Hello, "WORLD"
```

History
-------

[](#history)

This library started life on the blog of Jon Abernathy

A number of projects picked up the library and started using it - among those was RoundCube mail. They made a number of updates to it over time to suit their webmail client.

Now it has been extracted as a standalone library. Hopefully it can be of use to others.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.5% 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

Unknown

Total

1

Last Release

1007d ago

### Community

Maintainers

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

---

Top Contributors

[![mtibben](https://avatars.githubusercontent.com/u/980499?v=4)](https://github.com/mtibben "mtibben (83 commits)")[![andrewnicols](https://avatars.githubusercontent.com/u/370047?v=4)](https://github.com/andrewnicols "andrewnicols (6 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (4 commits)")[![hamza221](https://avatars.githubusercontent.com/u/40746210?v=4)](https://github.com/hamza221 "hamza221 (4 commits)")[![cameorn1730](https://avatars.githubusercontent.com/u/46586436?v=4)](https://github.com/cameorn1730 "cameorn1730 (3 commits)")[![pstast](https://avatars.githubusercontent.com/u/5357442?v=4)](https://github.com/pstast "pstast (2 commits)")[![jimjag](https://avatars.githubusercontent.com/u/84076?v=4)](https://github.com/jimjag "jimjag (2 commits)")[![kasperg](https://avatars.githubusercontent.com/u/73966?v=4)](https://github.com/kasperg "kasperg (2 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![on2](https://avatars.githubusercontent.com/u/7304119?v=4)](https://github.com/on2 "on2 (1 commits)")[![orlitzky](https://avatars.githubusercontent.com/u/1432135?v=4)](https://github.com/orlitzky "orlitzky (1 commits)")[![scaytrase](https://avatars.githubusercontent.com/u/6578413?v=4)](https://github.com/scaytrase "scaytrase (1 commits)")[![sgrodzicki](https://avatars.githubusercontent.com/u/712836?v=4)](https://github.com/sgrodzicki "sgrodzicki (1 commits)")[![Sylry](https://avatars.githubusercontent.com/u/9798412?v=4)](https://github.com/Sylry "Sylry (1 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (1 commits)")[![vargaandrea](https://avatars.githubusercontent.com/u/1370800?v=4)](https://github.com/vargaandrea "vargaandrea (1 commits)")[![ajouve](https://avatars.githubusercontent.com/u/2337492?v=4)](https://github.com/ajouve "ajouve (1 commits)")[![wolfwolker](https://avatars.githubusercontent.com/u/1926137?v=4)](https://github.com/wolfwolker "wolfwolker (1 commits)")[![askumbhani66](https://avatars.githubusercontent.com/u/16553705?v=4)](https://github.com/askumbhani66 "askumbhani66 (1 commits)")[![dsas](https://avatars.githubusercontent.com/u/93301?v=4)](https://github.com/dsas "dsas (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ylsideas/feature-flags

A Laravel package for handling feature flags

6201.4M3](/packages/ylsideas-feature-flags)[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.7M12](/packages/php-ai-php-ml)[ssnepenthe/color-utils

A PHP library for performing SASS-like color manipulations.

631.1M10](/packages/ssnepenthe-color-utils)[wikimedia/at-ease

Safe replacement to @ for suppressing warnings.

1517.9M2](/packages/wikimedia-at-ease)[simplesamlphp/composer-module-installer

A Composer plugin that allows installing SimpleSAMLphp modules through Composer.

1310.4M160](/packages/simplesamlphp-composer-module-installer)[appsero/client

Appsero Client

25431.7k9](/packages/appsero-client)

PHPackages © 2026

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