Frame screenshots with backgrounds, window bars and shadows
Code to Image
Make a sharp, good-looking picture of a code snippet for a slide, a tweet or a blog post in seconds.
Loading tool…
How to use code to image
Paste your snippet; the language is detected, or choose it yourself.
Pick a colour theme, a background, the padding and the font size.
Turn line numbers and the window bar on or off and give the window a title.
Save a PNG at 1x, 2x or 3x, or an SVG that stays sharp at any size.
What this tool does
- Colours JavaScript, TypeScript, Python, HTML, CSS, JSON, SQL and Bash with its own built-in highlighter.
- Five code themes and seven backgrounds, including transparent for placing on your own design.
- SVG export keeps the code as real text, so it stays sharp and can be searched.
- PNG export at up to 3x for crisp text on high density screens.
How the result is verified
Each PNG is decoded again and its pixel size checked before the download starts. Each SVG is parsed as XML first and its text lines counted.
Frequently asked questions
PNG or SVG: which should I use?
PNG for social posts and chat, where every viewer sees exactly the same picture. SVG for slides and documents that scale, since the text stays sharp at any zoom.
Can I use these images commercially?
Yes. The picture is made from your code on your device; there is no watermark and no licence attached by this tool.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Edit HTML, CSS and JavaScript and run them live in a sandbox with a console
Run JavaScript with a console and top level await, no network access
Compare two texts line by line with changed words highlighted