Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The right way to capture a screenshot in Visual Studio Code depends on what must be visible. To share a polished image of selected code, install Code Screenshot, select the lines, and run Code Screenshot: Capture Selection. To show the complete editor, panels, or desktop, use your operating system’s screenshot tool or the Capture Window extension. VS Code itself does not document a universal built-in screenshot command.

This guide covers both workflows, their shortcuts, output formats, history handling, shortcut customization, failure recovery, and an API alternative for web pages.

Decide what you need to capture

Start by choosing the capture scope. The choice determines the tool, image style, and amount of cleanup required.

Goal Best route Result
Share selected source code as a presentation-ready card Code Screenshot extension Theme-aware PNG, SVG, or GIF of the selection
Show the VS Code window, editor chrome, panels, or layout Operating-system screenshot or Capture Window A normal window image, with the interface visible
Show the entire monitor or multiple applications Operating-system screenshot tool A desktop capture, including anything visible on screen

A code-card tool is not a substitute for a desktop capture: it intentionally omits most of the VS Code interface. Conversely, a desktop screenshot preserves the interface but may include unrelated tabs, notifications, or personal information.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Open the Command Palette first

VS Code’s Command Palette is the quickest way to find both built-in actions and extension commands. Microsoft describes it as providing access to all VS Code functionality.

  • macOS: press Shift+Command+P.
  • Windows or Linux: press Ctrl+Shift+P.

Type part of a command name, select the matching entry, and press Enter. Commands supplied by an extension appear only after that extension is installed and activated. If a shortcut listed by an extension does not work, use the Command Palette entry; it reflects the command currently available in your installation.

Create a polished code screenshot with Code Screenshot

Code Screenshot is designed for a selected block of source rather than the complete application window. Its Marketplace listing documents PNG, SVG, and GIF export, support for macOS, Windows, and Linux, and shortcuts that can vary by platform.

Install the extension

  1. Open the Extensions view in VS Code with Shift+Command+X on macOS or Ctrl+Shift+X on Windows/Linux.
  2. Search for Code Screenshot.
  3. Choose the listing published by utiltools and select Install.

Extension details and command names can change with a new release, so verify that the installed listing is the one that contributes Code Screenshot: Capture Selection.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Capture selected lines

  1. Open the file you want to show.
  2. Drag across the exact lines and columns to include. Make the selection before invoking the command; the extension uses that selection as its input.
  3. Open the Command Palette and run Code Screenshot: Capture Selection.
  4. Review the preview and adjust its available presentation controls.
  5. Choose Copy Image to put the result on the clipboard, or Save Image to export it.

The documented shortcuts are Option+Shift+Command+S on macOS and Ctrl+Alt+Shift+S on Windows/Linux. Treat these as extension-version-dependent: a different keybinding, operating-system reservation, or user override can change the effective shortcut.

Choose an output format

  • PNG: a practical default for documentation, chat, and issue reports.
  • SVG: useful when the destination preserves vector images and you want crisp scaling.
  • GIF: available when an animated result is appropriate.

The extension follows the current editor theme, so switch VS Code to the light or dark theme you want before opening the preview. Select only the lines needed for the explanation; a shorter image is easier to read on a phone and less likely to expose secrets in surrounding code.

Capture the complete VS Code window with Capture Window

Use Capture Window when the screenshot must include the title bar, activity bar, editor tabs, terminal, sidebars, or other VS Code chrome. The extension adds a Take Screenshot command and a screenshot-history view.

  1. Install Capture Window from the Visual Studio Marketplace.
  2. Open the Command Palette.
  3. Run Take Screenshot.
  4. Open the extension’s history view to review or open the saved image.
  5. If you need a different storage location, change the extension’s configurable history folder in VS Code settings.

This workflow is useful for bug reports and tutorials where the surrounding editor state explains the code. It is not the same as selecting a few lines for a clean code card: panels, tabs, and other visible content remain in the image.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Use your operating system for a window or desktop capture

VS Code’s built-in documentation does not describe a universal native screenshot command. For a whole-window or full-desktop image, use the screenshot utility supplied by your operating system. This avoids adding an extension when you only need a one-off capture.

Prepare the window

  • Resize VS Code so the relevant file and panel are visible.
  • Close terminals, tabs, or notifications that contain unrelated or confidential data.
  • Put the cursor somewhere unobtrusive and wait for diagnostics or progress indicators to settle.

Capture the intended area

Choose the operating system action for a selected region, active window, or entire display. The exact key combination depends on the operating system and version, so use its screenshot utility’s current on-screen instructions. A region capture is usually preferable to a full desktop image because it removes unrelated applications and reduces later cropping.

Compare the available methods

Method Scope Style Formats or storage Installation History
Code Screenshot Selected code Polished, theme-aware card PNG, SVG, GIF; copy or save Required Not its primary purpose
Capture Window VS Code window Raw interface capture Saved images managed through extension history Required Yes; configurable history folder
Operating-system tool Window, region, or desktop Raw screen capture Determined by the operating system None Determined by the operating system

Fix shortcut and command problems

The command does not appear

  • Confirm that the extension finished installing and reload VS Code if it requests a reload.
  • Search for the exact command name in the Command Palette rather than relying on a shortcut.
  • Check that the extension is enabled for the current workspace and profile.

The shortcut does nothing

Shortcuts can conflict with another VS Code command, an operating-system shortcut, or another application. Open File > Preferences > Keyboard Shortcuts on Windows/Linux, or the equivalent Keyboard Shortcuts command on macOS. Search for the command, inspect existing keybindings, and assign an unused combination. VS Code lets you modify default shortcuts, and its keybindings editor shows the effective binding for your installation.

The capture contains the wrong code

  • Cancel the preview, return to the editor, and make a fresh selection.
  • Ensure the intended editor has focus; a selection in a different pane can be easy to miss.
  • For a window capture, close or hide panels that should not appear before running Take Screenshot.

The image is cut off or hard to read

  • Reduce the selection to the lines that support the point.
  • Increase the editor font size before creating a code card.
  • For a complete-window image, maximize VS Code or capture a smaller region instead of shrinking the final image excessively.

The file is not saved where expected

Code Screenshot lets you choose Copy Image or Save Image. Capture Window keeps images in its history location; inspect or change that folder in the extension settings. An operating-system screenshot follows that system’s own save and clipboard behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Privacy, reproducibility, and quality checks

Review every image before sharing. Source files can contain API keys, access tokens, customer data, internal hostnames, or comments that are harmless in code but confidential in context. A code-selection capture reduces accidental disclosure; a window or desktop capture requires a wider inspection.

For repeatable documentation, standardize the same VS Code theme, font size, zoom level, panel layout, and selection boundaries. Keep the original PNG or SVG when possible, and export a resized copy only for a destination with strict dimensions. GIF is useful only when the recipient supports it and motion adds information.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If what you actually need is a screenshot of a public web page, ScreenshotNeo returns an image or PDF through one HTTP request. It does not capture your local VS Code window or an unsaved local file, so use the VS Code methods above for editor content. For a hosted documentation page, the cURL request is:

ScreenshotNeo API documentation

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://code.visualstudio.com -o shot.webp

The same request in Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://code.visualstudio.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

And in Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://code.visualstudio.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts PNG, JPEG, WebP, or PDF output and has options for full-page captures with lazy images loaded, CSS-element selection, dark mode, device presets and custom viewports, retina scale, PDF paper settings and page ranges, custom CSS or JavaScript, clicks before capture, hidden selectors, waits for a selector, delay, or network idle, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, cache TTL, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Before capture, it accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed. Every response reports the page verdict and billing status in X-Page-Verdict and X-Billed headers. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

Plan Allowance Price
Free 1,000 shots/month $0; no card
Starter 3,000 shots $5
Growth 15,000 shots $15
Pro 60,000 shots $39
Scale 250,000 shots $99
Business 1,000,000 shots $249

Yearly billing gives two months free, and every feature is included on every plan. Create a free ScreenshotNeo account to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Can VS Code take a screenshot without installing an extension?

Yes. Use your operating system’s screenshot utility for a window, region, or desktop image. VS Code does not document a universal built-in screenshot command.

Which method should I use for a code snippet in a tutorial?

Use Code Screenshot when only selected lines should appear as a polished image. Use an operating-system capture or Capture Window when the surrounding VS Code layout is part of the explanation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why can another application prevent a VS Code shortcut from working?

A key combination may already be reserved by the operating system or another application. Check the Keyboard Shortcuts editor and assign an unused binding to the extension command.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.