Code to Image Generator
Turn code into a beautiful image: paste a snippet, pick a syntax theme, background and window style, then download or copy a sharp PNG for X, LinkedIn, slides or docs.
1 · Code
Preview
2 · Style
About the Code to Image
Code to Image turns a code snippet into a polished image with syntax highlighting, a theme, a gradient background and an optional macOS window with a file name.
When to use it
Use it to share code on X, LinkedIn or Slack, in slides and docs, or anywhere code blocks don't render, so the snippet stays readable and looks good.
How to use the Code to Image
- 1Paste your code. The language is detected automatically, or pick it yourself.
- 2Choose a syntax theme such as GitHub Dark, Dracula or Tokyo Night.
- 3Set the background, padding, font size, window style, file name and line numbers.
- 4Download the PNG or copy the image to paste into X, LinkedIn, Slack or slides.
Code to Image FAQ
- Is Code to Image free?
- Yes. It's free with no sign-up and no watermark.
- Which languages are supported?
- 22 languages, including TypeScript, TSX, JavaScript, Python, Go, Rust, Java, Kotlin, Swift, PHP, Ruby, C, C++, C#, SQL, Bash, HTML, CSS, JSON, YAML and Markdown.
- Is my code sent anywhere?
- No. Highlighting and drawing happen in your browser, so your code never leaves your device.
- Can I turn off font ligatures?
- Yes. Uncheck Ligatures to draw arrows like => as separate characters instead of a single symbol.
- How sharp are the images?
- Images export at twice the size, so they look crisp on retina screens and in slides.
More free tools
All tools →PNG & JPG to WebP
Shrink images to WebP in your browser, nothing uploaded.
Image Compressor & Resizer
Smaller JPG, PNG and WebP, resized for any platform.
Background Remover
Free AI cutouts on your device. No uploads, no limits.
Mockup Generator
Screenshots in browser or phone frames on a gradient.
OG Image Generator
Social share images for X, LinkedIn and Slack.
CSS Gradient Generator
Linear, radial and conic gradients with up to five color stops.