Code to Image
Turn any code snippet into a clean, shareable screenshot — complete with a window bar, a color theme, and light syntax highlighting. Tweak the look, then download a crisp PNG for your blog, docs, slides, or social posts. Everything is rendered in your browser.
Share Code That Actually Looks Good
Pasting raw code into a tweet, a slide, or a chat strips the formatting and makes it hard to read. A code image keeps the indentation, adds color, and frames the snippet so it stands out. This tool produces a polished screenshot — similar to popular "carbon"-style images — without any sign-up, watermark, or upload.
What You Can Customize
- Theme — pick a dark or light background and matching syntax colors.
- Window title — add a filename like
main.goin the title bar, or leave it blank. - Font size — scale the code up for slides or down for dense snippets.
- Padding — control the breathing room around the window for the perfect crop.
How It's Rendered
The image is drawn directly onto an HTML canvas at 2× resolution for crisp output on retina displays. A lightweight tokenizer adds color to comments, strings, numbers, and common keywords across most C-style and scripting languages. Because it's all canvas-based, there are no external libraries and nothing is sent anywhere.
Privacy
Your code never leaves your browser. Rendering and PNG export happen locally, so it's safe for proprietary or unreleased code.