Image to HTML

Convert images to an html link free.

Generates downloadable HTML with a safely escaped image URL or embedded raster image data URI.

Local processing · 25 MB per file · 100 MB total · up to 200 PDF pages

No file selected

Every picture on a web page is there because a few lines of code put it there. Writing that code by hand is simple in principle and easy to get wrong in practice: one misplaced quote mark and the image vanishes, one wrong address and the whole page shows a broken icon. Generating the code instead of typing it removes the fiddly part entirely.

The Image to HTML tool on this page generates the HTML for an image, free and in your browser. Give it an image file, or the public address of an image already online, add the alternative text, and it produces downloadable HTML with a safely escaped image URL or an embedded raster image data URI. It does not publish the picture to a server — it only writes the code that displays it.

What an image link actually is

An image HTML link is the small piece of code that makes a picture clickable or simply places an image on a web page: the img tag that displays it, usually wrapped in an anchor tag that gives it somewhere to go. It is the connective tissue of the visual web — banners that lead to products, logos that lead home, thumbnails that open galleries. Generating the code saves the fiddly typing and the misplaced quote marks that break pages in ways beginners cannot see.

The code itself is short, but every part of it has a job. The img tag tells the browser which picture to fetch and what to show if it cannot. The anchor tag, when present, turns the picture into a link. Nothing else is needed for a working image on a page — which is why getting these few lines right matters more than any styling around them.

The parts worth understanding

Three attributes decide whether the code is any good. The src is the image’s address — it must be a real, stable URL where the image is hosted, because the code displays the image from there every time the page loads. The alt text describes the image for screen readers and search engines and appears when the image fails; it is not decoration, it is the image’s name in text. And the link’s href is the destination — check it like you would check an address on an envelope, because a perfect image sending visitors to the wrong page is worse than no image.

Alt text deserves a little care. Describe what the picture shows, briefly and plainly: “red running shoes on a white background” rather than “image” or a string of keywords. Screen reader users hear it instead of the picture, and search engines use it to understand the image. It is the one attribute that serves people who cannot see the picture at all.

How to use the Image to HTML tool

  1. Select one source file (PNG, JPEG, WebP, GIF, SVG or BMP), or instead paste a public image URL in the image URL field.
  2. Set the alternative text. It starts as “Image” — replace it with a short description of what the picture shows.
  3. Choose Process, then inspect the generated HTML on the page.
  4. Use the download control to save the HTML file, then paste the code into your page where the image belongs.

When you supply a file, the tool embeds the image as a data URI inside the code, so the HTML carries the picture with it. When you supply a URL, the code points at that address instead. Both forms are valid HTML; the choice depends on where the picture will live.

What it works best on

Blog posts, product pages, email signatures and forum posts are the natural home for generated image code. A seller who needs a product picture to link to a listing, a blogger adding a banner that leads to a shop, a newsletter writer embedding a logo — all of them need the same few lines, correct, without opening a code editor. The URL form suits images already hosted somewhere stable, such as your own site’s media library. The file form suits small images that should travel with the code itself, like a signature logo or a single icon, where depending on an outside address would be fragile.

What it does not do

The tool writes code; it does not host or publish your picture. An image referenced by URL still lives wherever it was uploaded, and if that file is deleted, renamed or blocked, the code breaks. Embedding a file as a data URI makes the HTML file large — for a photograph, very large — so it suits small graphics, not galleries. The tool does not resize, crop or compress the image, and it does not add styling such as width, borders or captions; those belong in your page’s own code. It also cannot check that a URL you paste is yours to use: the code will work with any public address, which is a matter for permission, not for the tool.

Tips for clean results

Use a short, stable URL for images you rely on — your own hosting, not a temporary link that may change. Write alt text that would make sense to someone who cannot see the picture. Test the generated code in a blank page before pasting it into a live one, so a mistake shows up where it is harmless. If you embed a file, keep it small: an icon or a logo embeds neatly, while a photograph becomes a wall of text that is hard to manage. And keep the original image file even after embedding, because the code is a copy, not a filing system.

Common problems and fixes

A broken picture icon almost always means the src address is wrong: the image moved, was renamed, or the host blocks hotlinking. Re-check the address by opening it in a browser tab first. If an embedded image makes your page file enormous, the picture was too large to embed — host it and use the URL form instead. If the alt text shows instead of the image, the browser could not fetch the picture at all; check the address and the hosting. If a link sends visitors to the wrong page, the href is at fault, not the image — verify the destination address the same way you would verify the image address.

Privacy: your files stay on your device

Inputs are processed in browser memory and are not uploaded by this plugin. The code is generated on your own computer, and generated downloads remain on your device. The site privacy policy explains memory cleanup and hosting logs. Note that a URL you paste is only used to build the code — the tool does not fetch or store the picture behind it.

Frequently asked questions

Why does my image link show a broken picture?

The src address is wrong or the image moved. The code points at a location, not at the image itself; if the file is renamed, deleted or blocked from hotlinking, every page using that address breaks at once. Host images you rely on, on space you control.

Can I use an image from another website in my link?

Technically the code will work; that does not make it wise. The image is the owner’s bandwidth and usually their copyright. Upload your own copy with permission, or link to their page instead of embedding their file.

Should the link open in a new tab?

For links leaving your site, often yes; for navigation inside it, no. Decide by the reader’s journey: a new tab when the current page should stay open behind the destination, the same tab when the click is simply the next step.

Should I use the image URL or upload a file?

Use the URL when the picture already lives somewhere stable that you control — it keeps the HTML small and the picture easy to replace. Upload a file when the image is small and should travel with the code, such as a logo in an email signature. For large photographs, always use the URL form.

Can I use this code in an email?

Yes, with care. Most email programs display images referenced by a public URL, but some block them until the reader allows images. Embedded data URIs work in some email programs and not in others. For email, a hosted image with a plain URL is the safer choice.

Can the code resize my image?

Not by itself. The generated code displays the image at its natural size. Resizing belongs either to the image itself — convert or resize it before generating the code — or to your page’s styling. If the picture is too large for the page, resize the file first rather than relying on code to shrink it.

Related tools