How to use the Code Screenshot Generator
- Paste your code and choose the language.
- Pick a theme, background, padding and font size.
- Download the PNG.
What does this tool do?
Code images are perfect for tweets, LinkedIn posts, presentations and tutorials, where formatted code isn't supported. The image is drawn at twice the resolution, so text stays crisp on high-density screens. Your code is highlighted and rendered locally — nothing is uploaded.
Everything runs in your browser — nothing you paste is uploaded.
Why use it?
- Four themes.
- 2× resolution PNG.
- Private — no upload.
Use cases
- Share a snippet on X, LinkedIn or Instagram, where code formatting isn't supported.
- Put readable code on slides and in documentation.
- Make tutorial images with a window title that names the file.
Common mistakes
- Pasting a long file. Images work best with 5–25 lines; for more, share a link to the code instead.
- Choosing a small font size for slides. The image is sharp, but small text is still hard to read from the back of a room.
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
Which languages are highlighted?
TypeScript/JavaScript, Python, HTML/XML, CSS, Go, Rust, SQL and shell scripts. Other languages still render cleanly, just without colours for every keyword.
Which themes and backgrounds can I use?
Four colour themes — Midnight, Dracula, GitHub and Forest — on a choice of gradient backgrounds or a transparent one, with adjustable padding, font size, line numbers and window buttons.
Why is the PNG twice the size I expected?
It's drawn at 2× resolution so the text stays crisp on high-density (Retina) screens and when platforms compress the image.
Is my code uploaded?
No. Highlighting and rendering happen in your browser, so private code never leaves your device.
Last reviewed by the M2Toolkit team.