Code to Image

Turn code into a beautiful image online: paste your snippet, pick a theme and background, and download a sharp code screenshot for free.

or drop a code file here

Window frame
Line numbers
Code image
.png

Turn Code Into an Image

Paste a snippet and this code to image tool draws it as a picture: your code with syntax highlighting, inside an editor window with the three macOS dots, on a padded gradient background. It is the quick way to put code where text does not survive - a post on X or LinkedIn, a slide, a README banner, a course handout or a chat where formatting gets flattened. Press Paste your code, or drop a code file on the page, and the preview updates as you type. Language is detected on its own (Auto shows what it picked); choose it from the list when a short snippet is ambiguous.

A Code Screenshot That Looks Designed

Six editor themes are built in: One Dark, Dracula, Monokai and Night Owl on the dark side, GitHub Light and Solarized Light on the light side. Background offers six gradients, a solid colour of your choice, or Transparent for a cut-out window you can place on any slide. Window frame and Line numbers switch on and off, and More options holds the file name shown in the window bar, the padding around the window and the font size. The code is set in JetBrains Mono, tabs become four spaces, and a line longer than 100 characters wraps onto the next row instead of stretching the picture sideways. People looking for a Carbon alternative that needs no account get the same kind of picture here.

Sharp PNG at 2x or 3x

The picture is drawn from the text itself, not captured from the screen, so it is as crisp as the font at any scale. Download saves a PNG at 2x by default, which stays sharp on phones and retina screens; the arrow beside it offers 3x for print or big displays and 1x for the smallest file. You can rename the file before saving, copy the image straight to the clipboard to paste into a document, or share it from a phone. Very long code is saved at the largest scale every device can open. Need a picture of your whole screen instead? That is take a screenshot.

Your Code Stays on Your Device

Code is often the one thing you should not paste into a random website: API keys in a config file, a client's source, an unreleased feature. Here the highlighting and the drawing both run in your browser. The page loads the highlighter and the font, and after that nothing you type is sent anywhere - there is no account, no upload and no watermark on the image.

Frequently Asked Questions About Code to Image

How do I turn code into an image?

Press Paste your code (or paste anywhere on the page), check the preview, pick a theme and background if you like, then press Download. The PNG is saved at 2x by default, so it stays sharp on high-density screens.

Which programming languages are supported?

JavaScript, TypeScript, Python, HTML and XML, CSS, SCSS, JSON, Bash, SQL, Java, C, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, YAML, Markdown, Lua, R and Diff, plus plain text. Auto detection picks one for you; choose it by hand when a two-line snippet could be several languages.

Can I make a code screenshot with a transparent background?

Yes. Set Background to Transparent and the saved PNG keeps only the window, with nothing around it, so it sits cleanly on a slide or a coloured page.

Do emoji and accented letters in my code show up?

Yes. Comments and strings keep every character you typed, including emoji, accents, Cyrillic and Greek; letters the code font lacks are drawn from your system fonts.

Is my code uploaded to a server?

No. The code never leaves your browser: highlighting, drawing and saving all happen on your device, which matters when a snippet holds keys, paths or code that is not public yet.