OOnDevice

Code to Image

Turn code snippets into beautiful images. Choose themes, adjust padding, and export as PNG.

Works offlineNothing uploaded
function greet(name) { const message = `Hello, ${name}!`; console.log(message); return message; }

How to use it

1

Paste your code

Enter or paste the code snippet you want to capture.

2

Customize the style

Choose the theme, language, font size, and background.

3

Export the image

Download your code snippet as a PNG image.

When to use Code to Image

You're writing a dev blog post about a tricky TypeScript generic pattern and need a shareable image of the snippet — without setting up a GitHub Gist or taking a terminal screenshot that looks like it was captured on a 2009 laptop. Paste your code, pick a syntax theme, adjust font size and padding, and shiki handles the highlighting while html2canvas renders a high-resolution PNG. The output is the kind of clean code card you see on Twitter threads and conference slides. Supports JavaScript, TypeScript, Python, Go, Rust, and most C-like languages. Rendering happens on your device — proprietary logic or unreleased features in the snippet never reach an outside server.

  • Create a clean code card for a TypeScript tip on a dev blog post
  • Share a clever algorithm snippet on a conference slide deck
  • Post a pull request pattern to a Slack thread without a GitHub Gist

About this tool

Turn a code snippet into a clean, shareable image — the kind you see on Twitter threads, dev blog posts, and conference slides. Paste your code, pick a syntax theme, adjust the font size and background, and export a high-resolution PNG. Supports JavaScript, TypeScript, Python, Go, Rust, and most C-like languages with keyword highlighting. No server sees your code — rendering happens entirely on-page. Handy for sharing a tricky function without a GitHub gist, posting an interview question, or making a pull request screenshot that doesn't look like a terminal dump.

Frequently asked

What languages are supported for syntax highlighting?
The tool applies keyword-based highlighting that works well with most C-like languages including JavaScript, TypeScript, Python, Go, Rust, and more.
What image format is the export?
Code snapshots are exported as high-resolution PNG images, perfect for sharing on social media or in presentations.
Is this code-to-image tool private? Does it send my code to a server?
No. shiki highlights the syntax and html2canvas renders the PNG entirely in this browser tab — the snippet, including any proprietary logic, is never transmitted to any server.