How to Link an Image: A Step-by-Step Guide

To link an image, host the picture somewhere public, copy its image URL, and place that address where the image should appear. If the image must be clickable, add a separate destination URL around it.

What Does "Link an Image" Mean?

The phrase can describe three related tasks. Choosing the right one first prevents broken markup and wrong expectations:

  1. Create a direct image URL. You want an address that opens or returns the image file itself.
  2. Embed the image. You want an HTML or Markdown document to display a picture stored at another address.
  3. Make the image clickable. You want the picture to open a product page, article, profile, or download when someone clicks it.

The first task produces an image URL. The second uses that URL in an img or Markdown image element. The third needs both the image URL and a destination URL.

Step 1: Get a Direct Image URL

A local file such as holiday-photo.jpg exists only on your device, so other people cannot load it through the web. Upload the file to an image host that provides a public direct URL. A good result returns the image resource rather than an HTML page that merely contains it.

With Photo2URL's Image to URL tool, choose or paste an image and copy the generated direct URL. If you need a preview-page link for sharing, Image to Link creates that link while still providing the direct file address.

Step 2: Link to the Image

The simplest form of an image link is the direct URL itself. You can paste it into a browser address bar, a form that accepts an image address, a bookmark, or a chat message.

https://cdn.example.com/images/holiday-photo.jpg

This is an image URL. Calling it an image link is common and usually understood, but the distinction matters when a platform asks separately for an image address and a click destination.

Step 3: Make an Image Clickable in HTML

A clickable image uses two elements. The inner img element loads the picture, and the outer a element opens the destination:

<a href="https://example.com/products/chair">
  <img
    src="https://cdn.example.com/images/chair.jpg"
    alt="Oak dining chair"
  />
</a>

The href value is where the click goes. The src value is the image that visitors see. Swapping those values is one of the most common causes of a broken clickable image.

For a complete walkthrough of anchor attributes, accessibility, external links, and responsive styling, read the HTML image link guide. If you already have both URLs and want the markup generated, use the HTML Image Link Generator.

Step 4: Add an Image Link in Markdown

Markdown has a compact image syntax. An exclamation mark tells the renderer to display an image:

![Team meeting](https://cdn.example.com/images/team.jpg)

That embeds the picture. To make the image clickable, place the image syntax inside the square brackets of a normal Markdown link:

[![Team meeting](https://cdn.example.com/images/team.jpg)](https://example.com/team)

My own path into Markdown image links started with GitHub. I use GitHub to preserve projects and past experiences even though I am not a programmer. When I began adding images to Markdown documents, I first tried Base64 because it kept the image data inside the file. The result was cumbersome to read, edit, and reuse. A hosted image URL proved much more practical. Photo2URL gave me the direct address and Markdown snippet I needed, so I could place the image in a README or project note without managing a long encoded string.

The Markdown Image Link Generator produces the image portion automatically after an upload. For a fuller explanation of the format, see image URL vs image link.

Quick Selection Guide

GoalWhat you needTypical format
Share the picture itselfDirect image URLhttps://cdn.example.com/image.jpg
Display the picture on a pageDirect image URL<img src="image-url">
Open another page on clickImage URL plus destination URL<a href="page"><img src="image"></a>
Embed in MarkdownDirect image URL![alt](https://...)

How to Test an Image Link

  1. Open the image URL directly. The browser should display the image without a gallery or article around it.
  2. Load the page or document that contains the embed. Check that the picture appears instead of a broken-image icon.
  3. Click the picture if it should be clickable. Confirm that the destination URL opens the expected page.
  4. Check the result on a narrow screen. Wide images should shrink instead of pushing the surrounding layout off the page.

Common Image-Linking Mistakes

  • Using a page URL as the image source. An img element expects an image resource, not an HTML gallery page.
  • Reversing href and src. The destination and the displayed picture serve different purposes.
  • Leaving alt text empty when it carries meaning. Descriptive alt text helps screen-reader users understand the linked image.
  • Linking to a private or expiring file. The image must remain publicly accessible for the link to keep working.
  • Ignoring copyright. A public URL does not by itself grant permission to reuse the picture.

Which Method Should You Use?

Use a direct URL when you only need to share the picture or give another system an image address. Use HTML when a webpage needs a clickable image. Use Markdown for READMEs, documentation, blogs, and notes that render Markdown.

If you still need to host the file, start with the image to URL guide or upload it directly in the Image to URL tool.

Frequently Asked Questions

Is linking an image the same as uploading an image?

No. Uploading stores the image on a web server. Linking uses the resulting public address so a browser, document, or app can load the image from that server.

How do I make an image a link?

Put an img element inside an anchor element. The src attribute of the image points to the picture, while the href attribute of the anchor points to the page that should open when someone clicks it.

Where do I get an image URL?

Use an image hosting service that exposes direct public links. Photo2URL's Image to URL tool accepts an upload and returns a direct URL, Markdown syntax, and an HTML img tag.

What is the difference between the image URL and the destination URL?

The image URL identifies the picture that visitors see. The destination URL identifies the page, product, profile, or file that opens after the image is clicked.

How do I add an image link in Markdown?

Use ![alt text](image-url) to display an image. To make that image clickable, wrap the image Markdown in a link: [![alt text](image-url)](destination-url).

Can I link directly to an image on another website?

Only when the image is publicly accessible and the site permits external display. Authentication, expiring URLs, hotlink protection, and copyright rules can limit or prohibit that use.

Does the alt attribute go on the link or the image?

Put alt text on the img element because it describes the picture. If the image is the only content inside a link, the alt text normally becomes the link's accessible name as well.

Ready to create an image link?

Upload an image to get a direct URL plus copy-ready HTML and Markdown versions.

How to Link an Image: Direct URL or Clickable Link