How to Make a Picture a Clickable Link
How to make a picture a link in HTML or an email, with copy-ready code. If the image is only on your device, host it first; we show how.
By Mudasir Ahsan (Founder) · · Updated · 9 min read
Facts checked against official sources on
On this page
How to make a picture a link comes down to one move: put the image inside a link. In HTML, that's an img tag wrapped in an a tag. In an email, Google Docs or Word, select the picture and use the editor's Insert link command. A picture that's only on your phone or computer has to be uploaded first, so it has a public address to use as the image source.
Photo: MASUD GAANWALA on Pexels
A link to a picture, or a clickable picture?
"Make a picture a link" describes two different jobs.
In the first, you want a link to a picture. That's a URL for a photo, something to paste into a chat, a forum or a form so other people can open it. That makes the picture the destination. Our guide to getting an image URL on any device covers that job, and there's a 32-second video of the steps.
Our 32-second video: how to turn a picture into a link.
In the second, you want a clickable picture. You have a web page, email or document, and an image in it should take the reader somewhere: a logo that opens your homepage, a product photo that opens a shop page, a banner that opens a sign-up form. Now the picture is the button.
This article is mostly about the second job. Often the first is step one of it, though, because an image needs its own URL before it can appear on a web page or in an HTML email.
One point clears up most of the confusion. An image file can't carry a link. The link always sits in whatever surrounds the picture, and it stays there even when the picture is gone.
How do I make an image a link in HTML?
Put the img element inside an a (anchor) element.
<a href="https://example.com/shop">
<img src="https://example.com/images/product.jpg"
alt="Blue ceramic mug, 350 ml"
width="600" height="400">
</a>
Two addresses do two jobs in that code. The src on the image is where the picture loads from, and it has to be the direct address of the image file, so it should end in .jpg, .png, .webp and so on. The href on the anchor is where the click goes. In the example, the browser shows product.jpg on the page and opens the shop page when someone clicks the mug.
Don't skip width and height. They give the image's size in pixels, so the browser can reserve a 600 × 400 px space and the page does not jump while loading.
alt is the text read aloud by screen readers and shown if the image fails to load. For a linked image, describe where the link goes or what the image shows. A title attribute on the a tag adds a small tooltip on hover, but it doesn't replace alt.
To open the link in a new tab, add target="_blank" rel="noopener" to the a tag. If image tags are new to you, the guide to embedding an image in HTML explains src, alt and sizing in more depth.
Clickable images in Markdown and BBCode
README files and forums use the same idea with different markup. As in HTML, the image code sits inside the link code:
Markdown: [](https://example.com/page)
BBCode: [url=https://example.com/page][img]https://example.com/image.jpg[/img][/url]
There's more on writing images in Markdown and on forum image codes in their own guides. Reddit's formatting is based on Markdown as well, but pictures there are uploaded or posted as a link, and how to post images on Reddit has the steps.
How do I make a picture a link in an email?
Email editors hide the HTML, but the steps follow the same logic. Put the picture in the message body, select it, then add a link.
Gmail on a computer
- Open a new message and add the picture to the body. Google's help says you can add an image by dragging it directly into the compose window. It must sit inside the text area, not in the attachment strip at the bottom.
- Click the image to select it.
- Press Ctrl + K (Cmd + K on Mac), Gmail's shortcut for inserting a link, or click the link icon in the formatting bar.
- Paste the web address the picture should open and confirm.
- Send a test message to yourself and click the picture.
Outlook
Microsoft's help on creating a hyperlink says to select the text or picture you want to act as a link, then use Insert > Link. In a message:
- Insert the picture into the body (Insert > Pictures, or paste it).
- Click the picture once to select it.
- Choose Insert > Link, or right-click the picture and choose Link.
- Enter the address and select OK or Insert.
A picture link in an email has one weakness, whichever app you use. Many recipients' email programs block images from senders they don't know until they click "show images". Once the image shows, the link works. Put a plain text link nearby too, so nobody misses it.
How do I make a picture a link in Google Docs or Word?
Google Docs
- Insert the picture (Insert > Image).
- Click it to select it.
- Choose Insert > Link, as in Google's help on adding links in Docs, or press Ctrl + K (Cmd + K on Mac).
- Paste the address and click Apply.
Is Link greyed out? Then the picture is probably wrapped or floating. A Google Product Expert in the Docs community explains that links on images are only available when the image is set to "In line" with the text. Click the picture, pick the in-line option in the small toolbar under it, and try again.
Microsoft Word
Word is covered by the same Microsoft help page: select the picture, choose Insert > Link (or right-click it and pick Link), type the address and confirm. Hover over the picture to check it. Word shows the linked address in a tooltip. If you'll share the file as a PDF, export it after adding the links and test a click in the PDF as well.
Does the image need to be hosted online first?
For a web page, an HTML email, a Markdown file or a forum post, yes. Those hold only the picture's address, and a path like C:\Users\me\Pictures\logo.png exists only on your computer, so nobody else can load it. Word, Google Docs and an email you compose are different. There the image can live inside the document. A very small icon, say under 2 KB, can also sit inside a web page's code as a Base64 data URI. Keep that for tiny files, since Base64 makes them about 33% bigger.
Three kinds of place will give a picture on your device a public address. Your own website is the first: upload the picture through your site's media library and copy the file address. A free image host is the second. Upload the picture there and copy the direct link.
Cloud storage is the third, and it's the one that trips people up. Google Drive and similar services give you a sharing link, but it opens a viewer page rather than the raw image, so it often fails inside an img tag.
On PictureToLink's uploader you drop or paste the image and get several link formats at once. The direct link (ending in .jpg, .png and so on) goes in the src of your image tag. The "HTML embed" format is already a clickable picture. It wraps the image in a link to its own share page, so you can paste it into a web page and change the href if the click should go somewhere else. Add your own alt text, since only you can describe the image.
Know the limits before using us for this. Uploads can be JPG, PNG, WebP, GIF or AVIF, up to 25 MB, and iPhone HEIC photos are converted to JPG in your browser before they upload. Each image is compressed and its metadata, including GPS location, is stripped. (To clean a photo you keep or send elsewhere, use the EXIF remover.) It stays online while people keep viewing it and is removed after 12 months without views, or sooner if you choose an auto-delete time. Anyone with the link can view it, so don't put anything private on a public host.
That makes us the wrong home for some pictures. For an image that's a permanent part of a business website, hosting it on your own site is the safer long-term choice.
For a logo or product shot that needs a clean edge, you can cut out its background first, or crop it into a circle for a round button.
Why isn't my clickable picture working?
First work out which half failed: the picture or the click.
A broken picture is nearly always a src problem. When src points to a share page or a cloud-drive viewer, the browser gets a web page instead of a picture and shows a broken image. The src should normally end in an image extension, and the link formats explainer shows the difference. A src that points to a file on your computer is sneakier. It looks fine to you and broken to everyone else.
Did the picture work before and then vanish? It was deleted or expired. If the host removed the file, or you set it to delete automatically, the picture disappears but the link around it stays. Our guide to why images don't show walks through the causes of a broken icon.
When the picture shows but the click goes wrong, look at the anchor. Swapped addresses are the usual slip. The href (on the a tag) is where the click goes, and the src (on the img tag) is the picture. In Google Docs, a floating image can't take a link at all, so switch it to in-line before adding one.
Two faults don't break anything you can see. A linked image with no alt text gives screen-reader users no clue where the link goes. And a huge file is slow: a 6 MB photo used as a button slows the page down, because the browser downloads every pixel before it scales the picture to fit. Work it through for a phone photo. A 12 MP shot is 4032 × 3024 pixels. Shown as a 600 px wide button, about 98% of those pixels are thrown away after they arrive. Resize the picture to 1200 px wide instead, twice the display width so it stays sharp on high-density screens. That keeps 1200 × 900 pixels, about 9% of the original, and the file falls roughly in step.
A picture still on your device needs uploading first. Copy the HTML embed code, then change the href to wherever readers should go. If it's already online, copy its direct address into the HTML example near the top.
