Skip to content
PictureToLink logoPictureToLink
Menu
Image Sharing

BBCode IMG Tags: 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 Mudasir Ahsan (Founder) · · Updated · 7 min read
Facts checked against official sources on

On this page

To post a picture on a forum, put its direct URL between BBCode img tags: [img]https://example.com/photo.jpg[/img]. That's the whole tag. The URL has to point at the image file itself and be open to anyone on the internet, so a photo that's only on your computer needs uploading somewhere first. Two more jobs come up often. Wrap the tag in [url] to make the picture clickable, and resize the file before you upload it, because most forums have no size option inside the tag.

Hands typing on a laptop keyboard Photo: Szabó Viktor on Pexels

What BBCode is, and why forums use it

BBCode (Bulletin Board Code) is the formatting language most forum software gives members in place of HTML. Tags sit in square brackets and usually come in pairs, such as [b]bold text[/b], [i]italic text[/i] and [url]...[/url]. When the forum displays your post, it turns them into safe HTML.

"Safe" is the reason it exists. Raw HTML would let any member inject scripts, break the page layout or track readers. BBCode offers a small set of tags instead, and administrators decide which ones are switched on.

There's 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 the same everywhere.

The [img] tag

Every major forum package uses the same pattern:

[img]https://picturetolink.com/i/abc123.jpg[/img]

Posting that uploads nothing. The forum stores your text, and when someone opens the thread it turns the tag into an image in the page, with your URL as the source. Each reader's browser then fetches the picture from that address by itself. Everything the URL needs follows from that.

It has to be a direct link to the image file, the kind that usually ends in .jpg, .png, .gif or .webp. A link that opens a web page with menus, comments or ads around the picture is a page link. Inside [img] it hands the browser a page where a picture was expected, so it won't work.

HTTPS comes next. Most forums are served over HTTPS. Browsers can block or refuse to load plain http:// images on secure pages.

And it must be public. A link that needs a login, such as a private cloud folder, shows as broken for everyone else.

phpBB's BBCode guide puts the first rule in its own words: the image "must already be available on the internet (it cannot exist only on your computer...)". It also warns that many readers don't appreciate lots of images in posts. Fewer pictures load faster and go down better.

Your picture has to be hosted first if it's on your phone or computer. With PictureToLink:

  1. Open the image uploader and drop in your picture (JPG, PNG, WebP, GIF, AVIF or iPhone HEIC, up to 25 MB). You don't need an account.
  2. In the link menu, choose BBCode (forums). You get the complete tag, ready to paste: [img], the direct link and [/img].
  3. Paste it into your forum post and preview it before you submit.

Uploads are compressed automatically. Location data and other metadata are removed too. On a public forum that matters, because anyone can save your image. Our link formats guide explains the other formats and where each one works.

Clickable thumbnails with [url][img]

An [img] tag inside a [url] tag turns the image into 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. The [url=...] part is where a click takes them. PictureToLink's BBCode linked format writes this for you, with the image linked to its share page so readers can open it on its own.

PictureToLink after an upload: the direct image URL with a Copy link button

The uploader hands you the link; the BBCode version sits in the format menu next to it.

That format links a picture to itself. A true thumbnail is a small image that links to a big one, so the thread shows a quick-loading preview and readers can click through to the full-resolution version. It takes two uploads.

  1. Upload the full-size picture and copy its Share page link.
  2. Upload the same picture again with Resize set to Small (the 800 px option), and copy its Direct link.
  3. Put the small direct link inside [img] and the full-size share page inside [url=...].

How do I resize an image in BBCode?

On most forums you can't. Resize the file instead.

MyBB is the exception among the big three packages. Its MyCode documentation lists a size option, [img=100x33]...[/img], which displays the image at 100 by 33 pixels. That page belongs to 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. XenForo's BB code help page describes [IMG] as "Display an image, using the wrapped text as the URL", again with no size option.

People reach for a size option hoping a heavy picture will load faster. It won't. A size option only changes how big the image appears, and readers still download the full file. A 4000-pixel photo squeezed into a 600-pixel box loads just as slowly as one shown at full size.

Shrinking the file before you post works on every forum. 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.

The saving is large. 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 180 KB (89% smaller). Every reader of the thread downloads that 180 KB file, not the 1.6 MB original.

Forum software differences (phpBB, XenForo, MyBB)

phpBBXenForoMyBB
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 tagNot in the official guideNot 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 referencephpBB BBCode guideXenForo BB codesMyBB MyCode

XenForo writes its tags in capitals in its examples. Any forum can add custom tags or switch standard ones off, so the help or "BBCode" link on the forum you're posting to has the final word.

Attachments vs hosted images

If the forum lets you attach images, attach them. An attachment sits on the forum's own server, so the image lives as long as the post does. A hosted image depends on a second site keeping the file, and that includes ours: PictureToLink removes an image after 12 months without a single view.

Hosting still makes sense in three cases. Attachments may be switched off, the forum's attachment limit may be too small, or you may want the same image on several forums or sites.

Why is my BBCode image not showing?

A broken image icon, an empty box or the raw tag text can each have several causes. Check them in this order.

Start with the link. A page link used in place of a direct link is by far the most common cause. Open the URL in a new tab. If a web page appears instead of the bare image, go back to the host and get the direct link.

Then read the tag. Look for a missing slash ([/img]) and for stray spaces inside the brackets. Check that [url] and [img] close in the right order as well. Inner tags close first. The end of the URL deserves a look too, because copying from some apps adds spaces, line breaks or tracking text after the file name. Pasting the URL into a browser by itself tests it. Should the link start with http://, switch to an https:// one if the host offers it.

Sometimes the tag is fine and the forum refuses it. Administrators can turn image tags off in some sections, for new members or in signatures. The editor toolbar usually hides the image button when that's the case.

What's left sits with the image host. Some sites don't allow their images to be shown on other websites, and the fix is to re-host the image somewhere that permits it. Many hosts also remove images after a while. On PictureToLink, images you set to auto-delete disappear at the time you chose, and others go after the 12 months without a view mentioned above. Format is the last suspect. HEIC photos from iPhones don't display in most browsers, so convert them to JPG first.

Our guide to broken image links has a longer checklist that covers websites and email as well as forums. If you also write on GitHub or in documentation tools, the equivalent syntax is in our guide to Markdown images. Reddit doesn't use BBCode either. Its formatting is based on Markdown, and pictures there are uploaded or posted as a link, as how to post images on Reddit explains.

Image Sharing

Broken Image Link? 9 Reasons Images Don't Show

Why images show as a broken icon or will not load, from expired links and hotlink blocks to wrong URLs and mixed content, and how to fix each one.

· 8 min read
Image Sharing

Markdown Image Syntax: READMEs and Docs

The Markdown image syntax with copy-ready examples, from alt text to sizing and GitHub README images, plus how to host the image file.

· 7 min read

Related calculators