How to Use

  • Language: Select your syntax. The logo updates automatically if the checkbox is checked.
  • Title: Add a filename (e.g., "script.js") to display it in the window header.
  • Gradient: Choose a preset or create a custom gradient for the background.
  • Download: Click Download PNG to save your image.

This tool is free to use

If it saved you some time, consider buying me a coffee to support future updates.

Buy me a coffee

CodeSnap v4.2

Social media code image generator
Lang Logo

What does CodeSnap do?

CodeSnap turns a code snippet into a polished, shareable screenshot — syntax-highlighted, wrapped in a mac-style window with a filename header, and set against a gradient background. Paste your code, pick a language for accurate highlighting, choose or build a gradient, and export as a PNG ready for Twitter/X, LinkedIn, or a blog post.

Choose from five built-in gradient presets or build a fully custom one — two or three colours and any angle. The optional language logo in the window title bar (pulled from the Devicon icon set) adds a recognisable touch for whichever language you're sharing.

Frequently asked questions

Is CodeSnap free to use?

Yes, completely free with no account or usage limit.

What languages are supported for syntax highlighting?

JavaScript, CSS, Python, HTML, Java, and PHP are available in the language selector, each with accurate syntax colouring powered by Prism.

Is my code uploaded anywhere?

No. Syntax highlighting and image generation both happen locally in your browser — your code is never sent to a server.

Can I create a custom gradient background?

Yes — select "Custom Gradient" from the theme dropdown to set your own two or three colours and gradient angle, instead of using one of the five presets.

Why might the download fail?

Image capture relies on the language logo (if enabled) loading successfully from its icon source. If your connection blocks that request, try disabling the "Logo" checkbox and downloading again.

Related tools