How to Turn Code into an Image

To turn code into an image, paste it in the box above, pick a theme and press Copy image. The picture is ready to paste in a post, a slide or a chat straight away.

  1. Paste your code. Keep it short: 5 to 30 lines read best. Auto-detect picks the language; if it guesses wrong, choose it from the list.
  2. Choose the look. A theme for the code, a background around it, the font and size, and whether you want a window frame, a title or line numbers.
  3. Pick the scale. 2x is right for most places; use 3x for slides and print.
  4. Copy or share. Copy image puts a PNG on your clipboard; Publish & get a link uploads it and gives you a URL; Copy SVG code gives a vector version for docs and design tools.

Themes, Fonts and Backgrounds

Every theme below is the real thing: the same three lines, highlighted by the same engine the tool uses, so what you see here is what your image will look like. Dark themes stand out in social feeds; light themes suit documents, white slides and print. Press Use this theme to switch the tool above.

  • GitHub Dark Dark

    The look of GitHub itself: calm contrast that suits social posts and READMEs.

  • GitHub Light Light

    Clean and familiar for docs, wikis, white slides and printed handouts.

  • One Dark Pro Dark

    Atom's classic palette, a long-time favourite in VS Code.

  • Dracula Dark

    Purples, pinks and greens with high contrast that stand out in a busy feed.

  • Nord Dark

    Cool, muted arctic blues for a quiet, polished look.

  • Monokai Dark

    Bold, warm colours made famous by Sublime Text.

  • Solarized Dark Dark

    Low-glare colours designed for long reading sessions.

  • Solarized Light Light

    A soft cream background that is easy on the eyes on slides and paper.

Fonts made for code

A good coding font keeps similar characters apart (0 and O, 1, l and I) and lines up every column. Each sample below is drawn in the font itself.

  • 0O 1lI {}=> != ===

    JetBrains Mono Default

    Taller lowercase letters for easy reading at small sizes, from the makers of IntelliJ, with ligatures for =>, != and ===.

  • 0O 1lI {}=> != ===

    Fira Code Classic

    The font that made code ligatures popular: slightly wider and rounder, a favourite in talks and tutorials.

  • 0O 1lI {}=> != ===

    System monospace No download

    The device's own code font (Menlo on a Mac, Consolas on Windows), without ligatures, so => stays two characters.

JetBrains Mono and Fira Code are free under the SIL Open Font License and load from our own server. Tip: 15 px is right for posts, 17-20 px for slides.

Backgrounds

The background is the frame around the code window. A gradient makes a post eye-catching; Transparent lets the window sit on any slide or page.

Where to Use Code Images

WhereGood settingsWhy an image
X, LinkedIn, MastodonDark theme, gradient, 2xCode blocks are not supported; the picture keeps colours and indentation
Slides and talks3x, 17-20 px fontReadable from the back of the room, no editor needed
Blog posts and newslettersTheme of your site, transparent backgroundLooks the same in every email client
Chats, issues and forumsAny theme, Publish & get a linkOne link instead of an attachment

Tips for Readable Code Screenshots

  • Show only what matters. Cut imports and boilerplate; a short snippet is easier to read in a feed.
  • Keep lines under about 80 characters. Long lines make a wide image that gets tiny on phones.
  • Add line numbers when you talk about lines ("see line 4"); leave them off for a cleaner look.
  • Give the code as text too. Screen readers can't read a picture and nobody can copy from it: add a gist, a repository link or the snippet in the post text.
  • Check for secrets. API keys, tokens and passwords in a screenshot are just as leaked as in text. To hide parts of an existing screenshot, use Blur Image.

Need to share a screenshot of your screen instead? Paste it and get a link in one step, or turn any picture into a link with Image to URL.

Frequently Asked Questions

How do I turn code into an image?
Paste your code in the box on this page. The language is detected for you, or pick it from the list. Choose a theme and a background, then press Copy image to paste the picture anywhere, or Publish & get a link to share it as a URL.
Is my code uploaded?
No. The highlighting and the picture are made in your browser, so your code stays on your device. Only the finished image is uploaded, and only if you press Publish & get a link.
Which languages are supported?
JavaScript, TypeScript, JSX, TSX, Python, PHP, HTML, CSS, JSON, Shell, SQL, Java, C, C++, C#, Go, Rust, Ruby, Kotlin, Swift, YAML, Markdown, XML and Dockerfile, plus plain text. Auto-detect picks one from the code itself; if it guesses wrong, choose the language yourself.
Are the colours the same as in VS Code?
Yes. The tool uses Shiki, the highlighter built on the same grammars and themes as Visual Studio Code, so GitHub Dark, One Dark Pro, Dracula and the other themes look the way they do in the editor.
Why does my image look blurry on social media?
Use the 2x or 3x image scale. A 2x image has twice as many pixels in each direction, so text stays crisp on phones and high-resolution screens, even after a site shrinks it.
Can I get the image without a background?
Yes. Choose Transparent as the background. The PNG keeps the rounded code window, so it sits cleanly on slides and on dark or light pages.
What is the SVG option for?
Copy SVG code gives you the image as vector text: it stays sharp at any size and the code in it is still text. The fonts are not embedded, so a viewer without JetBrains Mono or Fira Code shows a similar monospace font.
Should I share code as an image or as text?
Share both when you can. An image is great for posts, slides and docs, but nobody can copy from it and screen readers cannot read it. Add the code as text, a gist or a repository link next to the picture.