Code to Image

Paste code, pick a theme and a background, and download a PNG worth putting in a post or a slide. It renders at twice the display size, so the text stays sharp on the high-density screen almost everyone reads on — a 1x capture looks soft immediately. Choosing no background gives a transparent PNG, so the image sits on a dark or light page without the white rectangle that gives most code screenshots away. There is no syntax highlighting, on purpose: doing it properly needs a parser for every language, and a highlighter that guesses wrong colours a variable as a keyword, which reads as an error in your code rather than in the tool. Indentation is preserved exactly, which for Python or YAML is the whole point.

Choosing a background

BackgroundBest for
GradientSocial posts — fills the frame
TransparentSlides and docs where the page colour shows through
Large paddingImages that will be cropped to a square
No paddingEmbedding directly in a layout

When to use it

  1. Share a snippet on social media without a wall of text.
  2. Put code into a slide deck at a readable size.
  3. Illustrate a blog post or newsletter.
  4. Include a code example in a design mockup.
  5. Make a before-and-after pair for a pull request write-up.

How to Use

  1. Paste your code and set the filename.
  2. Choose a theme, background, padding and text size.
  3. Download the PNG.

Features

  1. Four themes, light and dark
  2. Gradient or fully transparent background
  3. Optional window bar with a filename
  4. Adjustable padding and font size
  5. 2x rendering for sharp text
  6. Indentation preserved exactly

FAQs

Why is there no syntax highlighting?

Because doing it correctly means parsing each language, and a highlighter that guesses the language wrong is worse than none — a variable coloured as a keyword looks like a bug in your code, not in the tool. For the short snippets people turn into images, plain monospaced text reads fine.

Is my code uploaded?

No. The image is rendered in your browser and never leaves it.

Why does the image look sharp on my phone?

It is rendered at twice the on-screen size. Capturing at 1x produces an image that is visibly soft on any high-density display, which is essentially every phone and most laptops made in the last decade.

Can I get a transparent background?

Yes — choose the last background option. The PNG keeps its transparency, so the card sits on whatever colour your post uses instead of carrying a white box around it.

Will my indentation be preserved?

Exactly as you typed it, including tabs and trailing structure. That matters for Python and YAML, where collapsed whitespace would make the snippet wrong rather than just ugly.

What size image do I get?

It follows your content and padding, at 2x. A short snippet produces a small image; a long one produces a tall one. Reduce the font size or padding if you need it smaller.

Technical Details

The card is laid out as ordinary HTML and rasterised with html2canvas at twice its display size, because a PNG captured at 1x is visibly soft the moment it is viewed on any modern display — every phone and most laptops have been beyond 1x for a decade. The background is captured as transparent when no gradient is chosen, so the image can sit on a dark or light post without a white rectangle around it, which is the usual giveaway. Syntax highlighting is deliberately absent: doing it properly needs a parser per language, and a highlighter that guesses the language wrong produces colouring that is actively misleading — a variable coloured as a keyword reads as a mistake in the code rather than in the tool. Plain monospaced text is honest and, for the short snippets these images are usually made from, not much worse to read. Whitespace is preserved exactly rather than collapsed, so indentation survives, which for Python or YAML is the difference between a usable image and a wrong one. The filename in the window bar is sanitised before being used as the download name, since a snippet's title routinely contains slashes and colons that no filesystem accepts.

Developer Tools

Developer Tools

  • Hash Generator
  • Email Validator
  • User Agent Parser
  • Chmod Calculator
  • HTML to Markdown
  • Markdown Table Generator
  • JavaScript Beautifier
  • GraphQL Formatter