User Rating 0.0
Total Usage 0 times
Supports all standard BBCode tags: [b], [i], [url], [quote], [list], [img], [code], [color], [size] and more.
Is this tool helpful?

Your feedback helps us improve.

About

BBCode (Bulletin Board Code) is a lightweight markup language used by most forum platforms - phpBB, vBulletin, SMF, XenForo - to allow users to format posts without raw HTML access. When migrating content between systems, archiving threads, or extracting readable text for indexing, raw BBCode becomes noise. Tags like [b], [url=...], and nested [quote] blocks obscure the actual content. This converter applies a multi-pass regex stripping engine that processes tags in dependency order: nested structures first, then inline formatting, then orphaned brackets. It preserves semantic content - URLs from link tags, alt-text structure from images, bullet items from lists - while discarding all markup syntax.

The parser handles edge cases that naive regex fails on: mismatched tags, nested quotes of arbitrary depth, malformed [color=...] attributes, and mixed-case tag names. Note: this tool approximates visual intent. BBCode that relies on CSS rendering (font size, color) loses that context in plain text. For content exceeding 500 KB, consider splitting input to avoid memory pressure in the browser tab.

bbcode text converter bbcode stripper plain text forum markup bbcode parser text formatting

Formulas

The converter applies a deterministic multi-pass regex pipeline. Each pass targets a specific tag category, processed in strict order to handle nesting correctly.

Pass 1: Nested structures → [quote], [list] (processed inside-out via greedy innermost match)

Pass 2: Semantic tags → [url=href]label[/url]label (href)

Pass 3: Media tags → [img], [youtube] → descriptive plain text with URL

Pass 4: Inline formatting → [b], [i], [u], [s], [color], [size], [font] → content only

Pass 5: Cleanup → strip remaining [tag] patterns via regex: \[\/?[a-zA-Z*]+(?:=[^\]]*)?\]

Pass 6: Normalize whitespace → collapse 3+ newlines to 2, trim leading/trailing space

Where href = the URL attribute value extracted via capture group, label = the inner text content of the tag, and all regex flags include gi (global, case-insensitive) to handle mixed-case BBCode variants like [B] or [URL].

Reference Data

BBCode TagSyntaxPlain Text OutputNotes
Bold[b]text[/b]textFormatting stripped entirely
Italic[i]text[/i]textFormatting stripped entirely
Underline[u]text[/u]textFormatting stripped entirely
Strikethrough[s]text[/s]textFormatting stripped entirely
URL (labeled)[url=http://x.com]Link[/url]Link (http://x.com)URL extracted and appended in parentheses
URL (bare)[url]http://x.com[/url]http://x.comURL preserved as-is
Image[img]http://x.com/pic.jpg[/img][Image: http://x.com/pic.jpg]URL preserved with marker prefix
Quote (attributed)[quote="User"]text[/quote]Quote (User): textAuthor extracted, content indented logically
Quote (bare)[quote]text[/quote]Quote: textGeneric prefix applied
Code[code]x = 1[/code]x = 1Content preserved verbatim
List (unordered)[list][*]A[*]B[/list]• A • BEach item gets bullet prefix
List (ordered)[list=1][*]A[*]B[/list]1. A 2. BSequential numbering applied
Color[color=red]text[/color]textColor attribute discarded
Size[size=18]text[/size]textSize attribute discarded
Font[font=Arial]text[/font]textFont attribute discarded
Align[center]text[/center]textAlignment tags stripped
Spoiler[spoiler]text[/spoiler][Spoiler: text]Content preserved with marker
Email[email][email protected][/email][email protected]Address preserved as-is
YouTube[youtube]dQw4[/youtube][Video: https://youtu.be/dQw4]ID expanded to short URL
Table[table][tr][td]A[/td][/tr][/table]AStructure stripped, content preserved
Horizontal Rule[hr]---Converted to text separator

Frequently Asked Questions

The parser uses an iterative inside-out strategy. It repeatedly matches the innermost [quote]...[/quote] pair (one with no nested quote inside), converts it to plain text with the "Quote:" prefix, then re-scans. This loop runs until no more [quote] tags remain. This correctly handles arbitrary nesting depth - a quote within a quote within a quote - without requiring a recursive regex engine, which JavaScript does not natively support in all environments.
The converter preserves both pieces of information. A tag like [url=https://example.com]Click here[/url] becomes "Click here (https://example.com)" in plain text. This ensures no link destination is silently lost during conversion, which matters for content auditing and archival.
Yes. The [code] tag is processed in Pass 1 before any whitespace normalization occurs. The inner content is extracted verbatim, preserving indentation, line breaks, and spacing exactly as authored. The final whitespace normalization pass (Pass 6) only collapses consecutive blank lines outside of code content.
Partially. Tags that open but never close (e.g., [b]text with no [/b]) will survive through Passes 1-4 and get caught by the generic fallback regex in Pass 5, which strips any remaining bracket-enclosed tag patterns. However, a bare closing tag like [/b] without an opener is also stripped. The output may have minor formatting artifacts in severely malformed input, but no tags will remain in the final text.
The tool caps input at 500 KB (~500,000 characters). Below that threshold, processing completes in under 50 ms on modern hardware. The regex engine operates in O(n) per pass with 6 total passes, giving O(6n) total complexity. Beyond 500 KB, some browsers may exhibit lag on the main thread. For very large forum database exports, consider splitting content into per-thread chunks.
List processing occurs in Pass 1, which extracts [*] items and prefixes them with bullet characters (• for unordered, sequential numbers for ordered). Any inline BBCode inside list items - such as [b]bold item[/b] - remains at this stage and gets stripped in Pass 4. The final output shows clean bullet-prefixed lines with no residual formatting tags.