User Rating 0.0
Total Usage 0 times
Input (BBCode)
Ready
Is this tool helpful?

Your feedback helps us improve.

About

Legacy forums and bulletin boards often rely on Bulletin Board Code (BBCode), a lightweight markup language designed to be safer than raw HTML. However, migrating content to modern Content Management Systems (CMS) or preserving archived threads often requires converting this markup into standard semantic HTML5.

This tool performs a rigorous transformation process. It does not simply replace strings; it employs a Guard Pattern algorithm. First, it isolates [code] and [noparse] blocks to prevent corruption of technical data. Then, it iterates through formatting tags (like b, i, url) using non-greedy Regular Expressions. Finally, it sanitizes the output to ensure the generated HTML is safe for rendering.

Note: While this converter handles standard nesting, malformed BBCode (e.g., overlapping tags like [b][i]...[/b][/i]) depends on the browser's HTML correction engine for the final preview rendering.

bbcode html converter forum tools markup parser developer tools

Formulas

The transformation logic follows a sequential substitution model, defined as:

HTML(x) = Sanitize(Restore(Parse(Guard(x))))

Where the Guard function protects code blocks:

{
tokeni if x [code] blockx otherwise

And the Parse function applies regex mappings, e.g., for bold text:

s/[b](.*?)[/b]/<strong>$1</strong>/g


Legend:

  • x = Input String (Raw BBCode)
  • Guard = Extraction of immutable blocks
  • Parse = Recursive application of regex rules
  • Restore = Re-insertion of guarded blocks

Reference Data

BBCode TagHTML EquivalentDescription
[b]Text[/b]<strong>Text</strong>Bold text emphasis
[i]Text[/i]<em>Text</em>Italic text emphasis
[u]Text[/u]<span style="text-decoration:underline;">...</span>Underlined text
[s]Text[/s]<del>Text</del>Strikethrough text
[url=https://x.com]Link[/url]<a href="https://x.com">Link</a>Hyperlinks
[img]src.jpg[/img]<img src="src.jpg" />Images
[quote]Text[/quote]<blockquote>Text</blockquote>Block quotes
[code]var x = 1;[/code]<pre><code>var x = 1;</code></pre>Code blocks (preserved)
[list][*]Item[/list]<ul><li>Item</li></ul>Unordered Lists
[size=20]Text[/size]<span style="font-size:20px">...</span>Font sizing
[color=#FF0000]Text[/color]<span style="color:#FF0000">...</span>Text coloration

Frequently Asked Questions

Yes. The parser supports standard nesting, such as [b][i]bold and italic[/i][/b]. However, extremely complex or broken nesting (e.g., [b][i]text[/b][/i]) relies on the browser's fault tolerance to render correctly in the preview.
We use a "Guard" algorithm. Before processing formatting tags like bold or italic, the system identifies [code] blocks and replaces them with a temporary placeholder token. This ensures that code snippets containing [b] or [i] characters are not accidentally formatted.
The "Raw HTML" output is a direct translation of your input. If you plan to render this HTML on a website, you must sanitize it. Our "Preview" pane uses DOMPurify to strip malicious scripts, but the code in the text box is raw.
Yes, by default, single line breaks are converted to
tags to preserve the visual structure of forum posts. Double line breaks are often interpreted as paragraph breaks depending on the context.