Code to image
For slides, social posts and chat messages that flatten code into unreadable text: paste a snippet, pick a theme and get a crisp 2× PNG with syntax highlighting, line numbers and a window frame. Your code stays on your device.
Sign in to save this toolUp to 20,000 characters and 500 lines. Tabs become two spaces.
Picks the syntax colours; the code itself is unchanged.
Usually the file name. Leave empty to hide it.
Spacing and text
How to use it
- Paste the code you want to share into the box.
- Choose the language for syntax colours and type a window title, usually the file name.
- Pick a theme, then adjust padding, text size, line numbers and the window frame.
- Select “Download PNG”, or “Copy image” to paste it straight into a chat or slide.
Supported formats and limits
- Up to 20,000 characters and 500 lines. Tabs are drawn as two spaces.
- Images are exported at 2× for sharp text; very large images are exported at a lower scale (never below 0.5×) to stay within browser canvas limits.
- The highlighter colours strings, comments, numbers and keywords only; it is not a full parser, so unusual syntax may be coloured plainly.
- Copying an image to the clipboard needs browser support (current Chrome, Edge and Safari). Where it is missing, the button is hidden and Download still works.
- Text uses your device’s monospace font.
Examples
- A 12-line JavaScript function on the Midnight theme for a conference slide.
- A shell command on the Sky theme with the window frame turned off for a tweet.
Frequently asked questions
Is my code uploaded?
No. The image is drawn on a canvas in your browser, and the code never leaves your device.
Which languages are highlighted?
JavaScript and TypeScript, JSON, HTML, CSS, PHP, Python and shell. Choose “Plain text” for anything else.
Should I use code images in documentation?
No. Images cannot be copied, searched or read by screen readers. Use them to show code; give readers the text too when they need to run it.