BBCode Image Tags: How to Post Images on Forums
How the BBCode [img] tag works, how to resize and link images in forum posts, and why your image shows as a broken link, with copy-ready examples.
By PictureToLink Team · · 7 min read
Facts checked against official sources on
On this page
To post an image on a forum with BBCode, wrap the image's direct URL in img tags: [img]https://example.com/photo.jpg[/img]. The URL must point at the image file itself and be publicly reachable on the internet, so a photo on your computer has to be uploaded somewhere first. To make the image clickable, wrap the whole thing in a url tag, and to change its size, resize the file before you upload it, because most forums do not support a size option inside the tag.
What BBCode is
BBCode (Bulletin Board Code) is the simple formatting language most forum software uses instead of letting members type HTML. Tags sit in square brackets and usually come in pairs: [b]bold text[/b], [i]italic text[/i], [url]...[/url] and so on. The forum converts these tags into safe HTML when it displays your post.
Forums use BBCode because raw HTML would let any member inject scripts, break the page layout or track readers. BBCode gives members a small, safe set of formatting options, and administrators decide which tags are switched on.
There is no single official BBCode standard. phpBB, XenForo, MyBB, vBulletin and others all support the core tags, but their extras differ. The image tag is one of the few that behaves almost identically everywhere.
The [img] tag
The basic pattern is the same on every major forum package:
[img]https://picturetolink.com/i/abc123.jpg[/img]
phpBB's BBCode guide makes two points worth repeating: the image you show "must already be available on the internet (it cannot exist only on your computer...)", and many readers do not appreciate lots of images in posts. Keep both in mind and your posts will load faster and get a better reception.
What the URL needs to be:
- A direct link to the image file. It usually ends in
.jpg,.png,.gifor.webp. If opening the link in a browser shows a web page with menus, comments or ads around the picture, it is a page link and will not work inside[img]. - HTTPS. Most forums are served over HTTPS, and browsers can block or refuse to load plain
http://images on secure pages. - Public. Links that need a login (private cloud folders, for example) will show as broken for everyone else.
Getting a direct link for your image
If your picture is on your phone or computer, you need to host it first. With PictureToLink:
- Open the image uploader and drop in your picture (JPG, PNG, WebP, GIF or AVIF, up to 25 MB). No account is needed.
- In the link menu, choose BBCode (forums). You get the complete tag, ready to paste:
[img]plus the direct link plus[/img]. - Paste it into your forum post and preview before submitting.
Uploads are compressed automatically and have location data and other metadata removed, which matters on public forums where anyone can save your image. If you are unsure which of the link formats to use elsewhere, our guide to direct links, viewer links and embed codes explains each one.
Clickable thumbnails with [url][img]
Putting an [img] tag inside a [url] tag makes the image a link. phpBB's guide documents this exact pattern:
[url=https://picturetolink.com/v/abc123][img]https://picturetolink.com/i/abc123.jpg[/img][/url]
Read it from the inside out: the [img] part is what readers see, and the [url=...] part is where they go when they click. PictureToLink's BBCode linked format produces this for you, linking the image to its share page so readers can open it on its own.
A true thumbnail is a small image that links to a big one. To build one:
- Upload the full-size picture and copy its Share page link.
- Upload the same picture again, this time with Resize set to Small — 800 px, and copy its Direct link.
- Combine them: the small direct link goes inside
[img], the full-size share page goes inside[url=...].
Readers then see a quick-loading preview in the thread and can click through to the full-resolution version.
Resizing images in BBCode
This is where forum packages differ most:
- MyBB documents a size option in its MyCode documentation:
[img=100x33]...[/img]displays the image at 100 by 33 pixels. That page is from the MyBB 1.6 documentation, so check your forum's own BBCode help page to confirm it still works there. - phpBB shows only the plain
[img]tag in its BBCode guide, with no size option. - XenForo lists
[IMG]on its BB code help page as "Display an image, using the wrapped text as the URL", again with no size option.
Even where a size option exists, it only changes how big the image appears. Readers still download the full file. A 4000-pixel photo squeezed into a 600-pixel box is just as slow to load as one shown at full size.
The reliable method on every forum is to resize the file itself before posting. Around 800 to 1280 pixels wide is plenty for most forum layouts. On PictureToLink, pick a size under Resize before uploading. To make a smaller copy without uploading it anywhere, use the in-browser image compressor and set a maximum width.
Smaller files help everyone. When we ran our test photos through our own upload pipeline, resizing a 3024 × 2016 JPG to 1280 pixels wide and saving it as WebP cut it from 1.6 MB to 224 KB (86.1% smaller).
Forum software differences (phpBB, XenForo, MyBB)
| phpBB | XenForo | MyBB | |
|---|---|---|---|
| Image tag | [img]URL[/img] | [IMG]URL[/IMG] | [img]URL[/img] |
| Linked image | [url=LINK][img]URL[/img][/url] | [URL=LINK][IMG]URL[/IMG][/URL] | [url=LINK][img]URL[/img][/url] |
| Size option in the tag | Not in the official guide | Not on the official help page | [img=WIDTHxHEIGHT] (MyBB 1.6 docs) |
| Built-in attachments | [attachment=] tag, if the administrator allows attachments | [ATTACH] tag, thumbnail or [ATTACH=full] | [attachment=ID] for files attached to the same post |
| Official reference | phpBB BBCode guide | XenForo BB codes | MyBB MyCode |
XenForo writes its tags in capitals in its examples. Every individual forum can add custom tags or switch standard ones off, so the help or "BBCode" link on the forum you are posting to is always the final word.
Attachments vs hosted images
Many forums let you attach images directly, which keeps the image on the forum's own server. That is usually the better choice when it is available: the image lives as long as the post does. Hosted images make sense when attachments are switched off, when the forum's attachment limit is too small, or when you want to post the same image on several forums or sites.
Fixing images that will not show
If your post shows a broken image icon, an empty box or the raw tag text, check these in order:
- You used a page link, not a direct link. Open the URL in a new tab. If you see a web page rather than just the image, get the direct link instead. This is the most common cause by far.
- The tag is mistyped. Check for missing slashes (
[/img]), stray spaces inside the brackets, or a[url]and[img]closed in the wrong order. Inner tags close first. - The URL has extra text. Copying from some apps adds spaces, line breaks or tracking text after the file name. Paste the URL into a browser to test it on its own.
- The link uses http://. Switch to an
https://link if the host offers one. - The forum has image tags switched off. Administrators can turn off image tags in some sections, for new members or in signatures. The editor toolbar usually hides the image button when this is the case.
- The image host blocks embedding. Some sites do not allow their images to be shown on other websites. Re-host the image somewhere that permits it.
- The image was deleted or expired. Many hosts remove images after a time. On PictureToLink, images you set to auto-delete disappear at the time you chose, and others are removed after 12 months without a single view.
- The format is not supported. HEIC photos from iPhones do not display in most browsers. Convert them to JPG first.
For a longer checklist covering websites and email as well as forums, see our guide to broken image links. If you also write on GitHub or in documentation tools, the equivalent syntax is covered in our guide to Markdown images.
Next step
Upload your picture on the PictureToLink homepage, choose BBCode (forums) or BBCode linked from the link menu, paste the result into your post and use the forum's preview button to check it before you submit.
