HTML to BBCode Converter
Convert HTML markup to clean BBCode for forums and bulletin boards. Supports lists, images, and text formatting. Ideal for community managers.
About
Legacy bulletin board systems (forums) like phpBB, vBulletin, and XenForo often rely on BBCode (Bulletin Board Code) rather than standard HTML to sanitize user input. Content creators and community managers moving content from blogs or CMS platforms to these forums face the tedious task of manually replacing angle brackets with square brackets. This tool automates that translation process.
The converter is designed to strip away invisible container tags like <div> or <span> that have no semantic meaning in a forum context, while rigorously preserving the structure of lists, the integrity of hyperlinks, and formatting like bold or italics. It ensures that your formatted post looks identical on the forum as it did in your editor.
Formulas
The logic relies on a recursive traversal of the DOM tree (Document Object Model). Unlike simple string replacement, this method respects nesting order.
Reference Data
| Element | HTML Input | BBCode Output |
|---|---|---|
| Bold Text | <b>Text</b> | [b]Text[/b] |
| Italic Text | <i>Text</i> | [i]Text[/i] |
| Underline | <u>Text</u> | [u]Text[/u] |
| Link | <a href="url">Link</a> | [url=url]Link[/url] |
| Image | <img src="url"> | [img]url[/img] |
| Quote | <blockquote>Text</blockquote> | [quote]Text[/quote] |
| Code | <code>var x</code> | [code]var x[/code] |
| List Item | <li>Item</li> | [*]Item |