BBCode to HTML Converter

Parse square bracket forum markup into ordinary HTML you can paste anywhere.

BBCode
HTML
Runs locally in your browser

About the BBCode to HTML Converter

Migrating an old board, republishing an archive or rendering user posts outside the forum all end at the same problem: thousands of messages written in square brackets that a browser knows nothing about. This converter parses the markup properly, with a stack rather than a pile of regular expressions, so nested and overlapping tags come out as valid HTML instead of a tangle.

The mapping follows what forum software does. Emphasis tags become <strong> and <em>, [list] becomes an unordered list while [list=1] and [list=a] become ordered lists with the matching type, [quote=name] gains a <cite> line, and [code] keeps its whitespace inside <pre><code>. Everything else is escaped on the way through, so a post containing a stray angle bracket cannot inject markup into your page.

Attribute values are checked rather than trusted. A [url] pointing at a javascript scheme is dropped and its label survives as plain text, a [color] that is not a hex value, a named colour or an rgb function is ignored, and [size] is clamped so nobody sets 400 pixel type. Turn on the nofollow option when the posts came from strangers. Unknown tags are left visible by default, which makes it easy to spot the custom tags a particular board added, or removed entirely if you would rather they vanished. For a rendered picture instead of source, use the BBCode Viewer.

How to use

  1. Paste one post, or a whole archive of them, into the left pane.
  2. Decide whether blank lines should become <br> tags, which is what most boards do.
  3. Choose whether unknown tags stay visible or are stripped out, then press Convert.
  4. Tick Wrap in a full page if you need a standalone file rather than a fragment.

Common questions

Does the converter handle nested quotes?
Yes. Quotes inside quotes nest as blockquote elements to any depth, and a quote left unclosed is closed at the end of the post rather than swallowing the rest of it.
What happens to smilies and custom board tags?
They are treated as plain text by default. Set the unknown tag option to Remove if you want them deleted rather than shown.
Is the output safe to render on my site?
Text is HTML escaped, links are limited to http, https, mailto, ftp, tel and relative paths, and styles are restricted to colour, size and font family. Server side sanitising is still worth keeping.
How do I go back from HTML to BBCode?
Press Swap, which opens the HTML to BBCode converter carrying this output across as its input.