Type or paste into the Code source field — up to 65,536 UTF-8 bytes, at most 200 lines and 240 characters per line. The counter next to the label shows the current byte count against the limit, and anything beyond a boundary is refused with a message that names it, so you know exactly what to trim.
02
Pick the language and theme
Choose one of 242 Shiki grammars and 71 distinct themes. Load a sample or paste your own code; highlighting never executes the source.
03
Style the frame
Adjust tab width, shadow, corner radius, watermark and proportions. Use a solid, transparent or local PNG/JPEG/WebP background (8 MiB), with padding, font size, line numbers and window title.
04
Generate the preview
Opening the workspace loads Shiki in this tab and generates an actual example preview. Editing clears it; choose “Generate preview” to render your changes.
05
Download the SVG or PNG
Generate again after edits. Download SVG or PNG at 1×/2×, or copy PNG directly. If image clipboard access fails, download PNG. Exports remain within 4096 pixels per side and 16,777,216 pixels total.
Tool facts
Processing
In your browser
Input leaves this device
Never
Retention
Nothing is stored
Price
Free
Your input stays in the browser.
Code to Image Converter uses its verified local execution path and does not create a hidden input or output history.
Local execution
Runs inside the current browser tab.
No hidden processing
Active tool data never becomes a Toolars document record.
No account required
Use the core workflow without creating a profile. Favorites sync to your account after you sign in.
Immediate reset
Clear the tab and the active working data is gone.
When Code to Image Converter is useful
Export a measured JavaScript snippet at 1×
Enter two lines: const total = 2 + 3; and console.log(total); (40 UTF-8 bytes). Set JavaScript, Dark, #111827, padding 64 px, font 16 px, line numbers on, title sum.js, 1×, tab width 2, shadow off, radius 14 px, no watermark, automatic proportions and system fonts. Generate and download: this local Chromium run produced PNG 406 × 270 pixels (13,206 bytes) and SVG 1,647 bytes with viewBox 406 × 270.
Compare the same snippet at 2×
Keep example 1’s code and settings, select 2×, regenerate and download PNG: 812 × 540 pixels and 32,328 bytes in this local Chromium run. All dimensions and sizes here are measurements, and can vary with fonts and browser. SVG without an embedded font relies on system fonts and may look different on another device.
Embed a font for Latin and Cyrillic
Enter const text = "Café Привет"; with title font.js and example 1’s 1× settings. Upload ToolarsWatermarkWestern.ttf (102,840 bytes), decompressed from https://toolars.com/fonts/pdf-watermark/western-v1.ttf.gz; this test font derives from Noto Sans CJK release Sans2.004 under SIL OFL 1.1 (license: https://toolars.com/fonts/pdf-watermark/OFL.txt). This local Chromium run produced PNG 403 × 245 pixels (10,376 bytes) and SVG 138,612 bytes with the full font. The font rejects 漢字 as missing glyphs; choose another font or system fonts.
What Code to Image Converter actually does
A function you are proud of belongs in the release notes; a tricky snippet needs to illustrate the internal wiki; a conference slide wants a styled fragment instead of a screenshot with cropped tabs. Code to Image Converter turns the snippet into a polished frame with line numbers and a window title, and the exported SVG or PNG drops straight into slides, docs, and chat without any manual cleanup. Because tokenizing and rendering happen in this tab, unpublished source code never travels anywhere.
Common questions
How can I make a small JavaScript image for a slide?
Enter const total = 2 + 3; and choose JavaScript, Light and 1x. Generate a preview and download PNG. The image shows the code, not the calculated result 5: this tool does not execute it. For a larger bitmap, switch to 2x and generate again; its width and height double.
How can I export a JSON example as SVG?
Enter {"ok":true}, choose JSON and generate a preview. Download SVG for a scalable code illustration, or PNG to preserve the rendered appearance. After editing the text, generate again before downloading; the old preview is cleared. This is an image export, not a JSON validation result.
What are the input limits?
Up to 65,536 UTF-8 bytes of code, at most 200 lines with no more than 240 characters each, and a window title of 80 characters or fewer. The export itself is capped at 4,096 pixels per side and 16,777,216 pixels in total; anything beyond these bounds is refused with a specific message.
Is my code uploaded or executed?
Code is processed in this browser tab and is never executed or uploaded. Shiki loads when the workspace opens to render the example; edited code is rendered only after you choose “Generate preview”.
Which languages and themes are available?
Choose one of 242 Shiki grammars and 71 distinct themes. Load a sample or paste your own code; highlighting never executes the source.
What does the Export scale change?
1x uses the measured image dimensions. 2x doubles both width and height, producing four times as many PNG pixels; it does not add code detail or change the text. Both scales must fit the export limits. Reduce the scale if export is too large.
Should I download the SVG or the PNG?
PNG preserves the pixels rendered here. SVG remains scalable; without an uploaded font it relies on system fonts, which can change on another device. An accepted uploaded font is embedded in full, but the destination viewer must support embedded fonts. Use PNG when consistent appearance matters.
Why did the preview disappear after I changed a setting?
By design: any edit to the code, language, theme, background, padding, font size, title, line numbers, or scale invalidates the old preview instead of showing a stale image. Press Generate preview again to render the updated frame.
Which fonts can I embed?
TTF/OTF, up to 24 MiB. Choose a font you may embed. Static outline fonts with unrestricted embedding are supported; variable/color fonts are refused. The full font is included in SVG. Missing glyphs stop generation. No file is uploaded. Without a font, SVG uses system fonts.