Guide
Turning a code snippet into a presentable picture
Code on social media and in slides looks better as a picture than as a screenshot of an editor window with toolbars, tabs and notifications. Several websites make such pictures, but many need an account or upload your code to a server. This maker draws the picture in your browser from pasted code, with colouring, a window frame and a background.
Settings
Paste the code and choose a language so that the right patterns are used. Pick a colour theme, night for a dark card, light for a pale one or ocean for a blue-green one, and a background behind the window: purple to pink, blue, sunset, green or transparent. Set a font size, an optional window title such as the file name, and switch the window buttons and line numbers on or off.
How the colouring works
The highlighter reads the code with regular expressions for each language. It finds comments, strings, numbers, keywords, function calls, tags and attributes, and gives each a colour from the theme. This is lighter than the parsers used by editors, which keeps the tool small and fast. Tricky code, such as template strings that contain code, may be coloured in a simple way, but the text itself is never changed.
The window and the picture
The code sits in a rounded window with an optional title bar showing three buttons and the title, and the window floats on the chosen background with a soft shadow. The size of the picture follows the code: more lines make it taller and wide lines make it wider, with a margin around the window. Choose a transparent background to place the window on your own slide.
Tips for good code pictures
Keep snippets short, between five and fifteen lines, and use a large font size so that the text is readable on a phone. Trim imports and boilerplate that do not matter to the point, and avoid horizontal scrolling, since a picture cannot scroll. Remove secrets, keys and personal data before you make the picture. Add a title that tells people the file or the topic.
A worked example
The sample is eight lines of JavaScript: a function greet that builds a message with a template string, logs it and returns its length, followed by a call greet("world");. With the Night theme, the purple background, the title greet.js, window buttons and line numbers on and a font size of 28, the PNG is 790 by 557 pixels. The function, const and return keywords, the strings and the comment each get their own colours, and the line numbers are dimmed.
Limits
Colours are approximate and do not match any editor’s theme. Only the listed languages are supported, and very long snippets make very tall pictures. The tool does not format or run the code, check it for errors or embed it as live text; a picture of code cannot be copied or read by screen readers, so add the text in the post when you can. Your code stays in your browser.
Accessible sharing
A picture of code cannot be read by screen readers or copied by others. When you post it, include the text of the snippet in the post or in a linked page, and describe what the code does in the alt text. This keeps your content open to more readers and lets people reuse the code.
Related tools
- Device Frame Mockup Maker places a screenshot in a browser or phone frame.
- Diff Checker compares two versions of code before you share a picture of the change.
- JSON Formatter tidies a JSON snippet before it goes into a picture.
- Social Post Mockup Maker draws a post that can carry the picture.
Checked against the current version of the Code to Image Maker on .

