Converts HTML to formatted plain text

Installs: 5 487 834

Dependents: 61

Suggesters: 1

Security: 0

Stars: 421

Watchers: 25

Forks: 146

Open Issues: 15

4.3.1 2020-04-16 23:44 UTC

This package is not auto-updated.

Last update: 2020-09-18 18:33:18 UTC


A PHP library for converting HTML to formatted plain text.

Build Status


composer require html2text/html2text

Basic Usage

$html = new \Html2Text\Html2Text('Hello, &quot;<b>world</b>&quot;');

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


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.