Code to Image
Turn code into a clean image for slides, reports and social posts: automatic highlighting for 30+ languages, light and dark themes, a window frame and line numbers, exported as high-resolution PNG or SVG.
Free, no sign-up
Saved on your device only
Works offline after first open
The tool
Loading the tool…
How to use
- Paste code or open a file.
- Choose the language (or auto), theme and background.
- Toggle the window frame and line numbers, and adjust size and padding.
- Download the image as PNG or SVG.
Privacy & how it works
Saves your data in this browser only (back it up or delete it from “My data”).
- Engine: hljs (open-source libraries bundled with the site).
- Works offline after you open it once.
Frequently asked questions
Is the image sharp enough for slides and print?
Choose 2× or 3× for a crisp PNG, or SVG, which scales without blurring (the text stays as text).
Why does the SVG font look slightly different?
SVG uses the fonts of the device that opens it. For an identical look everywhere, use PNG.
Are Arabic comments drawn correctly?
Yes, Arabic letters are drawn joined. Lines that mix Arabic and English are laid out left-to-right, like code editors.
Is my code uploaded?
No. Highlighting and drawing happen in your browser.
Related tools
JavaScript Formatter & CompactorBeautify JavaScript or JSON with your choice of indentation and brace style, or compact it by removing comments and whitespace while keeping the line breaks the code relies on. Names are never changed.HTML Formatter & MinifierBeautify HTML with clear indentation or minify it for production: removes comments and extra whitespace, keeps pre and textarea intact, and safely compacts inline CSS and JS. Fully local.SQL Formatter & MinifierFormat SQL queries for MySQL, PostgreSQL, SQL Server, SQLite and more, with keyword case and indentation options, or minify them to one line without comments.Compress ImagesShrink JPG, PNG and WebP images with control over quality and dimensions. Compression runs on your device, and EXIF data is dropped from the output.