How to use
- Paste your code into the input box. The language is auto-detected by default; pick it from the list if the guess is wrong.
- Choose a theme (Midnight, Daylight, Dusk) and a background (Sunset, Ocean, Violet, Mint, Slate, or transparent).
- Adjust the font size, window title (file name), line numbers, outer margin and line wrapping. The preview updates at once.
- Pick an export scale (1x, 2x, 3x) and press Download PNG or Copy image.
For blogs, slides, social posts and docs, this card gives sharper text and a consistent size than a screen capture.
Options
| Option | Description |
|---|---|
| Language | JavaScript, TypeScript, Python, Java, Kotlin and C#, C and C++, Go, Rust, SQL, Bash, JSON, YAML, HTML and XML, CSS, plain text |
| Theme | Two dark (Midnight, Dusk) and one light (Daylight) |
| Background | Five two-color gradients and transparent. Transparent suits a window-only PNG with no outer margin |
| Window title bar | Draws three dots like a macOS window and a centered title (the file name) |
| Line numbers | You can set the first number, handy for showing the middle of a long file |
| Wrap long lines | Breaks lines at 60, 80, 100 or 120 columns so the image does not grow too wide |
| Tidy | Removes blank lines at both ends and the indent common to every line. Tabs become 2 or 4 spaces |
How the language is detected
It guesses from the shape of the code. When unsure it keeps plain text, so choose the language yourself if colors look off.
- Starts with
{or[and parses as JSON: JSON. Starts with<!DOCTYPE html>or a tag like<div: HTML - Starts with
SELECT,INSERT INTOorCREATE TABLE: SQL. Shell commands such as#!/bin/bashornpm install: Bash package mainwithfunc: Go.fn main(): Rust.#include: C.public class: Javadef,elif,print(...): Python.const,=>,console.log: JavaScript, and with: stringorinterfaceit becomes TypeScript
How the colors are applied
Instead of parsing the full grammar, a simple tokenizer picks out keywords, strings, numbers, comments, function names, capitalized types, properties and operators. Comments and template strings that span lines, and Python """ strings, are colored line by line. Inside HTML <script> and <style> the JavaScript and CSS rules are used. It is not as precise as an IDE’s syntax analysis, so unusual syntax can be colored differently.
Size and limits
- Up to 20,000 characters and 200 lines are drawn. Longer code shows the first 200 lines.
- The scale is lowered automatically so no side exceeds 8,192px, and a notice is shown.
- Copying the image only works when the browser allows clipboard writes. If not, save a PNG.
- The font is the monospace font of your device, so letter shapes differ a little between devices, and a saved PNG keeps the look from the device that made it.
Frequently asked questions
How do I make a code screenshot?
Paste the code, pick a theme and background, and save as PNG. No separate capture tool is needed.
Can I save just the window without a background?
Set the outer margin to None and only the window is saved as PNG. The area outside the rounded corners is transparent.
How do I save in high resolution?
Choose 2x or 3x. The screen size stays the same but the pixel count grows, which keeps slides and print sharp.
Do passwords or tokens in my code leave the browser?
No. The image is made on a canvas in this browser and is not sent anywhere. Sharing the saved image is up to you, so check that no passwords or keys are in the code before you publish it.
Related tools: Screenshot Beautifier, JS Beautify and Minify, Color Converter, CSS Gradient Generator, Add Text to Image.
Your code is processed in your browser and never sent to a server.