BBCode explained
BBCode should not be confused with BBC.
BBCode ("Bulletin Board Code") is a lightweight markup language used to format messages in many Internet forum software. It was first introduced in 1998.[1] The available "tags" of BBCode are usually indicated by square brackets ([ and ]) surrounding a keyword, and are parsed before being translated into HTML.
Tags
| Example in HTML/CSS | BBCode | Output |
|---|
| bolded text[2] orbolded text | [b]bolded text[/b] | bolded text |
| italicized text oritalicized text | [i]italicized text[/i] | italicized text |
| underlined text orunderlined text | [u]underlined text[/u] | |
strikethrough text orstrikethrough text orstrikethrough text | [s]strikethrough text[/s] | strikethrough text |
| https://en.wikipedia.orgEnglish Wikipedia | [url]https://en.wikipedia.org[/url][url=https://en.wikipedia.org]English Wikipedia[/url] | https://en.wikipedia.org
English Wikipedia
|
 | [img alt="Example image" ]https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png[/img] | |
 | :) or [:-)]This would be another way to use the [img]url_img[/img] and must be pre-configured by the forum administrator. | |
quoted text (Usually implemented in more advanced ways.) | [quote]quoted text[/quote][quote="author"]quoted text[/quote](including optional author) | Using a Wikipedia template: |
<code>computer code</code> | [code]computer code[/code] | computer code |
monospaced text | [pre]monospaced text[/pre] | monospaced text |
| Large Text or Smaller Text | [style size="30px"]Large Text[/style][style size="85"]Smaller Text[/style]or[size="30px"]Large Text[/size][size="85"]Smaller Text[/size](The unit of measurement varies with each BBCode variant and could represent pixels, points, or relative HTML sizes.) | Large Text
Smaller Text
|
| Text in fuchsia orText in fuchsia | [style color="fuchsia"]Text in fuchsia[/style] or[style color=#FF00FF]Text in fuchsia[/style] or[color=#FF00FF]Text in fuchsia[/color](Both HTML color names and hexadecimal color values are generally supported, although on some boards, you must omit the # from selecting a hexadecimal color.) | Text in fuchsia |
- Entry 1
- Entry 2
| [list] [*]Entry A [*]Entry B[/list] [list=1] [*]Entry 1 [*]Entry 2[/list] Some message boards do not need the square brackets around the markers.[3]
(Many variants for li and /li, list types – unordered and ordered, with different bullets or counter formats – etc.)
|
- Entry 1
- Entry 2
|
| column header 1 | column header 2 |
|---|
| table cell 1 | table cell 2 |
| [table][tr] [th]column header 1[/th] [th]tcolumn header 2[/th][/tr][tr] [td]table cell 1[/td] [td]table cell 2[/td][/tr][/table](Some variants for thead, rules, etc.) | |
| Source:[4] | |
Implementation
BBCode is typically implemented by applying a series of regular expression string-replace operations upon the input. Because regular expressions are limited in analyzing the structure of text input, this has the artifact that any non-hierarchical BBCode input will be transformed into invalid non-hierarchical HTML without error.
Applying traditional parsing techniques is made difficult by ambiguities in the markup, such as in, where the input can either be interpreted as "text" quoted from someone called, or the bolded text "text" surrounded by and, i.e. [quote='''text'''[/quote].
See also
References
- Web site: BBCode history . www.bbcode.org . 21 February 2025.
- Web site: HTML Text Formatting. 2021-05-01. W3Schools.
- e.g. BOINC Project Forums et al.
- Web site: BBCode tags reference . www.bbcode.org . 12 January 2022.
External links