Code to Image

Your data never leaves your browser

Turn any code snippet into a beautiful, shareable screenshot. Pick a theme, font, and background, then download a PNG. Everything runs in your browser.

Code
Style
Code
developertoolkit.dev
Code highlighted and rendered to an image entirely in your browser. No code is sent to a server.

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/code-to-image

Why turn code into an image?

Plain pasted code loses its syntax colors the moment it leaves your editor. A code screenshot keeps the highlighting, spacing, and structure intact, which makes it far easier to read in places that do not render code well: Twitter and X posts, Slack and Discord messages, slide decks, documentation, blog headers, and release notes. This tool renders your snippet with accurate VS Code themes, wraps it in a clean window frame, and exports a high-resolution PNG you can drop anywhere.

Customization options

Accurate themes

Eight syntax themes rendered with Shiki, the same engine VS Code uses. GitHub, Dracula, Monokai, One Dark, Nord, and Solarized, in light and dark variants.

Code fonts

Choose between JetBrains Mono, Fira Code, and IBM Plex Mono. Fonts are bundled, so they render identically in the preview and the exported image.

Backgrounds

Wrap your code in a gradient, a solid color, or no background at all. Ten presets cover most aesthetics for social posts and docs.

Padding and font size

Control the breathing room around the window and the size of the code text so the final image fits its destination.

Window frame

An optional macOS-style window bar with traffic-light dots and an editable file name in the title.

High-resolution PNG

Export at 2x scale for crisp results on retina screens, or copy the image straight to your clipboard.

How to make a code screenshot

  1. Paste your code. Drop any snippet into the editor on the left. The preview updates live as you type.
  2. Pick the language. Choose the language so the syntax highlighting matches. Plain Text is available for non-code content.
  3. Style it. Choose a theme, font, gradient or solid background, padding, and font size. Toggle the window bar and watermark to taste.
  4. Add a file name (optional). The name appears in the window title bar and becomes the downloaded file name.
  5. Download or copy. Click Download PNG to save a 2x high-resolution image, or Copy Image to paste it straight into another app.

Frequently Asked Questions

Is my code sent to a server?

No. Syntax highlighting and image rendering happen entirely in your browser. Your code never leaves your device, which makes this safe for proprietary or sensitive snippets.

What image format does it export?

It exports a PNG at 2x scale for crisp results on high-density (retina) displays. You can also copy the image directly to your clipboard and paste it into another app without saving a file.

Which languages are supported?

Common languages including JavaScript, TypeScript, TSX/JSX, Python, JSON, HTML, CSS, SQL, Bash, Go, Rust, Java, PHP, YAML, and Markdown. A Plain Text option is available for anything else.

Why does the font in the image match the preview exactly?

The three code fonts are bundled with the site rather than fetched at render time, and the tool waits for the fonts to finish loading before capturing the image. This avoids the common problem where a downloaded code screenshot falls back to a generic system font.

Can I remove the watermark?

Yes. The subtle developertoolkit.dev watermark is on by default but can be turned off with the Watermark toggle in the options bar. Leaving it on is appreciated as it helps others find the tool.

Is this a good alternative to Carbon or ray.so?

Yes. It covers the same core workflow, paste code, pick a theme and background, download an image, and runs fully client-side with no sign-up. The font handling and privacy-first rendering make it a solid free alternative.

Related Tools