Skip to content

Code to SVG image

Turn a code snippet into a syntax-highlighted image with a window frame and gradient background.

Input
14
48
Output

Code to SVG image

Paste a code snippet, pick its language, and this tool renders it as a syntax-highlighted image inside a rounded window mockup — the kind of shareable code screenshot you'd post in a blog, a tweet, a slide deck or internal docs. Keywords, strings, comments and numbers are colored automatically, and the window gets an optional macOS-style title bar with traffic-light dots so the result looks like a real editor, not a plain text dump.

Nine languages are supported — JavaScript, TypeScript, Python, JSON, HTML, CSS, Bash, SQL and plain text — each with its own highlighting rules for keywords, strings and comments. Choose a background theme (sunset, ocean, midnight, forest, grape or mono) and the tool wraps the window in a matching gradient card; adjust the padding to control how much of that gradient shows around the window, toggle the drop shadow, set the window title, and switch line numbers or the title bar on or off. Font size scales the whole image, so a short one-liner and a fifty-line function both end up readable.

The output is a self-contained, resolution-independent SVG document: crisp at any size, easy to drop straight into a page or design tool, and small enough to copy as text. Line count, character count and the final image size in pixels update live under the output as you type or change options, so you can see exactly what you are about to copy or download before you do.

Everything happens in your browser using a small built-in highlighter — no code is uploaded, and no third-party syntax-highlighting service ever sees what you paste. That makes it safe to use on unpublished features, internal tools or anything else you would rather not send to an external server just to make a nice screenshot.

FAQ

Which programming languages get syntax highlighting?
JavaScript, TypeScript, Python, JSON, HTML, CSS, Bash and SQL each get keyword, string, comment and number highlighting. Choose "Plain text" for anything else — it renders without color coding.
Can I change the background and the window look?
Yes. Pick one of six gradient themes, adjust the padding around the window, toggle the drop shadow, and turn the title bar with the traffic-light dots and the line-number gutter on or off independently.
What format is the image, and can I get a PNG?
The output is a vector SVG — sharp at any size and easy to embed directly in a page. To get a PNG, open the downloaded .svg in your browser or an image editor and export/save it as PNG from there; this tool does not rasterize it for you.
Is there a limit on how much code I can paste?
No fixed line limit, but the generated image is capped at 10 MB. Extremely long snippets that would exceed that produce a message asking you to shorten the input rather than a giant file.
Is my code uploaded anywhere?
No. Highlighting and image rendering happen entirely in your browser using a small built-in tokenizer — your code never leaves your device.