Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Code Screenshot Generator

Carbon-style code images with VS Code themes — made in your browser.

Developer No upload Free, no sign-up

Preview

Loading syntax highlighting…

Style

Background
Window

Next steps

About the Code Screenshot Generator

Paste code and get an image worth sharing: proper syntax highlighting, a window frame with a title, a gradient or solid background, line numbers and highlighted lines. Use it for slides, documentation, blog posts, social media or a pull-request description.

Highlighting is done by Shiki, which uses the same TextMate grammars and themes as Visual Studio Code — over 240 languages and 65 themes, from GitHub Dark to Dracula, Nord and One Dark Pro — so your code looks exactly as it does in the editor. The image is drawn on a canvas in your browser from the highlighted tokens, never uploaded, and exported as a PNG at up to 4× size, as a vector SVG, straight to the clipboard, or as formatted text and HTML.

How to use it

  1. Paste your code into Code and pick its Language and a Theme. The preview updates as you type.
  2. Under Style, choose a background (a gradient, a solid colour or transparent), the padding, the window frame and its title, the font and its size. Add Line numbers, starting at any number, and type Highlight lines such as 3, 5-7 to draw attention to them.
  3. For long lines, set Wrap long lines at a number of characters, so the image stays readable on a phone.
  4. Press Download PNG (2× is sharp on most screens; 4× for print), Copy image to paste it directly into a chat or document, or SVG for a vector image. Copy formatted text pastes the coloured code into Google Docs, Word or an email.

Examples

A snippet for a social post
Input
Language: TypeScript · Theme: GitHub Dark · Background: Grape · Padding: 48 px · Font size: 16 px · Window: macOS, title "useDebounce.ts" · Scale: 2×
Result
A PNG at twice the preview size: the highlighted code in a dark window with the three macOS buttons, on a purple gradient.

Large font sizes and short lines (around 60 characters) read best on phones, where most social images are viewed.

Point at the important lines in a tutorial
Input
Line numbers: on, start at 42 · Highlight lines: 44-45
Result
The lines numbered 44 and 45 get a tinted background and a bar on the left; the numbering matches the file you are explaining.

Common uses

  • Slides and talks, where a pasted code block loses its colours or its layout.
  • Tweets, LinkedIn posts and Instagram, where code as text is unreadable.
  • Documentation, READMEs and blog posts that need a consistent, themed code image.
  • Sharing a snippet in chat with the lines that matter highlighted.

Export formats

  • PNG: the picture exactly as the preview shows it, at 1× to 4× its size (2× looks sharp on high-resolution screens and phones). Very large images are reduced automatically to the size browsers can draw, and the size shown above the preview says so.
  • Copy image: the same PNG on the clipboard, to paste into Slack, Teams, Docs or a tweet without saving a file.
  • SVG: a vector image that stays sharp at any size; the code stays real text. The viewer draws it with its own copy of the font, so pick a common font if others will open the file.
  • Copy formatted text: the coloured code as rich text, for Google Docs, Word, Outlook or Gmail — the reader can still select and copy it.
  • Copy HTML: a <pre> block with inline colours, for web pages and Markdown that allows HTML.

Tips for readable code images

  • Keep it short: 5–25 lines is the sweet spot; cut what is not needed to make the point.
  • Use 15–18 px text for social media and 2× scale, so the code survives being shrunk in a feed.
  • Wrap or shorten lines longer than about 80 characters; very wide images become tiny on phones.
  • Highlight the lines you talk about instead of explaining where to look.
  • For images that also go into dark and light documents, a dark theme on a gradient works almost everywhere; for print, choose a light theme and a white or transparent background.

Limitations

  • Fonts come from your device: the list shows which code fonts you have installed (others are marked “not installed”). Without a special code font the system monospace font is used.
  • Up to 2,000 lines or 100,000 characters per image.
  • Copy image works in current Chrome, Edge, Safari and Firefox; where the browser refuses, use Download PNG.
  • Static images only: no animated or video export.
  • Each language and theme is downloaded the first time you choose it, so switching to a new one needs a connection.

Privacy

Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot. The syntax highlighter (Shiki, with a WebAssembly regex engine of about 470 KB) is downloaded from this site when the page opens, and each language grammar and theme the first time you pick it; your code is never uploaded.

Frequently asked questions

Is my code uploaded?

No. Highlighting and drawing happen in your browser; only the highlighter itself and the language grammars are downloaded from this site, once.

Which languages and themes are there?

Every language and theme bundled with Shiki: more than 240 languages (from JavaScript, Python and SQL to Terraform, Solidity and COBOL) and 65 VS Code themes, both dark and light. Pick Plain text for logs or anything without a grammar.

How do I get a transparent background?

Choose the checkered Transparent swatch and export a PNG (or SVG): only the window and its shadow are drawn. With padding 0 and no shadow you get just the code window.

Why does the SVG look different on another computer?

SVG keeps the code as text and lets the viewer draw it with an installed font. If that font is missing there, a similar monospace font is used. For a pixel-exact result everywhere, share the PNG.

Why is the PNG smaller than the scale I chose?

Browsers cannot draw images larger than about 8,000 pixels per side (or 67 million pixels). For very long or wide code the scale is reduced to the largest that works; shorten or wrap the code to get the full scale.

Can I use the images anywhere?

Yes — the image shows your code, and MySmartCoPilot adds no watermark. The themes and grammars come from open-source projects, whose look you are free to use.

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.