Screenshot to Code
Turns a screenshot of a page into working front-end code.
Why use Screenshot to Code?
Copying a layout you can see is one of the slowest jobs in front-end work: you know exactly what you want, and the whole cost is typing it out. This takes the picture and writes the first version for you, then lets you point at what is wrong and ask again, so you correct rather than transcribe. It handles a screen recording too, which means a short interaction can come back as something that already moves. Where it needs care: what comes out is a faithful-looking copy, not your project. It does not know your design system, your components or your spacing scale, and it invents its own names for everything. Treat the output as a starting draft to fold into your own code, and remember that copying someone else's interface pixel for pixel is a decision about their design, not just yours.
When should you use Screenshot to Code?
Reach for it when a layout exists as a picture and you need it as markup: a design handed over as a flat image, a competitor's page you are studying, a whiteboard sketch, or an old internal tool nobody has the source for. It is also a fast way to get past the empty file at the start of a page. It is the wrong tool once a design system exists, because then you want your own components rather than a fresh set of class names. The log's Image to Code entry solves the neighbouring problem: that one draws the picture first and then writes the code, where this one starts from a picture you already have.
How do you install and use Screenshot to Code?
- The quickest look costs nothing to set up: open screenshottocode.com, the hosted version, and try one screenshot to see whether the output is close enough to be worth installing.
- To run it yourself, open the Terminal app, the window where you type commands, and paste the line below to download the project. It uses git, the tool that copies code folders from the internet, which comes with macOS and is free for Windows from git-scm.com.
- Follow the README to add your API key, the secret pass that lets the app use a paid model, and start it with Docker if you have it. Then feed it one screenshot of a page you already know well, so you can judge how faithful the result really is before trusting it on something new.
Paste into the Terminal app
git clone https://github.com/abi/screenshot-to-code.git