For Windows - Open your Default Browser - Tested on VS Code v 1.1.0

Answer to both opening a specific file (name is hard-coded) OR opening ANY other file.

Steps:

  1. Use ctrl + shift + p (or F1) to open the Command Palette.

  2. Type in Tasks: Configure Task or on older versions Configure Task Runner. Selecting it will open the tasks.json file. Delete the script displayed and replace it by the following:

    {
        "version": "0.1.0",
        "command": "explorer",    
        "windows": {
            "command": "explorer.exe"
        },
        "args": ["test.html"]
    }
    

    Remember to change the "args" section of the tasks.json file to the name of your file. This will always open that specific file when you hit F5.

    You may also set the this to open whichever file you have open at the time by using ["${file}"] as the value for "args". Note that the $ goes outside the {...}, so ["{$file}"] is incorrect.

  3. Save the file.

  4. Switch back to your html file (in this example it's "text.html"), and press ctrl + shift + b to view your page in your Web Browser.

Answer from yushulx on Stack Overflow
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Live Preview - Visual Studio Marketplace
Extension for Visual Studio Code - Hosts a local server in your workspace for you to preview your webpages on.
People also ask

How to change my HTML browser in VS Code?
Configure the **default browser** under the **Live Server** or **Live Preview** settings.
🌐
dhiwise.com
dhiwise.com › post › smart-ways-to-view-html-files-in-visual-studio-code
Smart Ways to View HTML Files in Visual Studio Code
How to open HTML in VS Code?
Open your file in the **Explorer**, right-click, and choose **Open in Browser** or **Open with Live Server**.
🌐
dhiwise.com
dhiwise.com › post › smart-ways-to-view-html-files-in-visual-studio-code
Smart Ways to View HTML Files in Visual Studio Code
How do I preview an HTML page in Visual Studio?
Right-click the file and select **Open with Live Server** or use the **HTML Preview** extension.
🌐
dhiwise.com
dhiwise.com › post › smart-ways-to-view-html-files-in-visual-studio-code
Smart Ways to View HTML Files in Visual Studio Code
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › html
HTML in Visual Studio Code
November 3, 2021 - No, VS Code doesn't have built-in support for HTML preview but there are extensions available in the VS Code Marketplace.
🌐
Visual Studio Code
code.visualstudio.com › docs › debugtest › integrated-browser
Integrated browser
November 3, 2021 - If you want to use the integrated browser instead of the Simple Browser, enable the simpleBrowser.useIntegratedBrowser Open in VS Code Open in VS Code Insiders setting. The Live Preview extension can use the integrated browser for previewing web pages.
🌐
GitHub
github.com › auchenberg › vscode-browser-preview
GitHub - auchenberg/vscode-browser-preview: A real browser preview inside your editor that you can debug. · GitHub
This enables a secure way to render ... as in-editor debugging and more! ... Click the new "Browser Preview" button in the Side Bar to the left or run the command Browser View: Open Preview...
Starred by 4.4K users
Forked by 154 users
Languages   TypeScript 90.5% | CSS 6.1% | JavaScript 2.1% | HTML 1.3%
Find elsewhere
🌐
DhiWise
dhiwise.com › post › smart-ways-to-view-html-files-in-visual-studio-code
Smart Ways to View HTML Files in Visual Studio Code
December 16, 2024 - Preview the HTML File: Click the “Preview” button in the top right corner of the editor or right-click the file and select Preview from the context menu. This will open a split-screen view with your HTML code and the rendered web page.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Live HTML Previewer - Visual Studio Marketplace
Extension for Visual Studio Code - Edit and preview HTML documents in VS Code
🌐
It's FOSS
itsfoss.com › vs-code-run-html
How I Run HTML Code in VS Code
April 29, 2025 - If you're working with HTML regularly, whether for client projects, portfolio pages, or just experimenting, it’s important to have a smooth way to preview your changes as you go. VS Code, by itself, doesn’t render HTML in a browser.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
HTML Preview in VSCode
Extension for Visual Studio Code - Preview Hyper Text Markup Language (.html) and Scalable Vector Graphics (.svg) files in VSCode
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
HTML Preview - Visual Studio Marketplace
Extension for Visual Studio Code - Provides ability to preview HTML documents.
🌐
Wikihow
wikihow.com › computers and electronics › internet › website and blog creation › markup languages › html › 4 ways to run a html file in visual studio code - wikihow
4 Ways to Run a HTML File in Visual Studio Code - wikiHow
August 21, 2025 - Type start followed by the HTML file name and press ↵ Enter. For example, if you wanted to run your index HTML file, you would type start index.html and press Enter. This launches the HTML file in a separate window allowing you to preview ...
🌐
Medium
medium.com › geekculture › how-to-run-html-in-visual-studio-code-ba4c6818c919
How to run HTML in Visual Studio Code | by Annie Wang | Geek Culture | Medium
April 14, 2024 - Once the extension is being installed, write click the file, you will find there are two items being added to the dropdown menu: Open in Default Browser and Open in Other Browsers. Click it, the file will be opened in pop-up windows. ... The display with this extension can’t display lively, and it has to be refreshed once changes happen in the HTML file, as shown below: the HTML has been changed to “hello!”, the display doesn’t change automatically. But this is my experience, if there is anything wrong, please feel free to make comments. ... HTML Preview is good to display rendered web pages inside VSC lively.
🌐
DEV Community
dev.to › jamesqquick › visual-studio-code-browser-preview-5dgf
Visual Studio Code Browser Preview - DEV Community
April 28, 2020 - Open the command palette (control + shift + p on Windows and command + shift + p on Mac) and search for Browser Preview: Open Preview. Now, you can type in the url of your app in the browser.
🌐
GitHub
github.com › coderfee › vscode-open-in-browser
GitHub - coderfee/vscode-open-in-browser: Preview html file in browser
Open an html file, Windows and Linux keyboard shortcut is Ctrl+Alt+O, for MacOS is Cmd+Alt+O. If you want to preview html in your default browser directly, please type Ctrl+K D.
Starred by 9 users
Forked by 7 users
Languages   JavaScript 94.5% | HTML 5.5% | JavaScript 94.5% | HTML 5.5%
🌐
OpenReplay
blog.openreplay.com › live-browser-preview-vs-code
Live Browser Preview in VS Code: A Quick Guide
For Live Preview: Right-click any HTML file and select “Show Preview” for embedded view or “Show Preview in External Browser” for traditional workflow.