Screenshot to code with Claude Code: from a picture to working HTML
Hocusclick guide · 3 December 2026
Claude Code can turn a screenshot into code. Copy the picture, paste it into Claude Code with Alt+V on Windows, and ask: "Generate HTML and CSS that match this design." On Windows, Windows key + Shift + S takes the screenshot straight to the clipboard. The first try gets the layout; two or three rounds of plain-language changes get the details.
How do you get a screenshot into Claude Code?
Three ways, all from the Claude Code docs:
- Paste it. Press Windows key + Shift + S, drag over the part you want, and it is on the clipboard. In Claude Code press Alt+V on Windows (Ctrl+V on a Mac). An
[Image #1]chip appears where your cursor is. - Drag it from a folder into the Claude Code window.
- Give the path: "Analyze this image: C:\Users\you\Pictures\design.png".
You can add several pictures in one conversation, for example the desktop and the phone version of the same page.
What should you ask?
The docs use prompts like these:
- "Generate CSS to match this design mockup"
- "What HTML structure would recreate this component?"
- "Describe the UI elements in this screenshot"
Say what you build with, or Claude picks for you. For example:
[Image #1] Build this pricing card as one HTML file with plain CSS.
Match the spacing, the colours and the font sizes as closely as you can.
Use the system font. Make it work on a phone as well.
How do you get closer to the design?
- Crop. One component per picture gives a closer match than a whole page.
- Name what matters. "The button has a 2 px border and fully round corners" settles what a picture cannot show sharply.
- Compare side by side. Open the result in the browser, take a screenshot of it, paste both pictures and ask: "Image 1 is the design, image 2 is what you built. List the differences and fix them."
- Give the real values when you have them: colours as hex codes, the font name, the sizes from the design file.
What can it not do from a picture?
A screenshot is a flat picture. Claude can only guess at hover states, animations, the exact font and how the layout behaves at other widths. Say what it should do there, or give a second picture.
Also, what you paste goes to Claude to be read. Do not paste screens with passwords, customer data or anything else you would not send to a third party.
Faster than a screenshot
Hocusclick does this without the screenshot. You click any part of any screen and it writes that part in code; you change it in plain words and copy what it wrote. It works through Claude Code on your own Claude plan. If you have not installed it yet: install Claude Code on Windows.
Sources
- Claude Code docs, Common workflows: work with images
- Claude Code docs, Interactive mode: keyboard shortcuts
- Microsoft Support, Use Snipping Tool to capture screenshots