How to Convert BBCode to HTML and Back for Forums
Convert forum posts between BBCode and HTML safely: supported tags, quotes and code blocks, custom forum tags, and how to avoid script injection.

How to Convert BBCode to HTML and Back for Forums
BBCode is the formatting language of classic forums. It uses square-bracket tags such as b for bold, url for links and quote for quotations, and it has survived for more than twenty years because it is simple for members and easy for forum software to control. Sooner or later, though, content has to cross between BBCode and HTML: a blog post shared on a forum, a forum archive turned into a website, or a migration to a newer platform. This guide covers how the conversion works, what to watch for and how to do it with the free BBCode and HTML Converter.
Why not search and replace?
Replacing [b] with a strong tag looks easy, but real posts are messier. Tags are nested, sometimes left open, sometimes closed in the wrong order. Code blocks contain brackets that must not be interpreted. Lists use a star tag that has no closing tag. And forum content written by strangers can contain hostile input: a url tag with a javascript address, or a colour value that tries to inject extra styles. A converter has to parse the post into a tree, close tags properly and write only safe output.
Supported tags
The converter handles the tags shared by phpBB, vBulletin, XenForo, SMF and MyBB: bold, italic, underline and strike; subscript and superscript; links and email links; images with an optional size; quotes with the quoted author; code blocks with an optional language; ordered and unordered lists; colour, size and font; left, centre, right and justified alignment; tables; horizontal rules; spoilers; and YouTube links.
Going from HTML to BBCode, strong and b become bold, em and i become italic, blockquote with a cite becomes a quote with the author, pre and code become a code block, lists become list tags, and spans with colour or font size become colour and size tags. Headings, which most forums lack, become bold text inside a size tag.
Step by step
- Choose the direction: BBCode to HTML or HTML to BBCode.
- Paste the post. In BBCode mode the toolbar wraps the selected text in a tag, which is handy on a phone.
- Choose whether new lines become br tags, whether spoilers use details and summary, and whether YouTube links become privacy-enhanced embeds.
- Check the preview and the notes. Unknown tags and HTML elements without a BBCode equivalent are listed.
- Copy or download the result. Swap sends the result back as input, which is a quick way to check a round trip.
Custom forum tags
Many forums add their own tags, for example a heading tag or a highlight tag. Map them under Custom tags to an HTML element, and optionally to an attribute that receives the tag's value. For safety, mappings are limited to text elements such as headings, mark, abbr and kbd, and to harmless attributes such as title and lang. Anything else is written as a plain span.
Safety rules worth copying
The converter only writes link and image addresses that start with http, https, mailto or a relative path, so javascript addresses end up as plain text. Colours must be a name or a hex code. All text is escaped, and script and style elements are removed when converting from HTML. If you build your own forum import, apply the same rules, and still run a proper HTML sanitiser on the server for anything users submit.
Migration tips
Convert a sample of old posts first and compare them side by side with the originals. Pay attention to quotes nested inside quotes, code blocks with brackets inside, and custom tags from plugins. Collect the unknown tags the notes report, map them, and only then convert the full archive.
Privacy
Everything runs in your browser. Posts and settings are kept only in local storage on your device.



