Skip to content
PictureToLink logoPictureToLink
Menu
Image Sharing

Direct vs Embed: Which Image Embed Code or Link?

Direct vs embed: a direct link is the image file's URL, and an image embed code makes a page display it. See which one each place accepts.

By Mudasir Ahsan (Founder) · · Updated · 8 min read
Facts checked against official sources on

On this page

A direct link is the address of the image file itself. An image embed code is that same address wrapped in the syntax a page needs to display the picture: HTML for websites and email templates, BBCode for forums, Markdown for GitHub and documentation. A viewer link (PictureToLink calls it a share page) opens a web page with the image on it. Send that one to people. Software gets the direct link, bare or inside an embed code. So you choose by where the image is going, and the image itself doesn't change the answer.

HTML code on a computer screen Photo: César Gaviria on Pexels

Most image hosts, PictureToLink included, hand you several versions of one link. On PictureToLink they sit in the link menu that appears after you upload on the homepage. For an image with the ID abc123, they look like this:

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

After an upload you get the direct link first; the other formats are one menu away.

FormatExampleWhat it is
Direct linkhttps://picturetolink.com/i/abc123.jpgThe image file itself, nothing else
Share page (viewer link)https://picturetolink.com/v/abc123A simple web page that shows the image
HTML embed<a href="…/v/abc123"><img src="…/i/abc123.jpg" alt="" width="1920" height="1280"></a>Code for web pages and HTML emails
BBCode[img]https://picturetolink.com/i/abc123.jpg[/img]Code for forums
Markdown![](https://picturetolink.com/i/abc123.jpg)Code for GitHub, READMEs and docs

A sixth option, BBCode linked, wraps the forum code in a link to the share page so readers can click through.

Look at the last three rows again. Every embed code contains the direct link. Only the wrapper changes.

A page that displays your picture doesn't hold a copy of it. The embed code only tells each reader's browser where to fetch the file, and the browser expects an image to come back from that address. A direct link returns exactly that. A viewer link returns a web page.

Put a viewer link inside an embed code or an "image URL" box and the browser receives a page where it wanted a picture. It can't draw one, so the reader sees a broken image. That mix-up is the most common reason a picture fails to appear on a forum or website.

People make the opposite mistake too. Because the direct link is the "real" file, it feels like the best thing to send a friend. It works, but on a phone it opens as a bare file, and some browsers offer to download it instead of showing it. For someone who only wants to look at a photo, that's the wrong link.

Use a direct link when software has to fetch the image and show it. Opened in a browser, it shows the picture on a blank background with no page around it, and the URL usually ends in .jpg, .png, .gif or .webp.

Chat apps that turn image URLs into inline pictures are the clearest case. Discord is one. Its File Attachments FAQ describes a chat setting under which "when an image is posted as a link, the image will be displayed instead of the text link."

Form fields that ask for an "image URL" want the same thing. That covers a profile picture field, a product feed and a spreadsheet image function. And it's the link that goes inside every embed code further down.

A viewer link, or share page, opens an ordinary web page that shows the image properly at any screen size. Nothing is friendlier to paste into a text message, an email or a social media DM.

PictureToLink's share pages carry no ads, so the person you send one to sees only your image. They also ask search engines not to index them, and the link is random rather than guessable. None of that makes the image private. Anyone who has the link can view it and pass it on.

How to use each image embed code

HTML embed

HTML embed code works on websites, blogs that accept custom HTML, and HTML email templates. PictureToLink's version shows the image and makes it a link to the share page:

<a href="https://picturetolink.com/v/abc123"><img src="https://picturetolink.com/i/abc123.jpg" alt="" width="1920" height="1280"></a>

Two parts of it need your attention before you paste.

The alt text comes empty, so fill it in. Write a short description between the quotes. Screen readers read it aloud, and it shows if the image fails to load.

Leave width and height alone. They tell the browser the image's proportions before it loads, which stops the page jumping around. In the example, 1920 and 1280 let the browser set aside a box of the right shape while the file is still on its way. To show the image smaller, change its display size with your site's CSS or editor. If the file is far bigger than the space it fills, shrink it first with the image resizer.

For the image without the click-through link, keep only the <img ...> part and delete the <a ...> and </a> around it.

BBCode

Forums such as phpBB, XenForo and MyBB use BBCode rather than HTML: the [img] tag around a direct link. The BBCode image tags guide covers linked images, sizing and how forum packages differ.

Markdown

Markdown is the light syntax used on GitHub, in README files and in many documentation and note-taking tools. GitHub's formatting guide gives the pattern: an exclamation mark, alt text in square brackets, then the image link in parentheses. PictureToLink leaves the alt text empty, so add your own description between the brackets:

![Screenshot of the settings page](https://picturetolink.com/i/abc123.jpg)

For images stored in your own repository, GitHub recommends relative links instead of full URLs. The Markdown image syntax guide goes further.

A person gets the share page. A form field or a chat app gets the direct link. A page you're writing gets the embed code in that page's own language. The table applies those rules to the places people ask about most.

Where the image is goingBest formatNotes
A text message, chat with a friend, or social media DMShare pageOpens as a normal page on any phone
A regular email you are typingShare pagePaste it into the message. Recipients click to view.
An HTML email template or newsletter toolHTML embed (image only)Classic Outlook blocks automatic picture downloads by default, and Gmail users can turn on "Ask before displaying external images", so some readers see a placeholder until they allow images
DiscordDirect linkShown inline if the reader has link previews on and the channel allows embedded links
Reddit, as a link postDirect linkA link to a page shows as a link, not a picture. Uploading to Reddit is the other route: see how to post images on Reddit
Forums (phpBB, XenForo, MyBB, vBulletin)BBCode or BBCode linkedUse the forum's own attachment feature if it has one
GitHub issues, pull requests and README filesMarkdownAdd alt text between the square brackets
A website or blog postHTML embedAdd alt text. Keep width and height.
eBay item descriptionHTML, image onlySee the note below
A form or app asking for an "image URL"Direct linkA share page will appear broken

The eBay row

eBay descriptions need care, because the default HTML embed breaks a rule there. eBay's links policy bans links that send buyers to other sites, with limited exceptions, and allowed links must use HTTPS. The developer guide to description HTML lists externally hosted images among those exceptions and recommends that description images be no wider than 700 pixels.

So the picture is allowed and the click-through isn't. Use only the <img> part of the HTML embed with the direct link, and remove the <a> link to the share page. Our example image is 1920 pixels wide, well over eBay's 700, so it should be resized before it goes into a description. Your main listing photos are separate. They go through eBay's own listing form.

If you don't have a link yet, start with how to get an image URL from a phone or computer.

A working direct link can still show up as a blank or broken image. Something between the file and the reader is refusing it.

The host may block hotlinking. Showing an image from someone else's server uses their bandwidth, so many sites refuse to serve images to other websites. Image hosts like PictureToLink exist so that embedding is allowed. The hotlinking explainer covers the etiquette.

Some platforms only show their own uploads. They display pictures that came through their own uploader, or they strip links from posts. eBay's rules above are one example.

Embeds can be switched off. On Discord, a channel's "Embed Links" permission decides whether links show embedded content, according to the channel permissions guide. Forum admins can turn off image tags too.

Email is its own case. The reader's email app may hold back remote images until they allow them, as in the table.

Check the start of the link as well. If it isn't HTTPS, eBay won't accept it, and browsers may block http:// images on secure pages.

Last, the image may be gone. If the host deleted it, every link to it breaks at once. On PictureToLink that happens when you use the private delete link, when an auto-delete time you chose passes, or after 12 months without a view. That's why a forum's own attachment feature is the better choice when it has one.

When you know where the image is going, upload it and copy the matching format from the link menu. If you uploaded several images and need every link in the same format, use Copy all.

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