ScriptsApr 1, 2026·1 min read

Screenshot to Code — Convert Designs to Code

Screenshot to Code converts screenshots, mockups, and Figma designs into clean code using AI. 72.1K+ GitHub stars. HTML, React, Vue, Bootstrap. MIT.

TL;DR
Converts screenshots and mockups into clean HTML, React, Vue, or Bootstrap code using AI vision models. Open-source, MIT license.
§01

What it is

Screenshot to Code is an open-source tool that converts screenshots, mockups, and Figma designs into clean, functional code. It uses AI vision models to interpret visual layouts and generate HTML, React, Vue, or Bootstrap code that reproduces the design.

The tool targets developers and designers who want to accelerate the design-to-code workflow. Instead of manually coding a layout from a mockup, upload a screenshot and get working code in seconds.

§02

How it saves time or tokens

Manually converting a design mockup to code takes hours of measuring spacing, matching colors, and writing responsive CSS. Screenshot to Code automates this translation, producing a working first draft that developers can refine.

The generated code uses standard HTML and CSS rather than proprietary components, making it easy for AI coding assistants to further modify and extend.

§03

How to use

  1. Clone and run the application:
git clone https://github.com/abi/screenshot-to-code.git
cd screenshot-to-code
pip install -r requirements.txt
cd frontend && npm install && npm run dev
  1. Open the web UI and upload a screenshot or paste a URL.
  1. Select the output format (HTML/CSS, React, Vue, Bootstrap).
  1. The AI analyzes the visual layout and generates code that reproduces the design.
  1. Copy the generated code and integrate it into your project.
§04

Example

<!-- Generated from a landing page screenshot -->
<section style='display: flex; flex-direction: column; align-items: center; padding: 4rem 2rem;'>
  <h1 style='font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem;'>Build Faster with AI</h1>
  <p style='font-size: 1.2rem; color: #666; max-width: 600px; text-align: center;'>Convert any design into production-ready code in seconds.</p>
  <button style='margin-top: 2rem; padding: 0.75rem 2rem; background: #2563eb; color: white; border-radius: 8px; border: none;'>Get Started</button>
</section>
§05

Related on TokRepo

§06

Common pitfalls

  • Expecting pixel-perfect output. AI vision models approximate layouts. The generated code is a starting point, not a finished product. Plan for manual refinement of spacing, fonts, and responsive behavior.
  • Using low-resolution screenshots. Higher resolution inputs produce better results. Crop tightly to the area you want converted.
  • Not specifying the output framework. The default HTML output may not match your project stack. Select React or Vue if that is what your project uses.
  • Failing to review community discussions and changelogs before upgrading. Breaking changes in major versions can disrupt existing workflows. Pin versions in production and test upgrades in staging first.

Frequently Asked Questions

How accurate is the code generation?+

Screenshot to Code produces a reasonable approximation of the input design. Simple layouts with clear structure convert well. Complex designs with overlapping elements, custom fonts, or animations require manual adjustment after generation.

Which AI models does Screenshot to Code use?+

Screenshot to Code supports multiple vision-capable models including GPT-4o, Claude, and Gemini. The model interprets the visual layout and generates code. You need an API key for your chosen model provider.

Can it convert Figma designs directly?+

Screenshot to Code works with screenshots of Figma designs. For direct Figma integration, export your design as an image and upload it. Some workflows also support pasting Figma URLs for automatic screenshot capture.

What output formats are supported?+

Screenshot to Code generates HTML/CSS, React (JSX), Vue, and Bootstrap code. The output uses standard web technologies without proprietary dependencies, making it easy to integrate into any project.

Is Screenshot to Code free?+

The tool is open-source under the MIT license and free to self-host. You pay for the AI model API calls (OpenAI, Anthropic, or Google). A hosted version is also available for users who prefer not to run it locally.

Citations (3)
🙏

Source & Thanks

abi/screenshot-to-code — 72,100+ GitHub stars

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets