Handitab

Code to Image

Turn a code snippet into a shareable PNG image with a dark or light theme, monospace type, padding, and an optional window title bar.

About Code to Image

A code image is a picture of a code snippet for slides, social posts, and documentation where pasted text would lose its formatting. This tool draws your code in a monospace font on a rounded panel over a colored backdrop, at twice the pixel density so it stays sharp on high-resolution screens. Tabs become two spaces and long lines are not wrapped. The text is drawn in a single color without syntax highlighting.

Also known as: Code to Image Converter, Code Screenshot Generator, Code Snippet Screenshot.

How to use Code to Image

  1. Set "Code", "Theme", "Font size" and "Outer padding", and the other options. The preview updates as you change them.
  2. Check the preview, then press "Download result" to save the file.

Questions about Code to Image

Should I share code as an image or as text?

Use text whenever readers may want to copy the code or use a screen reader, since an image cannot be selected or read aloud. Images suit previews and slides. When you post one, include the code or a link to it as well.

Runs in your browser. Page last updated .

More image tools

All 73 image tools