← All text tools

Code to image

Turn a code snippet into a shareable picture with syntax colours, themes, line numbers and a window frame, saved as PNG or SVG.

  • Free
  • No sign-up
  • Works on any device

About Code to image

Paste a snippet and the tool colours comments, strings, numbers, keywords, function names and types with a simple built-in highlighter for JavaScript, Python, HTML, CSS, JSON, SQL, shell and C-style languages. Choose a theme, a window frame with three dots, line numbers, padding and a gradient backdrop. The result is a PNG at one to three times the size, or an SVG whose text stays sharp at any zoom, ready for slides, posts and documentation.

How to use Code to image

  1. Paste your code and choose its language and a colour theme.
  2. Pick the window frame, backdrop, font size, padding and whether to show line numbers.
  3. Download a PNG for posts or an SVG for slides and documents.

Why use this tool?

Also known as

Frequently asked questions

Is the highlighting as exact as my editor's?

No. It is a compact highlighter based on patterns, not a full parser, so unusual syntax may be coloured imperfectly. Choose Plain text if you prefer no colours at all.

Why does the SVG look different on another computer?

The SVG uses a monospace font stack, so the exact font depends on the device. A PNG is fixed, so use it when the look must be identical everywhere.

Is my code uploaded anywhere?

No. The picture is drawn in your browser and nothing is sent to a server, so you can use it with private code.

Is Code to image free?

Yes. Code to image on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Related tools