Skip to content
Tezmy Tools

BBCode to Pug Converter

Turn forum BBCode into a Pug (Jade) template

7 BBCode tags converted, 14 lines of Pug

Runs in your browser. Nothing is uploaded.

About the BBCode to Pug Converter

Forum posts, old blog engines and chat systems store text as BBCode, with tags such as [b], [url] and [quote] in square brackets. If you are moving that content into a site built with Pug, formerly Jade, you need it as Pug lines instead. This tool reads the BBCode, understands how the tags nest, and writes the matching Pug: each tag becomes an indented line, links keep their address, quotes become a blockquote, and lists become ul with li lines. Choose spaces or tabs for the indentation and decide whether line breaks become br tags. It runs in your browser, so a private post is never uploaded.

Updated October 2026

How to use the BBCode to Pug Converter

  1. 1Paste the BBCode in the left box.
  2. 2Choose the indentation and whether line breaks become br lines.
  3. 3Read the Pug on the right. The line under it shows how many BBCode tags were converted.
  4. 4Copy the Pug or download it as post.pug.

A quick example

The BBCode [b]Hello[/b] and [url=https://example.com]a link[/url] becomes two lines of Pug: one line for strong with the text Hello, and one for a link with its href and its rel attribute.

  • [b]text[/b] gives strong text
  • [i]text[/i] gives em text
  • [url=address]text[/url] gives a(href='address', rel='nofollow noopener') text
  • [list][*]One[*]Two[/list] gives ul with two li lines
  • [quote=Sam]Hi[/quote] gives blockquote with a cite line and the quote

Moving a forum into a Pug site

A typical migration exports posts from a database, runs each one through a converter, and saves the result as templates or as content in a data file. Convert a few posts first and view them next to the original, then adjust the options to match. Pay attention to the images and the links, because they carry the attributes that are easiest to get wrong.

For many posts, run the conversion in a script with the Pug package after reviewing a sample here. The result you see on this page shows what the structure should look like.

Tags that need a decision

  • [size] and [color] have no direct Pug form, so they become a span with a style attribute.
  • [spoiler] becomes a details block with a summary line, which browsers fold and unfold without any script.
  • [code] becomes a pre block that keeps the text exactly, with no BBCode read inside it.
  • [table] becomes table, tr, td and th lines. Check the header row.

Indentation and spacing

Pug depends on indentation. This tool writes two spaces per level by default, and you can pick four spaces or tabs. Use the same choice for every file in your project.

Pug writes each inline tag on its own line and does not add a space between a tag and the text beside it. Check sentences that mix bold words or links with plain text after you convert them, and add a space inside a | text line where one is missing.

Phone and computer

The two boxes sit side by side on a computer and stack on a phone. The Copy and Download buttons appear under the result. BBCode is a forum format, so the result may need a little tidying before it goes into a template. Use the BBCode Converter if plain HTML is enough, and the Pug to HTML Converter to check how the new template renders. The Markdown to HTML Converter is useful when your source text is Markdown instead.

Features

  • Bold, italic, underline, strike, sub and sup
  • Links with rel attributes, email links and images
  • Quotes, lists, code, headings and tables
  • Correct nesting, even for tags inside quotes or lists
  • Spaces or tabs, and line breaks as br or as plain text
  • Unknown tags stay as text instead of disappearing

Frequently asked questions

How does the conversion work?

The BBCode is first read into a tree of tags and text, written as HTML, and then written again as Pug. Because of the tree, nesting such as [quote][b]text[/b][/quote] comes out with the right indentation.

Which BBCode tags are understood?

b, i, u, s, strike, url, email, img, size, color, quote, code, list with [*] items, center, left, right, h1 to h3, hr, spoiler, table with tr, td and th, sub and sup. Other tags stay in the text as typed.

Why does a link have rel="nofollow noopener"?

Links in user posts are marked so search engines do not pass credit to them and the target page cannot control the page that opened it. Remove the attribute from the Pug if the links are your own.

What happens to an unclosed tag?

It is closed at the end of the text, the way most forum software does. A closing tag with no opening tag is kept as text.

Do line breaks stay?

By default each line break becomes a br line, because BBCode shows line breaks as they are typed. Untick the option if your Pug template handles spacing with CSS.

Is the spacing between words and tags kept?

Pug writes each tag and each piece of text on its own line and does not add a space between neighbours. If you see two words run together next to a tag, add a space at the end of the text line, or use a | line with the space in it.

Can I convert it to HTML instead?

Yes. Our BBCode converter writes HTML, Markdown or plain text, and our Pug to HTML tool turns Pug back into markup.

Is my text uploaded?

No. It is converted in your browser and never leaves your device.

Related tools