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

To preview a local HTML file in current VS Code Desktop, open the file, right-click it in Explorer (or its editor tab), and choose Open in Integrated Browser. You can also click Show Preview in the editor title bar or run Browser: Open Integrated Browser from the Command Palette. The preview updates while you edit. Install Microsoft’s Live Preview extension only when you need a local development server and live reload for a site or app.

Choose the right preview method

VS Code now has two practical ways to see HTML in a browser-like view. The built-in Integrated Browser is the quickest route for inspecting one local file. Microsoft’s Live Preview extension adds a local server and live-reload workflow that is better suited to a multi-file site or an application.

Option Setup What it does Best fit
Integrated Browser Included in VS Code Desktop; open a file or use a preview command Renders the local HTML file and updates as you change it Quick inspection of a single HTML file or small static page
Microsoft Live Preview extension Install the extension, then choose Show Preview Starts a local development server with live reload for static and dynamic pages A site or app that needs server-style serving and continuous reload

Microsoft documents the built-in workflow in its HTML in Visual Studio Code guide and the extension workflow in its getting-started tutorial.

Preview one HTML file with the built-in Integrated Browser

1. Open the file in VS Code Desktop

  1. Launch VS Code Desktop.
  2. Open your project with File > Open Folder…, or open an individual .html file.
  3. Confirm that the file is saved in the workspace you intend to preview. Relative links such as css/site.css and images/logo.svg are resolved from that file’s location.

2. Open the preview

  1. In the File Explorer, right-click the HTML file and select Open in Integrated Browser.
  2. If the file is already open, right-click its editor tab and select Open in Integrated Browser.
  3. With the HTML editor active, you can instead click the Show Preview icon in the editor title bar.

The Integrated Browser opens the document inside VS Code. Microsoft’s HTML documentation says the rendered view updates in real time as you edit the source, so you can keep the code and result visible without switching to a separate browser window. Save the file if your version or workspace settings do not refresh immediately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

3. Use the Command Palette or Browser view

Press Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on macOS, type Browser: Open Integrated Browser, and run the command. You can also use View > Browser or the globe button in the title bar. These entry points are documented in Microsoft’s Integrated browser guide.

4. Check the result

  • Headings, paragraphs, links, images, lists and CSS should appear as they would in a browser.
  • Edit a visible heading or style rule and watch the preview update.
  • If the page uses relative assets, keep the referenced files inside the opened folder and verify the path spelling and letter case.

Open an HTML file in a browser from VS Code

The same Integrated Browser can display a URL. If you select a localhost link in the terminal, chat or another VS Code surface, VS Code documents that it opens in the integrated browser by default. You can also paste the URL into the Integrated Browser opened through Browser: Open Integrated Browser.

This is useful after starting a local server, because the page is then loaded from an HTTP address instead of directly from a file. A server URL can make routing, module loading and other browser behavior closer to the way a deployed site is served.

When Live Preview is the better choice

Choose Live Preview when your project needs a local development server and live reload across multiple pages or dynamic content. It is not mandatory for a basic HTML preview: the built-in Integrated Browser can open a local HTML file on its own.

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

Install Microsoft Live Preview

  1. Open the Extensions view in VS Code with the square-shaped Extensions icon in the Activity Bar.
  2. Search for Live Preview.
  3. Install the extension published by Microsoft.
  4. Open the HTML file you want to serve.
  5. Use the file’s Show Preview command (or the preview button supplied by the extension).

Microsoft’s tutorial describes this installation and the Show Preview workflow for static and dynamic pages. The extension starts a local development server, then reloads the preview as files change.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Use the Integrated Browser as Live Preview’s browser

If you want the extension’s server but prefer to keep the result inside VS Code, enable the livePreview.useIntegratedBrowser setting. Open Settings, search for that exact setting name, and turn it on. The setting is documented in the Integrated browser documentation.

Integrated Browser or Live Preview?

Use Integrated Browser when

  • You need to inspect one HTML file quickly.
  • Your page is a straightforward static document.
  • You do not want to install an extension or start a server.
  • You want the shortest path from an open file to a rendered result.

Use Live Preview when

  • Your project has several pages and shared assets.
  • You need a local HTTP server rather than direct file rendering.
  • You want an extension-managed live-reload workflow for static or dynamic pages.
  • Your app expects to be loaded from a local URL during development.

You can begin with the built-in preview and add Live Preview only when a server-based workflow becomes necessary. Installing Live Preview does not make the basic Integrated Browser requirement disappear; it simply adds a different serving mode.

Build a reliable local preview

Keep paths relative to the document

For a file at project/index.html, a stylesheet at project/css/site.css should be referenced as css/site.css, not as a path from your operating system’s root. The same rule applies to scripts and images. A preview that shows HTML but no styling usually has a broken relative path or a filename case mismatch.

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

Watch the browser-facing output

HTML preview shows the rendered result, not the source text. If you are debugging a script or a failed asset, use the browser’s developer tools where available, or open the same local URL in your regular browser for its Console and Network panels. The VS Code preview itself is still useful for checking layout while you edit.

Serve projects that depend on HTTP

Some projects behave differently when opened as a local file than when served over HTTP. For those projects, start the project’s documented local server and open its localhost address in the Integrated Browser, or use Live Preview. This keeps the preview on the same URL-based path your application expects.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

Desktop VS Code and VS Code for the Web are different

The Integrated Browser documentation describes a VS Code Desktop feature. VS Code for the Web runs the editor inside a browser and has different constraints: Microsoft says the web version has no terminal or debugger and can run only a subset of extensions. A workflow that requires a local runtime, a terminal command or an extension unavailable on the web may therefore require VS Code Desktop or a remote environment.

Before troubleshooting a missing preview command, confirm which product you opened. The browser-based editor is not simply the desktop application displayed in a tab. Microsoft explains these distinctions in Visual Studio Code for the Web.

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

Version and menu-label notes

Exact labels and icon placement can change between VS Code releases. Microsoft’s VS Code 1.121 release notes state that direct local HTML preview no longer requires an extension. Earlier documentation described the Integrated Browser as a preview feature in VS Code 1.109. If your installation predates those changes, update VS Code or use the Live Preview extension instead of assuming the command is missing from your file.

Check Help > About (or the corresponding macOS menu) for your installed version, then compare the available commands with Microsoft’s current HTML documentation and 1.121 release notes. Do not rely on an older tutorial’s screenshots for current menu placement.

Troubleshooting a blank, stale or incorrect preview

“Open in Integrated Browser” is not shown

  • Make sure you are using VS Code Desktop rather than VS Code for the Web.
  • Confirm that the selected file is an HTML document and that it is inside the opened workspace.
  • Update VS Code if it is an older release; direct local HTML preview is documented in the 1.121 release notes.
  • Use the Command Palette and run Browser: Open Integrated Browser as an alternative entry point.

The preview is blank

  • Open the HTML source and check for an incomplete tag or a script that prevents the page from finishing.
  • Reload the preview after saving the file.
  • Try opening the document in a regular browser to distinguish an HTML error from an Integrated Browser issue.

CSS or images do not appear

  • Check every href and src path relative to the HTML file.
  • Match filename capitalization exactly, especially when the project will later run on a case-sensitive host.
  • Confirm that the referenced files are inside the opened folder and have actually been saved.

Changes do not show immediately

  • Save the HTML, CSS or JavaScript file, then reload the preview.
  • If you need a server with continuous live reload across a site, install Microsoft Live Preview and use Show Preview.
  • Verify that the preview is displaying the file you edited, not a second copy with the same name.

The page needs a localhost URL

Direct file preview may not match an HTTP-served page. Start your project’s local server, copy its localhost address, and open it in the Integrated Browser. VS Code documents localhost links opening there by default when selected from terminal, chat or other VS Code areas.

Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Live Preview cannot be installed or run

  • Check that you are in VS Code Desktop and that the extension is the Microsoft-published Live Preview.
  • In VS Code for the Web, extension availability and runtime support are limited; switch to Desktop or a remote environment if the workflow needs an unavailable extension or local runtime.
  • For a single static file, skip the extension and use the built-in Integrated Browser.

The preview opens outside VS Code

Open the Integrated Browser explicitly with Browser: Open Integrated Browser, or enable livePreview.useIntegratedBrowser when using Live Preview. This setting controls which browser surface the extension uses.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Capture a clean result without configuring a browser

If you need a shareable image or PDF of a deployed page rather than an interactive local preview, ScreenshotNeo is a website screenshot API and MCP server. It accepts a URL and returns PNG, JPEG, WebP or PDF; before capture it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets. Each cleanup step can be disabled.

Or skip the browser setup

Use the API after your page is available at a reachable URL. The complete request examples are in the ScreenshotNeo documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
  • Cookie banners, popups and chat widgets are removed before the shot.
  • Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed; response headers identify the page verdict and whether it was billed.
  • An MCP server lets AI agents such as Claude and Cursor use take_screenshot, get_page_info and capture_pdf.
  • The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Every feature is included on every plan.

Sign up for ScreenshotNeo’s free plan to try the 1,000 monthly screenshots without adding a card.

FAQ

Will previewing an HTML file change the file itself?

No. The Integrated Browser renders the document; your source changes only when you edit and save the file in VS Code.

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

Can I use the same preview workflow for a project stored remotely?

You need the project available in the environment where VS Code is running. In VS Code for the Web, terminal, debugger and extension support are limited, so a remote environment or VS Code Desktop may be required for server-based projects.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Is a screenshot API a replacement for an interactive preview?

No. VS Code preview is for inspecting and editing a page interactively. ScreenshotNeo is for producing a captured image or PDF from a reachable URL after the page is ready.

Frequently Asked Questions

Will previewing an HTML file change the file itself?

No. The Integrated Browser renders the document; your source changes only when you edit and save the file in VS Code.

Can I use the same preview workflow for a project stored remotely?

You need the project available in the environment where VS Code is running. In VS Code for the Web, terminal, debugger and extension support are limited, so a remote environment or VS Code Desktop may be required for server-based projects.

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.

Is a screenshot API a replacement for an interactive preview?

No. VS Code preview is for inspecting and editing a page interactively. ScreenshotNeo is for producing a captured image or PDF from a reachable URL after the page is ready.

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.