Code Screenshot Maker

A snippet goes in and out comes the tidy code picture people use in posts and slides, colouring and window frame included. It is drawn in your browser, so your code never reaches anyone else's server.

How to use it

Paste the snippet in and the colouring follows from it, with the window frame and the background behind it both optional.

  1. Paste the code The language is guessed, or you can name it. Short snippets look best.
  2. Pick a look The theme sets the colours, and the background is what makes the image sit well on a social post.
  3. Save or copy it Save gives you a file; copy puts the image straight on the clipboard for pasting into a chat.
Full instructions
Pixels
Pixels

Your code

The image

In depth

Turning a code snippet into a picture worth sharing

How to paste a snippet, pick a visual style, and save or copy the result as an image that sits well on a slide, a social post, or a bug report - with worked examples and practical tips for keeping it readable.

Screenshot: Making a picture of your code
Making a picture of your code as it appears when the page opens.

Why code ends up as a picture

Text is usually the right way to share code. People can copy it, search it, and screen readers can speak it aloud. But there are a handful of situations where an image works better.

A conference slide needs a fixed layout. A social media post needs to catch the eye while scrolling. A bug report sometimes needs to show exactly what the terminal printed, formatting and all. And a chat message sent through a platform that strips indentation can be rescued by sending a screenshot instead.

The trade-off is real. Nobody can select text from a picture, paste it into an editor, or run it. On a small phone screen, long lines shrink until they become unreadable. For documentation or answers that someone needs to copy, always post the text. Save the image for the places where appearance matters more than access.

What the tool does, step by step

The page draws your snippet onto a canvas with syntax colouring, an optional window frame, and a background. The result is a PNG image you can save to disk or copy straight to the clipboard.

There are three broad steps. Paste the code. Choose how it should look. Save or copy. Every setting updates the preview instantly, so you can try different looks before you commit to one.

Pasting your code and choosing a language

The left panel is labelled Your code. Paste or type a snippet into the text area. Short snippets, around ten to twenty lines, tend to produce the best looking images. Anything much longer starts to shrink when viewed on a phone.

Above the panels sits a row of controls. The first is Language. It defaults to Work it out, which means the tool will try to guess from the content. If the guess is wrong, or if you are pasting something short that does not have enough clues, pick the language yourself. The choices are JavaScript, Python, HTML, CSS, SQL, JSON, Shell, and No colouring. That last option turns off all highlighting and treats the text as plain.

The highlighting is approximate. It colours keywords, strings, numbers, and comments. It is not a full parser, so an unusual edge case may be coloured slightly wrong. For a screenshot this rarely matters.

Picking a look with themes and backgrounds

Theme controls the colour scheme used for the syntax highlights. There are five choices. Midnight uses light text on a dark background - the classic terminal look. Paper reverses that with dark text on a light ground. Forest, Ember, and Monochrome each offer a different mood.

Background sets what sits behind the code window. Gradient is the default and gives the image a soft coloured backdrop that helps it stand out in a feed. Solid uses a flat colour instead. Transparent removes the background entirely, which is useful when you want to drop the code window onto your own slide design without a visible rectangle around it.

Padding controls how much space sits between the code and the edge of the image. It starts at 48 pixels and can go from 0 to 120, in steps of 4. A generous padding makes the image feel more composed. Set it to zero when you want the code to fill every pixel.

Text size sets the font, in pixels, from 10 to 28. The default of 15 suits most screens. Bump it up for a keynote slide that will be projected, or bring it down when you need to fit a wide snippet.

Frame, line numbers, shadow, and file name

Three checkboxes sit beside the size controls. Window frame adds the familiar three dots at the top of the image, mimicking a code editor window. Line numbers prints a column of numbers down the left side. Drop shadow places a soft shadow behind the code panel to give it depth.

All three are on by default. Turning off the window frame gives a cleaner rectangle. Turning off line numbers helps when the snippet is a single expression or a shell command where numbering would look odd.

File name is a text field that starts with example.js. Whatever you type here appears in the title bar of the window frame. Change it to match the real file, or clear it if you do not want a name shown. The file name is purely cosmetic. It does not change how the code is highlighted.

A worked example from start to finish

Suppose you have a short Python function that you want to share on a team chat. Paste these four lines into the code area:

def greet(name): message = f"Hello, {name}!" print(message) return message

Set Language to Python. Set Theme to Midnight for a dark look. Leave Background on Gradient and Padding at 48. Tick Window frame and Line numbers. Type greet.py in the File name field.

The right panel, labelled The image, updates instantly. You see four numbered lines of Python with keywords in one colour, the string in another, and the function name picked out. The whole thing sits inside a windowed frame on a smooth gradient.

Press Copy image. Open your chat app and paste. The image lands inline, clean and readable, with no formatting lost. If the chat app does not support pasting images from the clipboard, press Save PNG instead and attach the downloaded file.

The two buttons and what they produce

Save PNG downloads a file to your computer. The file is named after whatever you put in the File name field, with a .png ending. The image is at full resolution, so it will look sharp on any screen.

Copy image puts the picture on your clipboard. In most modern browsers this works in one click. Some older browsers block clipboard writes, in which case Save PNG is the fallback. Either way the image is the same.

Keeping images readable in a feed

Social platforms and messaging apps shrink images to fit their layout. A wide code image with long lines can become unreadable after that shrink.

The best defence is to keep lines under about sixty characters. Break long lines before you paste. Most languages allow you to split a statement across two lines without changing what it does. The result is a taller, narrower image that survives scaling far better.

Another approach is to trim the snippet to only the interesting part. Five lines that make the point clearly will always beat forty lines where the reader has to hunt for the change.

  • Break lines before column sixty so the image stays readable when scaled.
  • Remove imports and boilerplate that do not help the reader.
  • Use a generous padding so the code does not feel cramped.
  • Choose a dark theme for social posts. Light themes can wash out against a white feed background.

Common mistakes and how to avoid them

  • Posting code as an image when the reader needs to copy it. If someone has to retype what they see, post the text instead.
  • Leaving the language on Work it out when the snippet is too short to guess. A two-line shell command may be mistaken for plain text. Pick Shell yourself.
  • Forgetting to change the file name from example.js. The default looks odd sitting above a Python snippet.
  • Using a light theme on a white background. The image blends into the page and loses its frame. Switch to a dark theme or add a visible background.
  • Pasting a hundred-line file. The image becomes huge and nobody reads it. Crop to the lines that matter.
  • Ignoring the transparent background option when building slides. Gradient looks great on social media but clashes with a carefully designed slide deck.

When another tool fits better

If you need to compare two snippets side by side, a diff viewer shows the changes more clearly than two separate images.

If you want to share runnable code, a paste bin or a gist lets the reader copy and execute it. The image is for display, not for use.

If you are writing documentation, inline code blocks in your markup language give the reader selectable, searchable text with syntax highlighting built in.

Your code stays on your own machine

The image is drawn entirely inside your browser. The snippet is never sent to a server. There is no account, no upload, and no copy stored anywhere outside your device.

You can test this yourself. Load the page, disconnect from the internet, paste a snippet, and press Save PNG. Everything still works. For proprietary code or credentials you accidentally pasted, closing the tab is all the cleanup you need.

Help

Making a picture of your code

Paste the snippet in and the colouring follows from it, with the window frame and the background behind it both optional. What downloads is a picture rather than text, which is the point: it keeps its indentation and its colours wherever it is pasted, in a post, a slide or a bug report.

Paste the code

The language is guessed, or you can name it. Short snippets look best.

Pick a look

The theme sets the colours, and the background is what makes the image sit well on a social post.

Save or copy it

Save gives you a file; copy puts the image straight on the clipboard for pasting into a chat.

A picture of code is not code

Nobody can copy it, search it, or read it with a screen reader, and it is unreadable on a phone the moment the lines get long. That makes these images good for a slide, a social post or a screenshot in a bug report, and bad for documentation or an answer someone needs to use. Where the code is meant to be run, post the text and let people copy it. The one genuine advantage is that a picture cannot be mangled by a chat app that eats indentation.

Good to know

Keep lines under about 60 characters

Wide images get scaled down in feeds until nothing is legible. Break long lines before you render.

Nothing is uploaded

The image is drawn in your browser, so this is safe for code you cannot paste into somebody else's website.

Transparent backgrounds sit on any slide

Turn the background off and you get just the code window, ready to drop onto your own colour.

Highlighting is approximate

It colours keywords, strings, numbers and comments. It is not a full parser and will occasionally get an edge case wrong.

Common questions

How do I make an image of my code?
Paste the snippet, choose a theme and save it as a PNG. Everything happens in your browser.
Is my code uploaded anywhere?
No. The image is drawn locally and never leaves your device.
Can I copy the image straight to the clipboard?
Yes, in browsers that allow it. Otherwise save the file and attach it.
Which languages are supported?
JavaScript, Python, HTML, CSS, SQL, JSON and shell, plus a plain mode with no colouring.
Should I share code as an image?
Only where it will not be run. Nobody can copy or search an image, and screen readers cannot read it.