PHPackages                             3f/converter - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. 3f/converter

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

3f/converter
============

A set of classes to translate a text from HTML to BBcode and from BBCode to Markdown.

1.5(8y ago)29148.7k↓20.5%9[3 issues](https://github.com/dedalozzo/converter/issues)Apache-2.0PHPPHP &gt;=5.4.0

Since Feb 25Pushed 5y ago4 watchersCompare

[ Source](https://github.com/dedalozzo/converter)[ Packagist](https://packagist.org/packages/3f/converter)[ Docs](http://github.com/dedalozzo/Converter)[ RSS](/packages/3f-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/c62ec4ab1517472c5b2655021c6ad708a3d845ad5cc3f57fb54fabf726afac7e/68747470733a2f2f706f7365722e707567782e6f72672f33662f636f6e7665727465722f762f737461626c652e706e67)](https://packagist.org/packages/3f/converter)[![Latest Unstable Version](https://camo.githubusercontent.com/0dadfb73a11f2a8af6848cc2b0dab6806dbb4b21a9792f04bdbcca7e09f2f1cd/68747470733a2f2f706f7365722e707567782e6f72672f33662f636f6e7665727465722f762f756e737461626c652e706e67)](https://packagist.org/packages/3f/converter)[![Build Status](https://camo.githubusercontent.com/39e5d75adf5e6b649bf090c33e557fef7f610765239c899ed84b09879de220f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646564616c6f7a7a6f2f636f6e7665727465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dedalozzo/converter/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1626dea368c8e006bc79117bdca840b9b428fcbcd3ea7d3300e21453f2766759/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646564616c6f7a7a6f2f636f6e7665727465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dedalozzo/converter/?branch=master)[![License](https://camo.githubusercontent.com/5bcb459552ecabd4caa02ea0f82761bdf0387d0ddf037bc0976ec12b619e0085/68747470733a2f2f706f7365722e707567782e6f72672f33662f636f6e7665727465722f6c6963656e73652e737667)](https://packagist.org/packages/3f/converter)[![Total Downloads](https://camo.githubusercontent.com/c9fa1220fe8e1e6c5e187515f3b59fb8488ed394baca2f44ead92e36ae59586c/68747470733a2f2f706f7365722e707567782e6f72672f33662f636f6e7665727465722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/3f/converter)

Converter
=========

[](#converter)

A set of classes to translate a text **from HTML to BBCode** and **from BBCode to Markdown**.

The HTML to BBCode converter, in particular, has not been created with the intent to convert an entire HTML page, but just to convert a set of HTML tags used to format articles and blog posts in the HTML era, when Markdown and BBcode didn't exist at all.

The special BBCode to Markdown converter is able to convert: bold, italic, underline and strikethrough texts, lists, urls, images, quotes and even code blocks (snippets).

Composer Installation
---------------------

[](#composer-installation)

To install Converter, you first need to install [Composer](http://getcomposer.org/), a Package Manager for PHP, following these few [steps](http://getcomposer.org/doc/00-intro.md#installation-nix):

```
curl -s https://getcomposer.org/installer | php
```

You can run this command to easily access composer from anywhere on your system:

```
sudo mv composer.phar /usr/local/bin/composer
```

Converter Installation
----------------------

[](#converter-installation)

Once you have installed Composer, it's easy install Converter.

1. Edit your `composer.json` file, adding Converter to the require section:

```
{
    "require": {
        "3f/converter": "dev-master"
    },
}
```

2. Run the following command in your project root dir:

```
composer update
```

Usage
-----

[](#usage)

There are two classes: `HTMLConverter` and `BBCodeConverter`. The first class may be used to convert from HTML to BBCode, while the second one is used to convert from BBCode to Markdown.

HTML to BBCode conversion:

```
$converter = new Converter\HTMLConverter($text, $id);
echo $converter->toBBCode();
```

BBCode to Markdown conversion:

```
$converter = new Converter\BBCodeConverter($text, $id);
echo $converter->toMarkdown();
```

In both cases the `$id` is optional. When provided is used in case an exception is raised during the conversion process.

Documentation
-------------

[](#documentation)

The documentation can be generated using [Doxygen](http://doxygen.org). A `Doxyfile` is provided for your convenience.

Requirements
------------

[](#requirements)

- PHP 5.4.0 or above.

Authors
-------

[](#authors)

Filippo F. Fadda -  -

License
-------

[](#license)

Converter is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92% 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 ~166 days

Recently: every ~205 days

Total

6

Last Release

3269d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/311248?v=4)[Filippo Fadda](/maintainers/dedalozzo)[@dedalozzo](https://github.com/dedalozzo)

---

Top Contributors

[![dedalozzo](https://avatars.githubusercontent.com/u/311248?v=4)](https://github.com/dedalozzo "dedalozzo (46 commits)")[![roni-estein](https://avatars.githubusercontent.com/u/8517475?v=4)](https://github.com/roni-estein "roni-estein (2 commits)")[![chellem](https://avatars.githubusercontent.com/u/570856?v=4)](https://github.com/chellem "chellem (1 commits)")[![mhatma](https://avatars.githubusercontent.com/u/4669145?v=4)](https://github.com/mhatma "mhatma (1 commits)")

---

Tags

bbcodebbcode-to-markdownconverterhtmlhtml-to-bbcodehtml-to-markdownmarkdownphpformatterhtmlconvertermarkdowntranslatorbbcode

### Embed Badge

![Health badge](/badges/3f-converter/health.svg)

```
[![Health](https://phpackages.com/badges/3f-converter/health.svg)](https://phpackages.com/packages/3f-converter)
```

###  Alternatives

[league/html-to-markdown

An HTML-to-markdown conversion helper for PHP

1.9k28.6M199](/packages/league-html-to-markdown)[pixel418/markdownify

The HTML to Markdown converter for PHP

196800.8k8](/packages/pixel418-markdownify)[texy/texy

Texy converts plain text in easy to read Texy syntax into structurally valid (X)HTML. It supports adding of images, links, nested lists, tables and has full support for CSS. Texy supports hyphenation of long words (which reflects language rules), clickable emails and URL (emails are obfuscated against spambots), national typographic single and double quotation marks, ellipses, em dashes, dimension sign, nonbreakable spaces (e.g. in phone numbers), acronyms, arrows and many others. Texy code can optionally contain HTML tags.

161838.9k15](/packages/texy-texy)[interaction-design-foundation/nova-html-card

A Laravel Nova card to display arbitrary HTML content

67731.2k3](/packages/interaction-design-foundation-nova-html-card)[kartik-v/yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0

88265.8k6](/packages/kartik-v-yii2-markdown)[wpreadme2markdown/wpreadme2markdown

Convert WordPress Plugin readme.txt to Markdown

9564.6k4](/packages/wpreadme2markdown-wpreadme2markdown)

PHPackages © 2026

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