FIRST CH TOOLS / Images / 79 CODE IMAGE
Code to Image
Turn a pasted code snippet into a PNG with syntax highlighting, a window-style frame, padding, rounded corners, a shadow and a background — ready to drop into a blog post, a social feed or a slide. Japanese and other wide characters stay aligned. Everything happens inside your own browser.
Code
Background
Shape
Export
How to Use
- Paste your codePaste it into the box, or load a text file with "Open a file" or drag and drop. The language is detected automatically; if the guess is wrong, pick it from the list.
- Style itChoose the colour theme (dark or light), font size and line numbers, then a background swatch, padding, corner radius and shadow. If you know where it is going, set the canvas ratio (16:9, 1:1 and so on) too.
- Export"Save PNG" downloads the file and "Copy image" puts it on the clipboard, ready to paste into Slack, X or Google Slides.
About This Tool
A screenshot of your editor drags in panels, tabs and whatever font size you happened to be using. This tool redraws the code as text and wraps it in a background, padding and a window-style frame instead. The title bar can show a file name (or nothing), line numbers are optional, and long lines can wrap at 40 to 100 columns. If you copied a block from the middle of a function, "Remove common indentation" pulls it back to the left edge.
Highlighting uses the copy of highlight.js already bundled for Marp Slides. It is about 600 KB, so the first sample ships pre-highlighted and the highlighter is only downloaded once you change the code or the language (after that the browser cache serves it). Auto-detect chooses among 24 common languages; for very short snippets, pick the language yourself. Code is drawn in IBM Plex Mono, with your device's Japanese font filling in for characters it lacks. Each coloured segment is measured at its real width, so wide Japanese comments never push the following characters out of place.
Drawing happens on a browser Canvas and your code is never sent to a server. The background, shadow and canvas-ratio handling is the same as the Screenshot Frame & Background Maker, so code images and framed screenshots match side by side. To shrink the exported PNG use the WebP Converter; to compare two versions of the code use the Diff Checker.
Style settings can also be passed as URL parameters (the code itself is always pasted locally). For example /en/code-image/?lang=python&theme=light&fs=16&ln=1&title=main.py&bg=gradient&c1=%231f2a44&c2=%234b6cb7&ratio=16:9 (lang=auto,none,javascript,python… / theme=dark,light / fs=10–28 / ln=1,0 (line numbers) / dedent=1,0 / wrap=0,40,60,80,100 / frame=window,none / title=file name / bg=gradient,solid,none / c1, c2=colours / angle=degrees / pad, radius=px / shadow=0–100 / ratio=auto,16:9,1.91:1,4:3,1:1,4:5,9:16 / scale=1,2,3).
Other Tools
- 01Batch Image → WebP ConverterWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 11Encoding & Line Ending ConverterEncoding Converter
- 12Batch Image → AVIF ConverterAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 15Text & Code Diff CheckerDiff Checker
- 16Cron Expression ExplainerCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出
- 28Markdown Table & CSV/TSV ConverterMarkdownテーブル整形&CSV/TSV変換
- 29SQL Query FormatterSQLクエリフォーマッター&整形
- 30QR Code GeneratorQR Code Generator
- 31Regex Tester正規表現テスター
- 32Unix Timestamp ConverterUNIXタイムスタンプ⇄日時変換
- 33New Tab Memo新規タブメモ帳
- 34Image Resizer & Cropper画像リサイズ&クロップ
- 35EXIF Viewer & RemoverEXIF情報の確認&除去
- 36robots.txt Generatorrobots.txt ジェネレーター
- 37Password Generator安全なパスワード生成
- 38Case Converter文字列ケース変換
- 39CSV/TSV ⇄ JSON ConverterCSV/TSV ⇄ JSON 相互変換
- 40PDF Merge, Split & ExtractPDF結合・分割・ページ抽出
- 41Full-width ⇄ Half-width Converter全角⇄半角変換&テキストクリーナー
- 42X (Twitter) Post CounterX(Twitter)投稿の文字ウェイト計算
- 43CSS clamp() Fluid Typography CalculatorCSS clamp() 計算機
- 44CSS Gradient GeneratorCSSグラデーションジェネレーター
- 45Image Colour Palette Extractor画像からカラーパレット抽出
- 46QR Code ReaderQRコード読み取り
- 47SVG Optimizer & Data URISVG最適化&data URI化
- 48Redirect Generatorリダイレクトルール ジェネレーター
- 49IP / CIDR CalculatorIPアドレス・CIDR計算機
- 50ICS Calendar Event GeneratorICS Generator
- 51cubic-bezier Easing Preview & ComparisonEasing Preview
- 52CSS box-shadow Generatorbox-shadow ジェネレーター
- 53Japanese Dummy Text Generator和文ダミーテキスト生成
- 54Social Media Image ResizerSNS画像サイズ一括書き出し
- 55Time Zone Converter & World Clockタイムゾーン変換・世界時計
- 56Date & Business Day Calculator日数・営業日計算
- 57HTML → MarkdownHTML→Markdown変換
- 58HEIC to JPEG/PNG ConverterHEIC Converter
- 59Print Size & DPI Calculator印刷サイズ・DPI計算機
- 60Color Blindness Simulator色覚シミュレーター
- 61SERP Preview & Meta Tag Length CheckerSERPプレビュー&メタタグ文字数チェック
- 62Flexbox & CSS Grid GeneratorFlexbox / CSS Grid ジェネレーター
- 63Text Line Toolsテキスト行操作ツール
- 64Screenshot Frame & Background Makerスクリーンショット枠装飾
- 65Japanese Era ⇄ Western Calendar Converter和暦 ⇄ 西暦変換
- 66URL Slug Generator (Japanese → Romaji)URLスラッグ生成(日本語→ローマ字)
- 67htpasswd Generatorhtpasswd ジェネレーター
- 68OGP Image GeneratorOGP画像ジェネレーター
- 69Stamp Shape Generatorスタンプ形ジェネレーター
- 70Stay Awakeスリープ防止
- 71Screen Recorder with Click Auto-Zoom画面録画+クリック自動ズーム
- 723D Device Mockup Generator3Dデバイスモックアップジェネレーター
- 73OpenAPI Docs & TS Types GeneratorOpenAPI→日本語ドキュメント&TS型定義
- 74Screen Review Board画面レビューボード
- 75AI Decision JournalAI活用案件の判断ログメモ
- 76Card Binder Plannerカードバインダー配置プランナー
- 77e-Stat CSV to Charte-Stat CSV かんたんグラフ化
- 78FAQ Schema (JSON-LD) & Markdown GeneratorFAQ構造化データ(JSON-LD)&Markdown ジェネレーター