Image link code: HTML, Markdown and BBCode examples

Image link code embeds a publicly accessible image in a webpage, document or forum post. Use HTML for a website, Markdown for a README or note, and BBCode for a forum that supports it. The syntax changes, but each format needs a direct image URL.

First, get a public image URL

A direct image URL returns the image itself, not a sharing page or a local file path. Open it in a private browser window to check that it works without your login. The example.com URLs below are placeholders, not real user images: replace them before publishing.

HTML: display an image

Put the direct image URL in src and a short description in alt. The alt text provides a text alternative; it is not the image filename. Paste this into an HTML editor or a page that permits HTML.

<img src="https://example.com/images/lake.jpg" alt="A mountain lake at sunrise">

HTML: make the image clickable

Wrap the img element in an anchor. The href is the destination page visitors open when they click; src remains the image URL. These two addresses serve different purposes.

<a href="https://example.com/article">
  <img src="https://example.com/images/lake.jpg" alt="A mountain lake at sunrise">
</a>

Markdown: embed an image in a document

The exclamation mark makes this an image. Without it, [text](URL) creates an ordinary link. Put meaningful alternative text between the square brackets and the image URL in parentheses. Use the Markdown editor to preview the result before publishing.

![A mountain lake at sunrise](https://example.com/images/lake.jpg)

BBCode: embed an image in a forum

Put the image URL between [img] and [/img]. This works only where the forum enables BBCode images. Some forums use Markdown or a rich-text editor instead; check their posting instructions if the tags appear as plain text.

[img]https://example.com/images/lake.jpg[/img]

Upload once and copy the matching format

  1. Open the free image hosting uploader and select an image.
  2. After the upload completes, click the uploaded image to open its preview. In the preview, choose Direct Link, HTML, Markdown or BBCode and copy the result. You do not have to write the basic code yourself.
  3. Paste it into the matching editor and preview. For a clickable HTML image, add the destination anchor shown above; edit the alternative text to describe your own image.

Free uploads allow 5MB per image; Pro allows 32MB. Images are retained permanently unless you delete them. Generated URLs are publicly accessible: anyone with the URL can view the image. Deleting an image breaks its existing embeds. The desktop client is not available yet; use the website.

If the image does not appear

Check that the URL opens the image without signing in, is not a local file path, and has not been deleted. Keep the brackets and quotes intact, use HTTPS on HTTPS pages, and confirm the editor accepts your chosen format. A URL does not have to end in .jpg or .png to return an image.

For more on choosing the address, read image to URL. To embed images in notes or documentation, try the Markdown editor.