HTML to BBCode Converter

Take formatted HTML and get square bracket markup a message board will accept.

HTML
BBCode
Runs locally in your browser

About the HTML to BBCode Converter

Forums almost never accept HTML from members, so sharing an article, a release note or a documentation snippet means rewriting it by hand in BBCode. This converter walks the parsed document and emits the bracket equivalent for each element, which turns a five minute retyping job into a paste.

Structure survives the trip. Paragraphs are separated by blank lines, <ul> and <ol> become [list] and [list=1] with one [*] per item, blockquotes become [quote] and carry their cite attribute across as the author name, and anchors become [url=...] with a mailto: address routed to [email] instead. Preformatted blocks keep their newlines inside [code], because indentation is usually the reason the snippet was worth posting.

Headings are the judgement call, since BBCode has no heading tag. The default writes them as bold text inside a [size] wrapper that steps down from six for an h1, which is what most boards render sensibly. Bold only is safer on forums with a restricted tag set, and Plain text suits boards that strip formatting from the first line of a post. Inline colour and font size are read out of style attributes when that option is on and dropped when it is off. Scripts, styles and hidden containers never make it into the output. Preview the result with the BBCode Viewer before posting.

How to use

  1. Paste the HTML. A fragment copied from the browser inspector works as well as a full page.
  2. Pick how Headings should be expressed, since BBCode has no heading tag of its own.
  3. Decide whether tables become [table] markup or plain rows, which some boards prefer.
  4. Press Convert, then paste the result into the forum reply box.

Common questions

Why did my CSS classes disappear?
BBCode has no class system. Only inline colour, size and font family can be expressed, and only when the style conversion option is enabled.
My board rejects [table]. What should I do?
Switch the Tables option to Plain rows. Each row becomes one line with pipe separated cells, which posts cleanly anywhere.
Are relative image paths fixed up?
No. A src of /img/logo.png is copied as written, so make the paths absolute in the HTML before converting if the forum sits on another domain.
What happens to nested lists?
Inner lists are flattened into the item they belong to, because many boards do not render a list inside a list item reliably.