How to turn an image into a website

A screenshot of a page contains no text, no links and nothing a search engine or a screen reader can read.

A design image is a picture. A page is structured text that a browser arranges. Converting one to the other is rebuilding rather than transforming.

A design image beside a rebuilt page, both at phone width, one zoomed and one reflowed.
A design image beside a rebuilt page, both at phone width, one zoomed and one reflowed.

This guide covers what an image lacks, what the tools produce, and what the work actually is.

What an image lacks

Everything that is not pixels.

Text. A headline in an image is a shape. It cannot be selected, copied, searched, translated or read aloud.

Links. Nothing in an image is tappable.

Reflow. The image is one size. On a phone it shrinks until unreadable or requires panning.

Meaning. Search engines and screen readers see an image with no idea what is in it.

So a page that is one large image is technically a page and functionally a picture of one. For anything with words in it, that is not acceptable.

Image on a page Rebuilt as a page
Text selectable No Yes
Search engines read it No Yes
Screen readers Nothing Everything
Links work No Yes
Reflows to a phone No Yes
Translation No Yes

What the automatic tools produce

Image-to-code tools reproduce the appearance.

The output is usually absolutely positioned elements at fixed coordinates, with fixed widths, matching the image at the width it was made for. Generated class names, nested containers, and a structure that describes where things are rather than what they are.

It looks correct in a screenshot and breaks at every other screen size, which is most of them.

It is a starting point for someone who is going to restructure it. As a finished page it carries every problem of the image plus worse markup.

The actual work

Look at the image and name the parts.

That is a heading. That is a paragraph. That is a list of three things. That is a button. That is a form with two fields.

Write each one as what it is. Then style it so it reflows: one column on a phone, wider on a desktop.

The layout is the output of that process, not the input. Working the other way, positioning things to match a picture, is what produces a page that only works at one width.

A design image annotated with what each region is, beside the resulting markup structure.
A design image annotated with what each region is, beside the resulting markup structure.

It does not have to match exactly

The mock was drawn at one size, usually a wide desktop.

A page has no single size. It will be seen at phone width, at tablet width, at laptop width, on a large monitor, and at whatever font size the reader has chosen.

So the goal is that it works at all of them, which means it will differ from the mock at most of them. A page that reflows sensibly and is slightly different from the image is better than one that matches the image and breaks on a phone.

Say this to whoever supplied the mock. Most designers already know it and are relieved to hear it said.

When an image is fine

Genuinely pictorial content. A photograph, an illustration, a diagram that is a drawing rather than a layout.

Give it alt text describing what it shows, and keep any information it carries available as text as well.

Never an image as the only version of something containing words.

Two neighbouring cases are worth a look: AI HTML generator from image: screenshot to page and Publishing an HTML landing page.

Ask the assistant for a page, not prose HTML Check what came back render it before trusting it publish Give it an address so others can read it
Markup from a chat, checked in a renderer, then given an address.

Put it at an address

Name what each element is, write it as real text in that structure, style it to reflow rather than to match one width, check it at phone width, and keep images for the parts that are genuinely pictures.

Then the page has everything the picture was missing.

Questions people ask

Can I just put the image on a page?

It displays, and nothing in it is text. Search engines see nothing, screen readers see nothing, links do not work, and on a phone the reader zooms into a fixed picture.

What do automatic image-to-code tools produce?

Markup that reproduces the appearance, usually with absolute positioning and fixed sizes. It looks right at one width and breaks at every other.

What is the actual work?

Identifying what each part of the image is, heading, paragraph, button, list, and writing it as that. Then styling it. The layout is output rather than input.

Does it need to look identical?

It needs to work. A page that reflows to a phone and is slightly different from the mock is better than one that matches exactly at one width.

When is an image acceptable?

For something genuinely pictorial, or as a fallback beside real content. Never as the only version of something that has words in it.

Keep reading