Code to Image Generator

Turn code into a beautiful image online for free — paste a snippet, pick the language and theme, add a gradient background and window controls, and export a sharp 2× PNG for posts, slides and docs. Runs 100% in your browser.

100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.

100% private — runs in your browser

Images export at 2× for sharp results on retina screens and slides. Syntax highlighting by highlight.js. Your code never leaves your browser.

How to turn code into an image

  1. Paste your code — the language is detected automatically, or pick it.
  2. Choose a theme, background and padding.
  3. Toggle window controls and line numbers, and set a title.
  4. Download the PNG or copy it to the clipboard.

What you can use it for

  • Share code snippets on X, LinkedIn and Instagram
  • Add readable code to slides and talks
  • Illustrate tutorials, docs and blog posts
  • Create code cards for newsletters

More free tools

Building for the web?

Format, minify, convert and generate code with our free, private developer tools.

See all free tools →

Frequently asked questions

How do I make a picture of my code?

Paste the code, choose a theme and background, then click “Download PNG”. The image is exported at twice the screen resolution so it stays crisp.

Which languages are supported?

JavaScript, TypeScript, Python, HTML/XML, CSS, JSON, Bash, SQL, PHP, Java, Go, Rust, C/C++, C#, Ruby, Swift, Kotlin, YAML and Markdown — or let it auto-detect.

Can I get a transparent background?

Yes — choose “Transparent” as the background to export just the code window.

Is my code uploaded?

No. Highlighting and image export happen in your browser.