Code image generator
Turn a snippet into a picture worth posting — syntax highlighting for 73 languages, ten original themes, window chrome and gradient backdrops. Export a PNG at up to 3× or a real SVG whose text is still selectable. Your code is highlighted and drawn here in the browser; it never leaves your device.
Theme
Backdrop
Code
Those lines get a band and a marker; everything else dims. The fastest way to point at the line the image is actually about.
Window
Export
When a picture of code is the right answer — and when it isn't
An image of code is a picture. It cannot be copied, searched, diffed, translated or read aloud by a screen reader, and every one of those is a real cost. So the honest rule is narrow: use an image only where the destination cannot render code at all. A post on X or LinkedIn, a slide, a conference talk, a thumbnail, a design mock — those flatten a code block into grey unstyled text, and colour and shape are most of what makes code readable at a glance. Anywhere that renders Markdown — a README, an issue, a pull request, a docs page — a real fenced code block wins on every axis. This tool exists for the first list, not the second.
What actually makes a code image read well
Fewer lines than you think. The most common mistake is pasting the whole function. An image is glanced at, not studied; eight to fifteen lines is the range where a reader takes it in without zooming. If the point needs forty lines, the point needs a link.
Say which line matters. The Highlight lines field takes something like 3-5, 9 and dims everything else. A reader who has to hunt for the interesting line usually stops hunting.
Contrast over prettiness. Every theme here is checked so that no token colour drops below roughly 4.5:1 against its own background. A palette that looks lovely on your monitor and dissolves on a phone in daylight has failed at the only job the image has.
Give it room. The space around the window is what makes the card look deliberate rather than cropped, and it also stops a platform's own rounded corners from clipping your code.
Why the export matches the preview exactly
Most tools of this kind build the picture as HTML and then rasterise the page with something like html2canvas. That inherits a set of problems: a web font that has not finished loading is captured as a fallback, shadows and gradients are approximated, and exporting at 3× means laying the page out again at a different size. Here the preview and the export are the same drawing routine on a canvas, called at a different scale — so what you download is what you saw, and 3× is a multiplication rather than a re-render.
The one thing that has to be true first is that the font has arrived, because a canvas measures text against whatever font is resolved at the moment it is asked. Every path here waits for the face to load before it measures anything, which is the difference between an image whose lines end where they should and one that is subtly wrong.
The SVG export is worth knowing about
The layout is a list of tokens with positions, so it can be emitted as vectors as easily as pixels. The SVG holds real text: it stays crisp at any size, it is usually a fraction of the size of the PNG, and the code inside it can still be selected and searched. Each token carries an explicit advance width, so the layout holds even on a machine that does not have the font installed — which is the usual reason an exported SVG of code looks fine on the machine that made it and wrong everywhere else.
Nothing leaves your device
Highlighting, layout and rendering all happen in the tab. That matters more here than for most tools, because the thing you are pasting is frequently unreleased work, a client's code, or a config file with a key in it. There is no endpoint to send it to. The syntax highlighter is fetched once from a CDN and cached; your code is never part of a request.
Frequently Asked Questions
Is my code uploaded?
No. Highlighting, layout and rendering all happen in your browser, and the picture is drawn on a canvas here rather than on a server. Unreleased code, a client's snippet or a config file with a key in it never leaves your device. The highlighter itself is fetched from a CDN once and then cached; your code is never part of a request.
Which languages work?
Every language the highlighter registers — 73 in the list, including JavaScript, TypeScript, Python, Go, Rust, Java, Kotlin, Swift, C, C++, C#, PHP, Ruby, SQL, Bash, JSON, YAML, HTML, CSS, Markdown and Dockerfiles. Leaving it on Auto-detect works out the language from the code itself, which is usually right and is one fewer decision to make.
PNG or SVG?
PNG for anywhere you are pasting a picture — social, Slack, a slide. SVG when it will be scaled or printed: it is vector text, so it stays crisp at any size, it is much smaller, and the code inside it can still be selected. Each token carries its own advance width, so the layout survives on a machine without the font.
Can I highlight or dim particular lines?
Yes — put line numbers or ranges in Highlight lines, such as 3-5, 9. Those get a band and a marker, everything else dims to about half. It is the quickest way to point at the one line the image is really about.
Is there a watermark?
Only if you add one. The watermark field is empty by default and takes your own handle or site. Nothing is stamped on your image without you asking for it.
Can I use the images commercially?
Yes. The themes and the rendering are our own work, and what you export is yours — including for client work, courses and paid content, with no attribution required. The code in the picture is of course still governed by whatever licence it came under.
Can I open a file instead of pasting?
Drop any source file anywhere on the page. It fills the editor, sets the title to the filename and picks the language from the extension.
Are my settings remembered?
Yes — the theme, backdrop, font and every slider are kept in your browser, along with the code if it is short enough to store comfortably. Reset everything clears them.
Should I post an image or a code block?
A code block, wherever one will render — a README, an issue, a pull request, a docs page. It can be copied, searched, diffed and read by a screen reader, and an image can do none of those. Reach for an image only where code blocks do not exist: social posts, slides, thumbnails and mockups.