Code Screenshot Generator

Turn code into a styled screenshot image.

The Code Screenshot Generator turns a code snippet into a styled PNG with syntax highlighting, a colored or transparent background, optional window chrome and line numbers. Choose a language, theme, background and padding, then download the image or copy it to the clipboard.

What is a code screenshot?

A code screenshot is an image of source code styled for sharing in slides, social posts, articles and chat. Instead of capturing an editor window, the tool draws the code itself: it colors tokens such as keywords, strings, numbers and comments according to the language, places the code on a rounded card with optional macOS-style window dots, adds a gradient or transparent backdrop around it, and then renders that page element to a PNG bitmap in your browser at 2x pixel density. A theme is a fixed set of colors for the card background, text, line numbers and token types. Because the result is a picture, the text in it cannot be selected or copied, so keep the code text available elsewhere when readers need to copy it.

How to use Code Screenshot Generator

  1. Enter the code Paste or type the snippet into the Code editor. A sample JavaScript function is loaded at first, and Clear empties the editor.
  2. Set language and theme Use the Language menu (including Auto-detect) and the Theme menu to choose highlighting and card colors.
  3. Style the frame Choose a Background, drag the Padding slider (0 to 128 px), add an optional Window title, and tick or untick Window chrome (dots) and Line numbers.
  4. Check the preview The preview below the controls shows exactly what will be exported. A warning appears if the code is longer than 20,000 characters.
  5. Download or copy Click Download PNG to save the image, or Copy image to put it on the clipboard. Copy image appears only in browsers that support copying images.

Frequently asked questions

Which themes and backgrounds are available?

Themes: Night (dark), Dracula (dark), Paper (light), Sand (light) and Forest (dark). Backgrounds: Sunset, Ocean, Violet, Mint, Slate and Transparent.

Which languages can I choose?

Auto-detect, javascript, typescript, json, html, xml, css, sql, python, java, csharp, cpp, go, rust, php, ruby, bash, yaml, lua and markdown.

What are the limits?

The code is truncated to its first 20,000 characters in the image, the padding is between 0 and 128 pixels, and the window title can have up to 60 characters.

What format and size is the image?

A PNG rendered at 2x pixel density, so it stays sharp on high-resolution screens. Its dimensions depend on the code, padding and options you chose.

Is my code uploaded?

No. The highlighting and image rendering happen in the page, and the PNG is created in your browser, so the code is not sent anywhere.

Can readers copy the text from the image?

No. The result is a bitmap. If readers need to copy the code, publish it as text next to the image.