Turn your code into a beautiful image
This free code to image converter makes a clean, sharp picture of your code, with syntax colors, line numbers, a window frame and a gradient background. Use it for tutorials, documentation, slides, blog posts, social posts, portfolios and bug reports, anywhere a code screenshot reads better than plain text.
You edit the code right in the picture: click the code and type, or paste with Ctrl+V. What you see is exactly what you download, as PNG, JPEG or WebP at up to 4× size, or copied to paste straight into a chat, a document or a slide.
Everything is made in your browser. Your code is never uploaded, and there’s no account and no watermark.
In the tool, How to use in the top bar opens a short guide, and the search box finds any option: type what you want to do, like “transparent” or “line numbers”, and it takes you there.
How to make an image of your code
- Add your code. Click the code in the picture and type, or press Ctrl+V anywhere to paste. You can also click Open a file or drop a code file on the tool.
- Check the language. It’s detected for you and shown under Code. If it guessed wrong, pick the right one.
- Pick a look. Choose a code theme, a font, the window buttons and a background. Type a title, such as a file name, in the title bar.
- Point out what matters. Click a line number to highlight that line.
- Save it. Click Download, or Copy image to paste it somewhere else.
Code themes and fonts
- 12 code themes: seven dark ones (Midnight, Ember, Lagoon, Grape, Graphite, Neon and Ink) and five light ones (Daybreak, Paper, Mint, Blossom and Sky). Each one colors keywords, strings, numbers, functions, types and comments differently.
- 11 fonts made for code, including Fira Code, Source Code Pro, Roboto Mono, Inconsolata, Space Mono and DM Mono, plus the monospace font built into your device.
- Size and spacing: set the font size from 10 to 28 pixels and the line height from tight to roomy.
- Italic comments that you can turn off, and a tab size of 2, 4 or 8 spaces for code that uses tabs.
Window, background and shape
- Window buttons: three colored dots, gray dots or none, and a title in the title bar, like
app.js. - Corners and shadow: round the corners from square to soft, and pick no shadow, a soft one or a strong one.
- Background: 12 gradients, any solid color, or a see-through (transparent) background so the window sits on whatever page or slide you put it on.
- Padding: from none to wide, so the window has room to breathe.
- Shape: let the image fit the code, or make it square (1:1), portrait (4:5) or wide (16:9) for social posts and slides. The window stays in the middle and the background fills the rest.
Line numbers and highlighted lines
Line numbers are on by default, and Start at lets you begin at any number, which is handy when the code comes from the middle of a longer file.
To make a line stand out, click its number in the picture. It gets a colored band and a bar on the left. Click again to remove it, or type the lines under Highlight lines, for example 3, 6-8. Diff code is colored too: added lines are green and removed lines are red.
Download PNG, JPEG or WebP, or copy the image
- PNG keeps every detail sharp and supports a see-through background. It’s the best choice for code.
- WebP makes small files and also keeps a see-through background.
- JPEG makes small files for chats. It can’t be see-through, so a see-through background becomes white.
- Size: 1×, 2×, 3× or 4×. 2× is sharp on most screens; 3× and 4× are good for print and big displays. The exact size in pixels is shown before you download.
- Copy image puts a PNG on your clipboard, ready to paste.
Languages
The colors know 49 languages, including JavaScript, TypeScript, Python, Java, C, C++, C#, Go, Rust, PHP, Ruby, Kotlin, Swift, Dart, Scala, SQL, HTML, CSS, SCSS, JSON, YAML, Markdown, Bash, Lua, R, Haskell, Elixir and Diff. Leave Auto-detect on and the language is found from the code, or from the file name when you open a file.
Your code stays private
The image is drawn in your browser, so your code is never sent anywhere. Your code and your settings are saved in this browser, so they’re still there the next time you open the tool. Fonts are downloaded the first time they’re used; your code isn’t part of that.
Tips for great code images
- Keep it short. 5 to 30 lines read best. Cut the parts that don’t matter for your point.
- Highlight one idea. One or two highlighted lines guide the eye better than many.
- Match the theme to the page. A light theme on a light page and a dark theme on a dark page look calm; a bright gradient makes a social post pop.
- Use 2× or more so the text stays crisp on phones and high-resolution screens.
- Add a title like the file name, so readers know where the code lives.
Frequently asked questions
Is this code to image converter free?
Yes. It’s completely free, with no sign-up, no watermark and no limit on how many images you make.
Is my code uploaded anywhere?
No. The image is made in your browser and your code is never sent to a server. It’s saved only in your own browser, so it’s still there next time.
How do I make the background transparent?
Under Background, pick the checkered circle. Then save as PNG or WebP. JPEG can’t be see-through, so a see-through background becomes white in a JPEG.
What image size should I download?
2× is sharp on most screens and is the default. Pick 3× or 4× for print or very large screens. The size in pixels is shown under Save the image before you download.
How do I highlight a line of code?
Click the line’s number in the picture. Click it again to remove the highlight. You can also type the lines under Highlight lines, for example 3, 6-8.
Why was the wrong language detected?
Very short code can look like several languages. Pick the right one under Code and the colors change at once. When you open a file, the language comes from its name.
Can I make a square image for social media?
Yes. Under Background, set Shape to 1:1 for a square, 4:5 for a tall post or 16:9 for a wide one. The window stays in the middle and the background fills the rest.
Does it work on a phone?
Yes. Tap the code to edit it in a bigger box, tap a line number to highlight it, and tap Download to save the image to your phone.
