User Rating 0.0
Total Usage 0 times
0 characters
0 characters
Is this tool helpful?

Your feedback helps us improve.

About

BBCode remains the dominant markup language across legacy forum platforms (phpBB, vBulletin, SMF, XenForo). Writers who draft in Markdown face a manual rewriting burden when posting to these systems. Incorrect conversion loses formatting: broken nested lists collapse into flat text, mismatched tags produce rendering artifacts, and unescaped code blocks leak raw syntax into posts. This converter implements a multi-pass regex tokenizer that processes block-level elements (headers mapped to size tags, fenced code to code blocks, ordered and unordered lists to list structures) before inline elements (bold, italic, strikethrough, links, images). Code blocks are extracted into placeholders before any transformation pass, preventing inner content from being parsed as Markdown. The tool handles nested lists up to 4 levels, GFM-style tables converted to BBCode table tags, and reference-style links.

Limitations: BBCode has no standard specification. Tag support varies by forum software. This tool targets the common subset recognized by phpBB, vBulletin, and XenForo. Tags like [table] may not render on all platforms. Horizontal rules have no BBCode equivalent and are approximated with a text separator. Inline HTML within Markdown is stripped. Test output on your target forum before bulk-posting.

markdown bbcode converter text formatting markup forum syntax converter

Formulas

The converter applies a deterministic transformation pipeline. Each Markdown token class maps to a BBCode tag via pattern substitution. The processing order is critical to avoid conflicts between block and inline patterns.

convert(md) extractCodeBlocks convertBlocks convertInlines restoreCodeBlocks = bbcode

Where md is the raw Markdown input string, extractCodeBlocks replaces fenced and indented code with indexed placeholders (%%CODE_n%%), convertBlocks processes headers, blockquotes, lists, tables, and horizontal rules via regex, convertInlines handles bold, italic, strikethrough, links, images, and inline code, and restoreCodeBlocks reinserts the original code content wrapped in [code] tags.

Header mapping: hn size = 8 n for n {1, 2, 3, 4, 5, 6}

Where n is the heading level (1 - 6) and the resulting BBCode size value ranges from 7 down to 2. Each heading is additionally wrapped in [b] tags for visual weight.

Regex priority (high → low): fenced_code > blockquote > table > heading > hr > list > image > link > bold > italic > strike > inline_code

Reference Data

Markdown SyntaxBBCode OutputNotes
# Heading 1[size=7][b]...[/b][/size]Largest size tier
## Heading 2[size=6][b]...[/b][/size]Second tier
### Heading 3[size=5][b]...[/b][/size]Third tier
#### Heading 4[size=4][b]...[/b][/size]Fourth tier
**bold**[b]bold[/b]Also __bold__
*italic*[i]italic[/i]Also _italic_
~~strike~~[s]strike[/s]GFM extension
`inline code`[code]inline code[/code]Single backticks
```code block```[code]...code...[/code]Fenced blocks preserved verbatim
[text](url)[url=url]text[/url]Inline links
![alt](src)[img]src[/img]Alt text is dropped (no BBCode equiv)
> quote[quote]quote[/quote]Multi-line supported
- item[list][*]item[/list]Unordered list
1. item[list=1][*]item[/list]Ordered list
---―――――――――No BBCode HR; text approximation
| A | B |[table][tr][td]A[/td][td]B[/td][/tr][/table]GFM tables; not all forums support
\n\nDouble newlineParagraph break preserved
Nested **_bold italic_**[b][i]bold italic[/i][/b]Proper nesting order maintained

Frequently Asked Questions

BBCode's [list] tag does not natively support nesting on most forum platforms. The converter flattens nested Markdown lists into a single-level [list] structure because nested [list] tags inside [*] items cause rendering failures on phpBB and vBulletin. If your target forum supports nested lists (e.g., XenForo 2.x), you may need to manually add inner [list] tags to the output.
The converter outputs [table][tr][td]...[/td][/tr][/table] structure, which is supported by XenForo and some vBulletin installations. If your forum lacks table support, the tags will render as plain text. In that case, consider converting the table to a fixed-width [code] block manually, or use spaced plain text with [font=monospace] for alignment.
No. The converter handles inline links [text](url) and bare URLs only. Reference-style links ([text][id] with [id]: url elsewhere) require a two-pass resolution that is not implemented. Convert reference links to inline format before using this tool.
Inline HTML (e.g., <br>, <div>, <span style="...">) is stripped during conversion. BBCode forums do not interpret HTML, and leaving raw tags in the output would display them as visible text. Remove or replace HTML with Markdown equivalents before converting.
The converter maps Markdown heading levels 1 through 6 to BBCode [size=7] through [size=2]. BBCode size values are not standardized: phpBB interprets them as point sizes, vBulletin uses a 1-7 scale, and XenForo uses pixel values. Test a sample heading on your target platform and adjust the size numbers in the output if needed.
No. This is a one-directional converter (Markdown → BBCode). Reverse conversion requires a different parser because BBCode tag semantics are ambiguous (e.g., [size=5] has no single Markdown heading equivalent). A separate BBCode-to-Markdown tool would be needed.