Code to Image
Turn code snippets into beautiful shareable images with syntax highlighting. Customize theme, background, and padding, then export as PNG.
function greet(name: string): string { const message = `Hello, ${name}!`; console.log(message); return message;}greet("World");Code
Theme
Background
Padding
Font — 14px
1022
3× resolution — sharp on retina
How to use it
- 1Paste your code into the editor on the right.
- 2Choose a syntax theme, background, padding, and font size.
- 3Preview updates live — click Export PNG to download the image.
Common use cases
- Create attractive code screenshots for Twitter/X, LinkedIn, or blog posts.
- Share a code snippet in a Slack channel or team wiki without losing formatting.
- Generate a thumbnail image for a YouTube video or presentation slide.
- Produce branded code examples for documentation or marketing materials.
Frequently asked questions
- What file format does it export?
- PNG at 2× resolution, giving sharp results on retina / high-DPI displays.
- Can I remove the background?
- Yes — choose the 'None' background option to get a transparent background, useful for dropping the snippet into a slide deck.
- What languages are supported for syntax highlighting?
- JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, SQL, Bash, HTML, CSS, JSON, YAML, XML, and Markdown, plus Auto-detect.
- Is my code sent to a server?
- No. Syntax highlighting runs in the browser via highlight.js and the PNG is generated client-side via html2canvas. Your code never leaves your device.
Try next
Image Compressor
Compress PNG, JPEG, and WebP images with a live quality slider and side-by-side preview. Free, in your browser.
HTML Live Preview
Write HTML, CSS, and JavaScript and see the result instantly.
AI Code Explainer
Paste code, get a plain-English explanation from on-device Gemini Nano — no upload, no API key, no signup.